export-pdf
Skill0 starsChanged 7 days agoMITView on GitHub
Export an HTML artifact to PDF via headless Chromium (puppeteer Page.pdf). For multi-slide decks one page per <section>.
- Installs packages
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- bluzir/claude-code-designedited, first seen Apr 20, 2026
- ChAPgen/viatheir own version, first seen Mar 5, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- bluzir/claude-code-design★ 10239% same
Wrote their own version · 1
- ChAPgen/via★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- animated-videoSkill
- apply-editsSkill
- apply-tweaksSkill
- copy-exampleSkill
- create-design-systemSkill
- doctorSkill
- export-pptxSkill
- export-standaloneSkill
- governance-reviewSkill
- handoffSkill
- ingest-documentSkill
- ingest-figmaSkill
- ingest-githubSkill
- ingest-screenshotSkill
- inspectSkill
- interactive-prototypeSkill
- live-reloadSkill
- local-commentsSkill
- make-deckSkill
- make-editableSkill
- make-tweakableSkill
- publishSkill
- register-assetSkill
- ship-branchSkill
- snapshotSkill
- sync-design-systemSkill
- use-design-systemSkill
- verify-artifactSkill
- wireframeSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
If the output directory does not exist: Bash(mkdir -p <output-dir>) with the literal directory (no command substitution — the bash guard …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Export PDF
Produce a PDF from an HTML artifact. Uses puppeteer's Page.pdf() which is lossless vector when the source is HTML/CSS/SVG.
Why puppeteer instead of Chrome DevTools MCP: the MCP does not expose Page.printToPDF directly (only take_screenshot, list_console_messages, evaluate_script, etc.). Using puppeteer via a Node script is deterministic and matches /export-pptx.
Preflight
Bash(node --version)— required (which nodeis blocked by the guard)Bash(ls -d node_modules/puppeteer)— if it printsNo such file or directory, tell the user to runnpm install -D puppeteer@24.41.0in a separate shell (or/doctorfor the full list), and stop. Do not usetest -dhere: it prints nothing on failure and the exit code is not visible in the tool result, so a missing install reads as a pass and the script then dies onimport puppeteerwith a bare Node stack trace
Steps
- Resolve paths:
$0= input HTML (required)$1= output (default: input with.pdfextension)- If the output directory does not exist:
Bash(mkdir -p <output-dir>)with the literal directory (no command substitution — the bash guard rejects$(...))
- Run export script:
(The script is versioned atBash(node scripts/export-pdf.mjs "<input>" "<output>")scripts/export-pdf.mjs. If it is missing, restore it from git — do not rewrite it, and never runnodewith anything other than that script.) - Report size + path.
Script behaviour (scripts/export-pdf.mjs)
- Launches headless Chromium without
--no-sandbox(only added whenCIis set) - Blocks every outbound request except the artifact's own directory over
file://,data:,blob:,https://unpkg.com/and Google Fonts. A deck that loads../starters/deck_stage.jsinstead of a copy beside the HTML therefore exports with the stage script blocked: the sections never become slides and the PDF is one page of stacked content.test/smoke-deck.htmlis such a file and is not an export target; real decks get the starter copied next to them bymake-deck; DNS for every other host is disabled (--host-resolver-rules, which also covers WebSockets) and popups are closed — an artifact cannot phone home during export. A copy fromartifacts/publish/(rewritten to jsdelivr) will not export; export the source artifact instead - Decks render one
<section>per page at natural size; other pages default to A4
Notes
- For decks: deck_stage.js must have
@media print { @page { size: ... } section { page-break-after: always } }in the global<style>it injects — already present. - For general pages: defaults to A4. To override, user can pass inline CSS
@page { size: letter }or similar. networkidle0waits for all network activity to stop — if artifact uses lazy images, bump timeout to 15000ms.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

