All skills
Documentation
Presscraft
Transform Markdown, HTML, and code into pristine publication-grade PDFs with cognitive readability ergonomics, AST-driven macOS code windows, semantic highlighting, zero shrinkage, and 100% verbatim fidelity. Use when asked to convert markdown to PDF, export HTML to PDF, compile documents, design books, storybooks, reports, or technical whitepapers.
What this skill adds
Presscraft transforms any Markdown file, HTML page, source code file, or document into a publication-grade, fully customized PDF. It enforces **100% verbatim textual fidelity**, zero shrinkage, authentic macOS application code window frames with deterministic syntax highlighting, cognitive visual ergonomics, smart page-break hygiene, and bespoke visual themes.
1. Non-Negotiable Core Principles
- ### A. The Decoupled Pipeline (100% Verbatim Fidelity)
- The AI agent must **NEVER rewrite, summarize, or reproduce the document body text** through an LLM prompt. Piped text generation introduces hallucinations, dropped lines, altered formulas, and truncation on large documents (e.g. 5,000+ line technical books).
- The document is read **directly from disk**.
- It is parsed deterministically into an Abstract Syntax Tree (AST) by CommonMark-compliant markdown-it.
- Every word, comma, symbol, and code line is preserved with zero modification.
- ### B. Pure Vector Text & Zero Shrinkage
2. Command Line Interface (CLI)
- Execute the compiler directly via Node:
- bash
- node skills/presscraft/scripts/presscraft.cjs --input <path> --output <path.pdf> [options]
- ### CLI Flags & Options
- | Flag | Description | Default |
- | :--- | :--- | :--- |
3. Built-In Visual Themes
- Presscraft comes pre-loaded with six artisanal design themes:
- ### 1. reader (styles/theme-reader.css & styles/theme-readability.css) — Default
- **Aesthetic**: Research-backed cognitive visual ergonomics & eye-comfort reading (see references/cognitive-ergonomics.md).
- **Palette**: Warm ivory paper substrate (#fbf9f5, 90% diffuse reflectance), deep espresso slate typography (#242120, WCAG AAA 13.5:1 contrast), calming mineral pine accent (#0f766e).
- **Typography**: Source Serif 4 / Charter humanist serif body paired with Plus Jakarta Sans headers; calibrated 64–72 CPL measure and 1.72 line-height.
- **Accents**: Editorial lead paragraph styling, contrast-calibrated warm charcoal code windows (#1e1c1b), standardized color-coded highlighting.
4. Semantic Highlighting & Extended Callouts
- ### Standardized Cognitive Highlighting
- Highlight text directly in Markdown using the == delimiter with optional semantic categorization:
- ==universal highlight== — Warm butter-yellow highlighter (#fef08a) for general emphasis.
- ==key:core concept== — Pale amber highlight (#fef3c7) with solid amber underline for key definitions.
- ==warn:critical hazard== — Soft coral highlight (#fee2e2) with coral border for safety alerts.
- ==tip:best practice== — Soft mint highlight (#d1fae5) with emerald border for practical guidance.
Default agent prompt
Use $presscraft to transform this document into a pristine, publication-grade PDF with macOS code windows, custom typography, zero shrinkage, and 100% verbatim fidelity.