Skip to content

Workflow skill

PDF Generator

draft, under review4 phases6 bundled files

Author print-first HTML from a branded template, render it with the browser already on the machine, stamp page numbers, and verify with a shrink-scan plus a page-by-page read. Design rules first, no cheap-looking output.

Install
/plugin marketplace add Selwynuy/selwynuy
/plugin install selwyn-handbook@selwyn-handbook
# then run: /selwyn-handbook:pdf-generator

Or read it as SKILL.md.

When it activates

Use this skill when producing a PDF: a guide, report, whitepaper, multi-part book, or any designed downloadable document.

The workflow

  1. Rules

    Read the print rulebook before writing any HTML: page geometry, break discipline, the shrink-to-fit trap (nothing may exceed the printable width), print typography, ink, and what Chrome's print pipeline cannot do.

    design-tokens

  2. Author

    Copy the branded template and write the document to the rules: declared @page size, flowing sections, break-protected components, a plain-words explainer opening every section, diagrams over prose, and a tiered action plan closing the guide.

    branding-overviewwriting-without-ai-slop

  3. Render

    Run the bundled renderer (finds an installed Chrome, Edge, or Chromium), then stamp page numbers with the paginate script; for books, render dividers as their own single-page documents and merge the pieces in order.

  4. Verify

    Run the check script first (page count, page size, per-page shrink detection), then open the PDF and walk every page: full-bleed cover, no stranded headings or split components, display font actually loaded. Fix in the HTML and re-render until the pages pass.

    working-with-me

What ships in the bundle

  • scriptscripts/build-pdf.mjsCross-platform renderer: finds an installed Chrome, Edge, or Chromium and prints each HTML input to PDF, reporting size and page count. Zero dependencies.
  • scriptscripts/paginate-pdf.mjsStamps a centered page number in the bottom margin of every page except the cover, in post, from the real page count.
  • scriptscripts/merge-pdfs.mjsConcatenates piece PDFs into one book in argument order, enabling full-bleed interior part dividers via split-render-and-merge.
  • scriptscripts/check-pdf.mjsObjective verification: page count, page size, and per-page shrink-to-fit detection read from the PDF's own drawing instructions.
  • templatetemplates/guide.htmlThe branded print document: full-bleed dark cover, light interior, flowing sections, and example markup for every break-protected component, from plain-words boxes to checklists and playbooks.
  • referencereferences/print-design.mdThe print rulebook: page geometry, break discipline, the shrink-to-fit trap, bleed mechanics, split-render-and-merge, typography, ink, verification checklist, troubleshooting table.

4 run, the rest load on demand.