Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add supachai-j/open-knowledge-format-starter --skill publishing-mdbook-pdfgit clone --depth 1 https://github.com/supachai-j/open-knowledge-format-starterWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/supachai-j/open-knowledge-format-starter/publishing-mdbook-pdf)<a href="https://agentmods.dev/skills/supachai-j/open-knowledge-format-starter/publishing-mdbook-pdf"><img src="https://agentmods.dev/badge/skills/supachai-j/open-knowledge-format-starter/publishing-mdbook-pdf/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/supachai-j/open-knowledge-format-starter/publishing-mdbook-pdf"><img src="https://agentmods.dev/badge/skills/supachai-j/open-knowledge-format-starter/publishing-mdbook-pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00231 | $0.02918 |
| Opus 5 | $0.00115 | $0.01459 |
| Sonnet 5 | $0.00046 | $0.00584 |
| Haiku 4.5 | $0.00023 | $0.00292 |
Grade D, and why
publishing-mdbook-pdf scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
- Install system fonts on the runner: `sudo apt-get install -y fonts-thai-tlwg fonts-noto-core fonts-noto-color-emoji` then `sudo fc-cache -f`. Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
pdfunite "$d/cover.pdf" $(ls "$d"/p-*.pdf|sort) "$out"; rm -rf "$d"; } Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- run: curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C /usr/local/bin How it starts
The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Publishing an mdBook → GitHub Pages + a print-quality PDF
A battle-tested pipeline for turning a Markdown book into (1) an mdBook website on GitHub Pages and (2) a polished PDF. The hard part is the PDF: headless Chrome has many traps. Every gotcha below cost real debugging — read them before reinventing.
Bundled reusable scripts live in scripts/ next to this file:
scripts/print-pdf.js— Puppeteer renderer (cover / body / measure modes; header/footer; outline)scripts/pdf-toc-pages.py— reads a measured PDF's outline and injects real page numbers into the TOC
Architecture
markdown (src/) ──mdbook build──▶ static site (book/) ──▶ GitHub Pages
│
print.html ───┴── Puppeteer (CDP) ──▶ PDF
- Site:
mdbook build→ upload withactions/upload-pages-artifact+deploy-pages. - PDF: mdBook auto-generates
book/print.html(whole book on one page). Render THAT with Puppeteer (NOTmdbook-native, NOT--print-to-pdfCLI). See gotchas. - Bilingual: keep two books (
book/default,book-en/), build both, copy the 2nd under/en/, add a language-switch button viaadditional-js.
The gotchas (and the fixes)
1. chrome --headless --print-to-pdf CANNOT add headers/footers or page numbers
The CLI flag has no header/footer support. Use Puppeteer (puppeteer-core driving system
Chrome) page.pdf({displayHeaderFooter, headerTemplate, footerTemplate}). Header/footer
templates use the special spans class="pageNumber" / class="totalPages" / title / date.
Set an explicit font-size (default is ~0) and a font-family in the template.
2. Non-Latin fonts (Thai/CJK) render BROKEN in CI PDFs
Two failures combine: the runner has no Thai font, and the Google-Fonts webfont hasn't loaded when print snapshots. Fix both:
- Install system fonts on the runner:
sudo apt-get install -y fonts-thai-tlwg fonts-noto-core fonts-noto-color-emojithensudo fc-cache -f. - Wait for fonts before
page.pdf:await page.evaluate(() => document.fonts.ready)(andwaitUntil:'networkidle0'). - Put a Thai-capable family in the header/footer template too (e.g.
'Noto Sans Thai','Loma').
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 161 lines · 231 tokens per session scan D 8353b6b7409f
publishing-mdbook-pdf is a skill published in the GitHub repository supachai-j/open-knowledge-format-starter (5 stars, last pushed 2mo ago), licensed MIT. It adds 231 tokens to every session and 2,918 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
design-drawing-svg-md
Use when converting vector PDF engineering drawings (steel-structure shop drawings, A0 drawings, linework-only PDFs without a text layer) into LLM-consumable dual-carrier records — semantic Markdown reading thread plus layered SVG geometry archive linked by shared IDs and crosswalk.
second-reader
Build and run a source-verified Markdown knowledge vault (opens as an Obsidian vault). Ingests books, PDFs, transcripts, and articles into atomic, cross-linked, cited notes, then gates every note and every answer behind an independent verification pass that re-reads the source cold and loops until a round finds…
second-brain-ingest
Process raw source documents into wiki pages. Use when the user adds files to raw/ and wants them ingested, says "process this source", "ingest this article", "I added something to raw/", or wants to incorporate new material into their knowledge base.
pdftomarkdown
Converts PDF documents, Word files (.docx), CSV spreadsheets, and YouTube video URLs into clean, token-efficient Markdown with smart table and heading structure detection.
PDF files: create, read, merge, fill, OCR, edit text.
pdf-toolkit
Structured .pdf operations: extract text/tables, merge pages from multiple PDFs, split a PDF by page ranges, fill PDF form fields, and generate fresh PDFs from JSON. Trigger when the user wants programmatic PDF work without natural-language rewriting — examples: pull tables from a report, combine three PDFs, extract…