Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Converts Markdown files with Mermaid diagrams to PDF using local tools (mmdc, md-to-pdf, Puppeteer) with CSS styling and page numbers. Use when the user asks to export markdown to PDF, render Mermaid charts to PDF, or convert a .md file with diagrams to a printable document, or convert multiple Markdown files (one PDF per file, processed sequentially).
.claude/skills/wanderlima-local-md-mermaid-pdf/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 318% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 1044% | 0% |
| case-10 | ✓→✗ | ▼ Worse | 44% | 0% |
Converts one or more Markdown files with Mermaid diagrams into PDF(s) using local mmdc and md-to-pdf. Each source file gets its own PDF (<basename>-export.pdf beside the source). All intermediate artifacts live in local-md-mermaid-pdf-sandbox; only the final PDF(s) are written outside the sandbox. The sandbox is removed after each successful run.
Multiple files: process sequentially (one complete run at a time). Produce one PDF per source file. Do not merge PDFs unless the user explicitly asks.
mermaid blocks)style.css from this skill folder (unless the user requests custom styling)mmdc and md-to-pdf, or npx --yes fallbackexecutablePath when available)<source-dir>/<original-basename>-export.pdf — only deliverable outside the sandbox-export.pdf rule beside each source). List every absolute PDF path in the final replylocal-md-mermaid-pdf-sandbox removed after each successful run (all intermediate artifacts deleted with it)input.md, input.tmp.md, input.for-pdf.md, puppeteer-config.json, Puppeteer cache, Mermaid render outputs) must live inside local-md-mermaid-pdf-sandbox. Only the final PDF is written outside the sandbox (via dest beside the source file)style.css from this skill folder unless the user asks for custom styling (read-only reference; do not copy into the project unless the user requests custom styling)md-to-pdf front matter: Page <span class="pageNumber"></span> of <span class="totalPages"></span>PUPPETEER_CACHE_DIR inside the sandbox); never depend on ~/.cache/puppeteernpx --yes only when a binary is missingexecutablePath to Puppeteermmdc / md-to-pdf / Puppeteer runs<basename>-export.pdf. Do not concatenate Markdown sources, merge PDFs, or produce one combined output unless the user explicitly askslocal-md-mermaid-pdf-sandbox next to the source filelocal-md-mermaid-pdf-sandbox/input.mdPUPPETEER_CACHE_DIR to a path inside the sandbox (e.g. local-md-mermaid-pdf-sandbox/.puppeteer-cache)mmdc, if Google Chrome or Chromium is available, write local-md-mermaid-pdf-sandbox/puppeteer-config.json with system executablePath and args: ["--no-sandbox"]. This is required when PUPPETEER_CACHE_DIR points to the empty sandbox cache — without it, mmdc cannot find Chrome and diagrams will not rendermmdc -p puppeteer-config.json -i input.md -o input.tmp.md when the config exists; otherwise mmdc -i input.md -o input.tmp.mdmmdc emits images or other sidecar files, they must remain inside the sandboxmmdc still fails on Puppeteer/cache, retry only with a corrected executablePath in puppeteer-config.json — do not skip to PDF conversioninput.tmp.md exists and no longer contains raw mermaid blocks (expect !diagram image references and sidecar SVG/PNG files)Write local-md-mermaid-pdf-sandbox/input.for-pdf.md with YAML front matter:
dest: <source-dir>/<original-basename>-export.pdf — the only output path outside the sandboxstylesheet: absolute path to this skill’s style.csspdf_options.displayHeaderFooter: truepdf_options.headerTemplate: '<div></div>'pdf_options.footerTemplate: centered page numbers onlyinput.tmp.md--launch-options JSON (executablePath when Chrome/Chromium is available; args: ["--no-sandbox"])md-to-pdf --basedir local-md-mermaid-pdf-sandbox --launch-options '<json>' input.for-pdf.md from inside the sandbox (or npx --yes md-to-pdf@5.2.5 ...)local-md-mermaid-pdf-sandboxWhen the user provides more than one Markdown file:
<source-dir>/<basename>-export.pdf beside its source| Rationalization | Reality | | --- | --- | | Skip Mermaid render for MD without diagrams | mmdc is still required when diagrams exist; inspect the file first | | Run mmdc without puppeteer-config.json when sandbox cache is empty | mmdc will fail to find Chrome; write config with system executablePath before the first run | | Skip to PDF when mmdc fails | Never convert without input.tmp.md; raw mermaid blocks do not render in PDF | | Reuse ~/.cache/puppeteer | Breaks isolation and causes cross-project cache conflicts | | Invent Puppeteer flags on failure | Only the documented Chromium executablePath retry is allowed | | Keep sandbox for debugging | Sandbox must be removed after success; use --keep in scripts/e2e.sh for local dev only | | Overwrite the source PDF name | Use the stable -export.pdf suffix to avoid clobbering prior runs | | Write intermediates beside the source file | Only the final PDF leaves the sandbox; everything else stays in local-md-mermaid-pdf-sandbox | | Run multiple conversions in parallel to save time | Sequential queue only — parallel runs conflict on Puppeteer, cache, and sandbox paths | | Merge multiple files into one PDF by default | One PDF per source; merge only when the user explicitly asks | | Reuse one sandbox for several source files at once | Fresh sandbox per file; complete and delete before the next file |
input.md, input.tmp.md, input.for-pdf.md, puppeteer-config.json, cache) exist outside local-md-mermaid-pdf-sandboxinput.tmp.md was not produced by mmdcinput.tmp.md still contains mermaid blocks (diagrams were not rendered)stylesheet points outside this skill folder without user requestnpx used when global mmdc / md-to-pdf binaries are already availablelocal-md-mermaid-pdf-sandbox (no stray files beside the source)local-md-mermaid-pdf-sandbox/input.tmp.md exists after mmdc and has no raw mermaid blockslocal-md-mermaid-pdf-sandbox/input.for-pdf.md has dest, stylesheet, and footer page-number template<original-basename>-export.pdf exists beside the source filelocal-md-mermaid-pdf-sandbox was deleted-export.pdf; conversions ran sequentially (not in parallel)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 22,600 | 6,110 | -73% | 1 | 1 | 0% | 3,915 | 2,668 | -32% | 0 | 0 | — |
case-02 | fail→fail | 6,443 | 6,867 | +7% | 1 | 1 | 0% | 462 | 2,972 | +543% | 0 | 0 | — |
case-03 | fail→fail | 20,625 | 7,093 | -66% | 1 | 1 | 0% | 3,719 | 2,830 | -24% | 0 | 0 | — |
case-04 | fail→fail | 5,908 | 6,420 | +9% | 1 | 1 | 0% | 880 | 2,761 | +214% | 0 | 0 | — |
case-05 | fail→pass | 5,098 | 6,728 | +32% | 1 | 1 | 0% | 905 | 3,786 | +318% | 0 | 0 | — |
case-06 | fail→fail | 13,067 | 10,180 | -22% | 1 | 1 | 0% | 1,962 | 3,242 | +65% | 0 | 0 | — |
case-07 | fail→fail | 10,007 | 9,028 | -10% | 1 | 1 | 0% | 1,681 | 3,095 | +84% | 0 | 0 | — |
case-08 | fail→fail | 10,885 | 6,451 | -41% | 1 | 1 | 0% | 1,879 | 2,694 | +43% | 0 | 0 | — |
case-09 | fail→fail | 5,043 | 6,746 | +34% | 1 | 1 | 0% | 176 | 2,656 | +1409% | 0 | 0 | — |
case-10 | pass→fail | 11,442 | 7,967 | -30% | 1 | 1 | 0% | 2,023 | 2,917 | +44% | 0 | 0 | — |
case-11 | fail→fail | 5,106 | 7,238 | +42% | 1 | 1 | 0% | 251 | 2,755 | +998% | 0 | 0 | — |
case-12 | fail→pass | 12,664 | 3,488 | -72% | 1 | 1 | 0% | 2,346 | 2,763 | +18% | 0 | 0 | — |
case-13 | fail→fail | 3,378 | 7,707 | +128% | 1 | 1 | 0% | 408 | 2,814 | +590% | 0 | 0 | — |
case-14 | fail→fail | 9,880 | 7,518 | -24% | 1 | 1 | 0% | 1,741 | 2,828 | +62% | 0 | 0 | — |
case-15 | fail→fail | 4,602 | 8,851 | +92% | 1 | 1 | 0% | 849 | 3,020 | +256% | 0 | 0 | — |
case-20 | fail→pass | 18,609 | 7,525 | -60% | 1 | 1 | 0% | 3,590 | 3,629 | +1% | 0 | 0 | — |
case-16 | fail→fail | 6,706 | 7,649 | +14% | 1 | 1 | 0% | 1,059 | 2,816 | +166% | 0 | 0 | — |
case-17 | pass→fail | 12,747 | 10,387 | -19% | 1 | 1 | 0% | 2,285 | 3,348 | +47% | 0 | 0 | — |
case-18 | fail→pass | 4,926 | 11,662 | +137% | 1 | 1 | 0% | 333 | 3,809 | +1044% | 0 | 0 | — |
case-19 | fail→fail | 6,798 | 7,657 | +13% | 1 | 1 | 0% | 1,336 | 2,956 | +121% | 0 | 0 | — |
case-21 | fail→fail | 2,739 | 6,459 | +136% | 1 | 1 | 0% | 292 | 2,764 | +847% | 0 | 0 | — |
case-22 | pass→fail | 6,195 | 7,730 | +25% | 1 | 1 | 0% | 1,181 | 2,912 | +147% | 0 | 0 | — |
case-23 | fail→fail | 15,161 | 12,130 | -20% | 1 | 1 | 0% | 2,287 | 3,327 | +45% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 4 counted toward the lift figure. The other 19 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +4 percentage points is the difference between those two pass rates over the 4 comparable cases. 5 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.