agentleFS
WGlynnWGlynn/JARVIS/skills/md-to-pdf/SKILL.md

md-to-pdf

Skill2 starsChanged 5 months agoMITView on GitHub

Convert a markdown file to a typography-styled PDF. Use when the user asks to "PDF this", "make a PDF", "convert to PDF", "print this letter / doc", or wants any markdown rendered for sharing outside the terminal (email, DM, print). Wraps a pandoc + Chrome-headless pipeline with two style presets. Single source of truth — never re-implement the pandoc + chrome flow inline.

20 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use skill-creator.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If genuinely ambiguous, ask before running.

    line 23
  2. Very specific:

    If the user named the artifact a "letter" / "draft" / "essay" / "post" / "writeup" → letter.

    line 34
  3. Very specific:

    If they named it a "memo" / "report" / "status" / "brief" / "notes" → memo.

    line 35
  4. Very specific:

    If unclear, default to letter.

    line 36
  5. Very specific:

    Don't pass --keep-html unless the user explicitly wants the HTML intermediate (they almost never do).

    line 48
  6. Distinctive:

    Do NOT narrate the pandoc/Chrome pipeline internals.

    line 60
  7. Distinctive:

    Don't re-implement the pandoc + Chrome pipeline inline.

    line 66
  8. Distinctive:

    Don't add a third style preset on the fly without asking — preset additions belong in the script, not in conversation.

    line 67
  9. Distinctive:

    Don't preview the HTML or open the PDF unless the user asks.

    line 68
  10. Distinctive:

    Don't suggest LaTeX-based alternatives ("we could use XeLaTeX / wkhtmltopdf") — the Chrome path is the load-bearing one because it's the …

    line 69
  11. Distinctive:

    Don't troubleshoot pandoc or Chrome internals beyond this — escalate to the user.

    line 81

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

md-to-pdf — markdown → typography-styled PDF

When invoked: User wants a markdown file rendered to PDF for sharing or reading outside the terminal — correspondence, memos, drafts, anything where Telegram-DM / VS-Code-preview readability is insufficient.

Why this exists: On 2026-04-27 (letter-to-a partner incident) Claude rebuilt the pandoc + Chrome-headless pipeline inline — wrote a temp CSS file, tracked down pandoc's path, debugged Chrome's Windows-path quirks, cleaned up intermediates manually. Will called it out: "that should be offloaded to a tool somehow." This skill is that tool. Do not re-implement the pipeline inline. Call the script.


Step 1 — Locate the markdown source

The input is whatever markdown file the user wants rendered. If the user pointed at a specific path, use it. If they said "this letter" / "the draft" / "the doc we just worked on", use the most recent .md file we just wrote or edited in this conversation.

If genuinely ambiguous, ask before running. One question beats one wrong PDF.


Step 2 — Pick a style

Two presets, both letter-size paper:

  • letter (default): serif body (Georgia / Iowan Old Style / Palatino), sans-serif headings, 11.5pt at 0.9″×1″ margins. For correspondence, long-form drafts, anything that benefits from bookish typography. Use this unless the user explicitly says otherwise.
  • memo: sans-serif throughout, 10.5pt at 0.7″×0.8″ margins, tighter line-height. For internal memos, status reports, dense reference docs.

If the user named the artifact a "letter" / "draft" / "essay" / "post" / "writeup" → letter. If they named it a "memo" / "report" / "status" / "brief" / "notes" → memo. If unclear, default to letter.


Step 3 — Run the script

~/.claude/scripts/md-to-pdf.sh <input.md> [--style letter|memo] [--output <path.pdf>] [--keep-html]

Output defaults to <input-dir>/<input-basename>.pdf (same directory as the source, same basename). Don't pass --output unless the user wants a different location.

Don't pass --keep-html unless the user explicitly wants the HTML intermediate (they almost never do).


Step 4 — Report

Tell the user:

  • Where the PDF landed (full path).
  • Style used (letter / memo).
  • Size in KB (a sanity signal — anything under 5KB or over 5MB is suspect).
  • One line on what the user can do next ("open in your PDF reader" / "drag into Telegram / email" — match the use case the user mentioned).

Do NOT narrate the pandoc/Chrome pipeline internals. The user doesn't care about pandoc's path or Chrome's headless flags — those are implementation details now living in the script.


Don't

  • Don't re-implement the pandoc + Chrome pipeline inline. The whole point of this skill is consolidation.
  • Don't add a third style preset on the fly without asking — preset additions belong in the script, not in conversation.
  • Don't preview the HTML or open the PDF unless the user asks. The user knows where their files are.
  • Don't suggest LaTeX-based alternatives ("we could use XeLaTeX / wkhtmltopdf") — the Chrome path is the load-bearing one because it's the only path we've validated end-to-end on this machine.

If the script fails

Check in order:

  1. pandoc not found → the script auto-detects pandoc at ~/AppData/Local/Pandoc/pandoc and /c/Program Files/Pandoc/pandoc.exe. If neither exists, tell the user pandoc needs to be installed.
  2. Chrome not found → similar, looks at standard Windows + macOS paths.
  3. Access is denied writing PDF → the output path probably has a permissions issue or the file is open in a viewer. Suggest the user close any open instance and retry.
  4. Empty/tiny PDF (<5KB) → the markdown was empty or the HTML conversion silently failed. Re-run with --keep-html and inspect the intermediate.

Don't troubleshoot pandoc or Chrome internals beyond this — escalate to the user.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.