document-pdf
Skill1 starsChanged 2 days agoMITView on GitHub
Make a checked PDF from one Markdown source: reports, memos, letters, statements, translations, agreements, deeds, resolutions, claim letters and evidence bundles. Builds on macOS or Linux, runs a verify gate (facts present, no placeholders, page size, a look at every page), and hands over a draft, never a send. A signing profile adds strict final-text checks, execution blocks and review. Use it WHENEVER you produce, rebuild or re-version a PDF, even for 'make it a PDF'. Not for editing existing PDFs (use a PDF editing skill or tool). Triggers on: make it a pdf, generate a pdf, export to pdf, pdf report, pdf memo, pdf letter, re-render the pdf, new pdf to check, printable copy, legal pdf, pdf for signing, signature-ready pdf, draft the agreement, draft a deed, separation agreement, board resolution, sale contract, claim letter, evidence bundle, exhibits, bilingual pdf, convert the docx to pdf.
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 11 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
One canonical source: Write the document as Markdown in a durable place.
- Distinctive: line 13
Re-render, never re-send: Every "new PDF" is a fresh build of the current source.
- Distinctive: line 14
Gate every build: Run the verify script on every PDF, before anyone sees it.
- Distinctive: line 22
Ask once, in one message, and mark what you inferred:
- Distinctive: line 26
Will anyone sign it?: If yes, also read references/signing-documents.md now.
- Distinctive: line 39
Keep build helper scripts in the scratchpad, never beside sensitive files.
- Very specific: line 40
Keep working notes in a separate NOTES.md, or in HTML comments (<!-- ...
- Distinctive: line 46
Avoid emoji; they often drop out.
- Distinctive: line 58
No engine? Read references/toolchain.md for setup per OS and the known gotchas.
- Very specific: line 71
Not placeholders: [sic], a case citation ([2019] EWCA Civ 1), and in the general profile a footnote number ([1]).
- Distinctive: line 78
A document that gets signed: follow the review in references/signing-documents.md.
- Distinctive: line 85
Email: create a draft (not a sent message) with the PDF attached.
- Distinctive: line 92
A third party's Word file, or a government form: never rebuild it. See "Inputs you must not rebuild" in references/signing-documents.md.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
Document PDF
Make PDF documents the same way every time: one Markdown source, one build command, one verify gate, then a draft hand-off. The method comes from many real document sessions: reports, memos, translations, letters, contracts, deeds and evidence packs. Each rule fixes a fault that reached the reader at least once.
Five rules
- One canonical source. Write the document as Markdown in a durable place. Never keep hand-edited HTML as the only copy. A cleared scratchpad once lost the only source.
- Re-render, never re-send. Every "new PDF" is a fresh build of the current source. Never copy an older PDF. A stale PDF once went out without the latest edits.
- Gate every build. Run the verify script on every PDF, before anyone sees it.
- Look at every page. Text checks miss layout faults. Render the pages to PNG and look at them yourself. A subagent's "it built" is not a layout check.
- Draft, don't send. You prepare the file, the email draft or the e-sign draft. The requester sends, or gives an explicit "send" for that document.
Workflow
Step 1: Intake
Ask once, in one message, and mark what you inferred:
- Purpose and reader: one line.
- Key facts: names, amounts, dates, reference numbers. These become the gate's
--expecttokens. - Will anyone sign it? If yes, also read references/signing-documents.md now. It adds intake, drafting rules, execution blocks and review.
- Confidentiality: ordinary, or sensitive (HR, personal, deal terms).
- Delivery: chat, a shared folder, email draft, e-sign, or a portal.
- A precedent, if one exists. A previous document of the same kind beats a blank page.
Step 2: Put the source in the right place
| Class | Source | PDFs |
| Ordinary | The owning repo, docs/<area>/YYYY-MM-DD-<topic>.md (committed) | pdf/ beside the source, git-ignored |
| Sensitive | A git-ignored case folder in the repo (for example .case/), backed up to private storage you control | The same folder |
- Confirm the ignore rule with
git check-ignore <path>before the first build. - Keep build helper scripts in the scratchpad, never beside sensitive files.
- Keep working notes in a separate
NOTES.md, or in HTML comments (<!-- ... -->), which the renderer drops.
Step 3: Write the Markdown
- Headings, numbered lists and pipe tables render as styled HTML. Tables get borders and a shaded header row.
- Raw HTML passes through for layout the Markdown cannot express:
<div class="pagebreak"></div>,<div class="keep">...</div>(keep together),<table class="bilingual">(two-language rows). - Avoid emoji; they often drop out. Check special glyphs (€, ☑, accents) in the page images.
- A matter-specific look goes in an extra CSS file (
--css), not in an edited default stylesheet.
Step 4: Build
python3 "${CLAUDE_SKILL_DIR}/scripts/build_pdf.py" <source.md> <out.pdf>- Engine order: WeasyPrint, then Chrome/Chromium headless (Mac app, PATH, or the Playwright cache). If WeasyPrint fails, auto mode falls back to Chrome.
--engineforces one. - The default is A4 with "Page X of Y" in the footer.
--lettergives US Letter.--no-page-numbersremoves the footer. - Relative image paths resolve from the source file's folder.
- No engine? Read references/toolchain.md for setup per OS and the known gotchas.
- Name by version:
<Title> - v<N>.pdf. Never overwrite a version someone has already seen. In a pack, prefix files00-,01-... in reading or signing order.
Step 5: Verify gate (every build)
python3 "${CLAUDE_SKILL_DIR}/scripts/verify_pdf.py" <out.pdf> --expect "<fact 1>" "<fact 2>" \
--size A4 --png-dir <scratch>/png # add --profile signing for a document that gets signed- Both profiles fail on: a missing
--expecttoken,TODO/TBC/ template braces, open[placeholders], an e-sign signer gap, mixed page sizes, or a wrong page size or count. --profile signingalso fails on:DRAFTor "Draft", "not legal advice",CONFIRMandINTERNAL. It also warns about a signature-only last page.- Pass single, distinctive tokens to
--expect, such as an amount or a reference number.--expectand--forbidcan repeat. - Not placeholders:
[sic], a case citation ([2019] EWCA Civ 1), and in the general profile a footnote number ([1]). Any other bracketed text is, including "within [30] days" or "dated [2026]" in a document that gets signed. - A built-in marker that is a real word in your document (for example a Spanish heading "TODO EL CONTRATO", or "todo: ...") can be waived for that run with
--allow TODO. The gate prints the waiver as a warning. - Then open every PNG with the Read tool. Check for clipped text, missing glyphs, tables that split badly, and blocks that land on a page of their own.
- Fix the source, rebuild and re-run the gate. Never patch the PDF.
Step 6: Review (scale to the stakes)
- A document that gets signed: follow the review in references/signing-documents.md.
- Numbers that someone will act on (tax, billing, a register): one independent check of the figures against the source records before you share the PDF.
- Everything else: your own read of the page images is enough.
Step 7: Deliver (draft, don't send)
- Shared drive or folder: upload a new file for each version. Some services keep a cached preview of the first upload when you update a file in place, so readers see old text. Compare a checksum of the uploaded file with the local one.
- Email: create a draft (not a sent message) with the PDF attached. Read the draft back and check the attachment byte for byte.
- E-sign: see references/signing-documents.md.
- Report in chat: files, version, page count, gate result, and what is waiting on whom.
Other inputs
- Evidence bundles and exhibit packs (claims, disputes, KYC, auditors): references/evidence-bundles.md.
- A third party's Word file, or a government form: never rebuild it. See "Inputs you must not rebuild" in references/signing-documents.md.
- Editing an existing PDF (merge, split, fill a form, extract): use a PDF editing skill or tool. Merging exhibits is covered in the evidence-bundles reference. To change an answer on a flattened third-party form (no fillable fields), follow references/edit-existing-pdf.md.
Why each rule exists
references/lessons.md lists the faults from past sessions and the rule each one created. Read it before you relax a rule.
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- vasilyu1983/AI-Agents-public★ 94same 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 repository36 other files it gives its agents.
- ai-debateSkill
- claude-vm-opsSkill
- cleanup-gitSkill
- codex-reviewSkill
- copy-humanizerSkill
- deploy-safelySkill
- dev-auto-buildSkill
- dev-brainstormingSkill
- dev-debuggingSkill
- dev-deploy-safelySkill
- dev-qa-verifySkill
- dev-quick-buildSkill
- dev-update-envSkill
- dev-writing-plansSkill
- exec-summarySkill
- fable-reviewSkill
- gemini-reviewSkill
- machine-moveSkill
- morning-briefSkill
- plugin-fresh-install-testSkill
- quad-reviewSkill
- repo-cleanupSkill
- repo-context-cleanupSkill
- repo-health-sweepSkill
- review-debateSkill
- review-swarmSkill
- review-with-claudeSkill
- review-with-codexSkill
- review-with-geminiSkill
- review-with-glmSkill
- session-dspSkill
- session-recoverySkill
- session-status-sweepSkill
- session-wrapSkill
- triple-reviewSkill
- zai-reviewSkill
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.

