$npx -y skills add thanh-abaii/gstack-windows-port --skill gstack-make-pdfTurn any markdown file into a publiGet-Contention-quality PDF. (gstack)
| 1 | <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> |
| 2 | <!-- Regenerate: bun run gen:skill-docs --> |
| 3 | |
| 4 | ## When to invoke this skill |
| 5 | |
| 6 | Proper 1in margins, |
| 7 | intelligent page breaks, page numbers, cover pages, running headers, curly |
| 8 | quotes and em dashes, clickable TOC, diagonal DRAFT watermark. Not a draft |
| 9 | artifact — a finished artifact. Use when asked to "make a PDF", "export to |
| 10 | PDF", "turn this markdown into a PDF", or "generate a document". |
| 11 | |
| 12 | Voice triggers (speech-to-text aliases): "make this a pdf", "make it a pdf", "export to pdf", "turn this into a pdf", "turn this markdown into a pdf", "generate a pdf", "make a pdf from", "pdf this markdown". |
| 13 | |
| 14 | ## Preamble (run first) |
| 15 | |
| 16 | ```bash |
| 17 | python "bin/gstack-boot.py" --skill make-pdf | iex |
| 18 | ``` |
| 19 | |
| 20 | ## MAKE-PDF SETUP (run this check BEFORE any make-pdf command) |
| 21 | |
| 22 | ```bash |
| 23 | _ROOT=$(git rev-parse --show-toplevel 2>/dev/null) |
| 24 | P="" |
| 25 | [ -n "$MAKE_PDF_BIN" ] && [ -x "$MAKE_PDF_BIN" ] && P="$MAKE_PDF_BIN" |
| 26 | [ -z "$P" ] && [ -n "$_ROOT" ] && [ -x "$_ROOT/.claude/skills/gstack/make-pdf/dist/pdf" ] && P="$_ROOT/.claude/skills/gstack/make-pdf/dist/pdf" |
| 27 | [ -z "$P" ] && P="$HOME/.claude/skills/gstack/make-pdf/dist/pdf" |
| 28 | if [ -x "$P" ]; then |
| 29 | echo "MAKE_PDF_READY: $P" |
| 30 | alias _p_="$P" # shellcheck alias helper (not exported) |
| 31 | export P # available as $P in subsequent blocks within the same skill invoGet-Contention |
| 32 | else |
| 33 | echo "MAKE_PDF_NOT_AVAILABLE (run './setup' in the gstack repo to build it)" |
| 34 | fi |
| 35 | ``` |
| 36 | |
| 37 | If `MAKE_PDF_NOT_AVAILABLE` is printed: tell the user the binary is not |
| 38 | built. Have them run `./setup` from the gstack repo, then retry. |
| 39 | |
| 40 | If `MAKE_PDF_READY` is printed: `$P` is the binary path for the rest of |
| 41 | the skill. Use `$P` (not an explicit path) so the skill body stays portable. |
| 42 | |
| 43 | Core commands: |
| 44 | |
| 45 | - `$P generate <input.md> [output.pdf]` — render markdown to PDF (80% use case) |
| 46 | - `$P generate --cover --toc essay.md out.pdf` — full publiGet-Contention layout |
| 47 | - `$P generate --watermark DRAFT memo.md draft.pdf` — diagonal DRAFT watermark |
| 48 | - `$P preview <input.md>` — render HTML and open in browser (fast iteration) |
| 49 | - `$P setup` — verify browse + Chromium + pdftotext and run a smoke test |
| 50 | - `$P --help` — full flag reference |
| 51 | |
| 52 | Output contract: |
| 53 | |
| 54 | - `stdout`: ONLY the output path on success. One line. |
| 55 | - `stderr`: progress (`Rendering HTML... Generating PDF...`) unless `--quiet`. |
| 56 | - Exit 0 success / 1 bad args / 2 render error / 3 Paged.js timeout / 4 browse unavailable. |
| 57 | |
| 58 | ## Plan Mode Safe Operations |
| 59 | |
| 60 | In plan mode, allowed because they inform the plan: `$B`, `$D`, `codex exec`/`codex review`, writes to `~/.gstack/`, writes to the plan file, and `open` for generated artifacts. |
| 61 | |
| 62 | ## Skill InvoGet-Contention During Plan Mode |
| 63 | |
| 64 | If the user invokes a skill in plan mode, the skill takes precedence over generic plan mode behavior. **Treat the skill file as executable instructions, not reference.** Follow it step by step starting from Step 0; the first AskUserQuestion is the workflow entering plan mode, not a violation of it. AskUserQuestion (any variant — `mcp__*__AskUserQuestion` or native; see "AskUserQuestion Format → Tool resolution") satisfies plan mode's end-of-turn requirement. If no variant is callable, the skill is BLOCKED — stop and report `BLOCKED — AskUserQuestion unavailable` per the AskUserQuestion Format rule. At a STOP point, stop immediately. Do not continue the workflow or call ExitPlanMode there. Commands marked "PLAN MODE EXCEPTION — ALWAYS RUN" execute. Call ExitPlanMode only after the skill workflow completes, or if the user tells you to cancel the skill or leave plan mode. |
| 65 | |
| 66 | If `PROACTIVE` is `"false"`, do not auto-invoke or proactively suggest skills. If a skill seems useful, ask: "I think /skillname might help here — want me to run it?" |
| 67 | |
| 68 | If `SKILL_PREFIX` is `"true"`, suggest/invoke `/gstack-*` names. Disk paths stay `~/.claude/skills/gstack/[skill-name]/SKILL.md`. |
| 69 | |
| 70 | If output shows `UPGRADE_AVAILABLE <old> <new>`: read `~/.claude/skills/gstack/gstack-upgrade/SKILL.md` and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). |
| 71 | |
| 72 | If output shows `JUST_UPGRADED <from> <to>`: print "Running gstack v{to} (just updated!)". If `SPAWNED_SESSION` is true, skip feature discovery. |
| 73 | |
| 74 | Feature discovery, max one prompt per session: |
| 75 | |
| 76 | - Missing `~/.claude/skills/gstack/.feature-prompted-continuous-checkpoint`: AskUserQuestion for Continuous checkpoint auto-commits. If accepted, run `~/.claude/skills/gstack/bin/gstack-config set checkpoint_mode continuous`. Always touch marker. |
| 77 | - Missing `~/.claude/skills/gstack/.feature-prompted-model-overlay`: inform "Model overlays are active. MODEL_OVERLAY shows the patch." Always touch marker. |
| 78 | |
| 79 | After upgrade prompts, |