[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HQKERJFT4YQ0PX1V8NE1M8":3,"skill-same:01M6HQKERJFT4YQ0PX1V8NE1M8":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":46,"linkOnly":47,"markdownContent":48,"markdownBody":49,"frontMatter":50,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":56,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":6,"updatedAt":59,"install":60,"resources":73},"01M6HQKERJFT4YQ0PX1V8NE1M8","craft-doc-publish",null,"Publish Markdown with frontmatter as a templated DOCX and PDF with ArtCraft apps - fill the company template, inline images and Mermaid, WordCraft body and TOC, optional PdfCraft package\u002Fprotect; verified and resumable. Use for \"make a DOCX from this markdown with our template\", \"publish this report as a PDF\", \"markdown to Word with a table of contents\".","BlackBeltTechnology\u002Fpi-agent-dashboard","BlackBeltTechnology","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F8101592?v=4","01M6HQDX7QAJA0QP4NYRYBMJ8A","BlackBelt Technology","01M6HQDXCC7719N9YDMQVH9JS6",348,"MIT","https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard\u002Fblob\u002Fdevelop\u002Fpackages\u002Fcraft-apps\u002F.pi\u002Fskills\u002Fcraft-doc-publish\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"publish","doc","craft doc publish","craft","body","docx","company","pdfcraft","fill","inline","frontmatter","for","verified","with","make","apps","as","images","toc","use","table","Word","template","markdown","package","mermaid","PDF","2026-11-10 10:12:30",false,"---\nname: craft-doc-publish\ndescription: Publish Markdown with frontmatter as a templated DOCX and PDF with ArtCraft apps - fill the company template, inline images and Mermaid, WordCraft body and TOC, optional PdfCraft package\u002Fprotect; verified and resumable. Use for \"make a DOCX from this markdown with our template\", \"publish this report as a PDF\", \"markdown to Word with a table of contents\".\n---\n\n# craft-doc-publish — Markdown + template → DOCX + PDF (→ packaged PDF)\n\nThe **default** Markdown → templated DOCX\u002FPDF path. `pi-craft doc prepare` fills the template's placeholders (frontmatter,\n`--var`, template defaults, system variables) and prepares the body; WordCraft then only appends the body, builds the TOC and\nexports; PdfCraft packages the result. No Docker, no pandoc. Read `wordcraft` (and `pdfcraft` for step 3) first. Resumable-job\nrules are in the `craft-studio` router, section **Craft jobs**. Ingest\u002FOCR of existing documents, round-trip editing\n(extract → edit → merge back), PlantUML and table-width profiles stay with `document-converter`.\n\n## Step table\n\n| # | Step | Tool | Input → Output | Gate |\n|---|---|---|---|---|\n| 0 | Preflight + job | agent | request → `job.json` | `check: job` |\n| 1 | Prepare | `pi-craft doc prepare` | `report.md` + template → `01-prepare\u002F` (`template.filled.docx`, `body.md`, `prepare.json`) | `check: prepare` (+ user confirms defaults) |\n| 2 | Render | WordCraft | filled template + body → `02-render\u002Fout.docx`, `out.pdf` | `pi-craft verify --pages --text-contains` |\n| 3 | Package (optional) | PdfCraft | pdf (+ extra pdfs) → `03-package\u002Ffinal.pdf` | `pi-craft verify` (before protecting) |\n\nHand-off formats: filled `docx` + Markdown body between 1 and 2, `pdf` out (the docx is verified through its pdf). The\ntemplate is a doc-engine template directory `\u003Ctemplates-dir>\u002F\u003Cname>\u002Ftemplate.docx` (+ `variables.xml`, `manifest.xml`).\nPasswords and API keys are never written to `job.json`, gate reports or step files.\n\n### Step 0 — Preflight and job\n\n**Output:** `craft-jobs\u002F\u003Cslug>\u002Fjob.json` (created or loaded).\n**Gate:** `check: job`.\n\n| Sibling | Package | Check | If missing |\n|---|---|---|---|\n| `document-converter` | `@blackbelt-technology\u002Fpi-dashboard-document-converter` | skill in the loaded skill list | not needed here: only for ingest\u002FOCR, round-trip editing and PlantUML — route those requests to it, continue otherwise |\n| `mmdc` | `@mermaid-js\u002Fmermaid-cli` | `command -v mmdc` (it needs a Chromium; if it cannot find one set `PUPPETEER_EXECUTABLE_PATH`) | diagrams stay code blocks; step 1's gate asks you to install it or accept code-block diagrams |\n| `pi-nano-banana` | already a dependency of craft-apps | usable credentials, only when the frontmatter sets `nano_banana.enabled: true` | no credentials: diagrams render with `mmdc` (the fallback runs anyway) |\n\n\"Loaded skill list\" is the available-skills list in your own system prompt. `nano_banana.enabled` is a **paid** API call per\nnew diagram: state that to the user before step 1; results are cached in `.mermaid-cache\u002F` next to the Markdown.\nResolve the template first and **echo its path to the user** (it is in `prepare.json` after step 1): `.\u002Ftemplates` is searched\nbefore `~\u002FDocuments\u002Ftemplates`, so a repo-local template can win without being asked for.\n\nSet up the job (**Craft jobs** in `craft-studio`: slug rule, `job-helper`) and run **Resume**.\n\n```bash check: job\n# run from the directory that contains craft-jobs\u002F (SLUG set as in step 0)\njq -e '.name and .workflow and (.steps | type == \"object\")' \"craft-jobs\u002F$SLUG\u002Fjob.json\"\n```\n\n### Step 1 — Prepare\n\n**Output:** `01-prepare\u002Ftemplate.filled.docx`, `01-prepare\u002Fbody.md`, `01-prepare\u002Fprepare.json`.\n**Gate:** `check: prepare` — the report has no unresolved placeholder, unrendered diagram, skipped or remote image, and\nevery template-defaulted variable was confirmed by the user.\n\n```bash\npi-craft doc prepare report.md --out \"$JOB\u002F01-prepare\" [--template default] [--templates-dir \u003Cdir>] [--var client_name=\"ACME Kft.\"]… [--allow-path \u003Cdir>]…\n```\n\nFrontmatter uses the doc-engine keys: `template`, `templates_dir`, `language`, `document_title`, `document_name`,\n`enable_toc`, `toc_heading`, `nano_banana`; every other scalar key is a template variable (`--var` wins over frontmatter,\nwhich wins over the template's own `variables.xml` default). Read `prepare.json`:\n\n- `defaulted` — variables that still carry the **template's default** (a real template ships another customer's name, offer\n  number…). **Show each default value and ask the user to confirm or supply a value** (`--var name=value`, rerun). Only then run the\n  gate with `DEFAULTS_CONFIRMED=1`.\n- `unresolved` — placeholders with no value (also a token split across paragraphs): supply the variable or, with the user's\n  consent, `--allow-missing`.\n- `mermaid.unrendered` — diagrams left as code (no `mmdc`, no browser, render error): **ask the user to install `mmdc` or accept\n  code-block diagrams** before rendering.\n- `images.skipped` \u002F `images.remote` — images outside the Markdown's directory (pass `--allow-path`), missing, or remote\n  (WordCraft does not fetch them): fix the path or accept the omission with the user.\n- `warnings` — PlantUML blocks stay code (use `document-converter`); a variable value that contained image\u002Fdiagram syntax stays literal.\n- `pictures` — present when the template owns images (WordCraft 0.7.0 would paste every Markdown-imported image onto the\n  template's first one): `body.md` then carries `CRAFTIMG0001`-style markers and step 2 puts the pictures in.\n\n```bash check: prepare\n# run inside the step directory: cd \"$JOB\u002F01-prepare\" (DEFAULTS_CONFIRMED=1 once the user confirmed every defaulted variable)\njq -e --arg ok \"${DEFAULTS_CONFIRMED:-0}\" '\n  (.unresolved | length == 0) and (.mermaid.unrendered == 0) and (.images.skipped | length == 0) and (.images.remote | length == 0)\n  and ((.defaulted | length == 0) or $ok == \"1\")' prepare.json\n```\n\n### Step 2 — Render\n\n**Output:** `02-render\u002Fout.docx` and `02-render\u002Fout.pdf` (the docx is verified through its pdf).\n**Gate:** `pi-craft verify out.pdf --pages N --text-contains \"\u003Ctitle>\"` — `N` is WordCraft's own page count of the docx.\n\nOne WordCraft run opens the **filled** template with `run --file` (never `run --template`: it drops the template's header\u002Ffooter\nparts), appends the body after a page break, builds the TOC if enabled, puts in any pictures, sets the properties, then `convert`\nexports the pdf. The TOC is inserted **before** the body: `references.toc` leaves the caret above the TOC, so move to the end\n(`caret.docEnd`) again before the second page break and the body.\n\n```bash\nD=\"$PWD\u002F$JOB\u002F01-prepare\"; TOC=$(jq -r .toc.enabled \"$D\u002Fprepare.json\")\nARGS=(--cmd 'caret.docEnd={}' --cmd 'text.pageBreak={}')\nif [ \"$TOC\" = true ]; then\n  ARGS+=(--cmd \"references.toc=$(jq -c '{levels:.toc.levels,title:.toc.heading}' \"$D\u002Fprepare.json\")\" --cmd 'caret.docEnd={}' --cmd 'text.pageBreak={}')\nfi\nARGS+=(--cmd \"insert.textFromFile=$(jq -nc --arg p \"$D\u002Fbody.md\" '{path:$p}')\")\n# pictures (only when prepare.json has them): find the marker, insert the picture, delete the marker\nwhile IFS= read -r pic; do\n  m=$(jq -r .marker \u003C\u003C\u003C\"$pic\"); f=$(jq -r .file \u003C\u003C\u003C\"$pic\")\n  ARGS+=(--cmd \"edit.find=$(jq -nc --arg t \"$m\" '{text:$t}')\" --cmd \"insert.picture=$(jq -nc --arg p \"$D\u002F$f\" '{path:$p}')\" --cmd \"edit.replaceAll=$(jq -nc --arg t \"$m\" '{text:$t,with:\"\"}')\")\ndone \u003C \u003C(jq -c '.pictures[]?' \"$D\u002Fprepare.json\")\nARGS+=(--cmd \"file.properties=$(jq -c '{title:.title}' \"$D\u002Fprepare.json\")\")\n[ \"$TOC\" = true ] && ARGS+=(--cmd 'references.updateToc={}')\npi-craft wordcraft exec run --file \"$D\u002Ftemplate.filled.docx\" \"${ARGS[@]}\" --save \"$JOB\u002F02-render\u002Fout.docx\"\npi-craft wordcraft exec convert \"$JOB\u002F02-render\u002Fout.docx\" \"$JOB\u002F02-render\u002Fout.pdf\"\nN=$(pi-craft wordcraft exec info \"$JOB\u002F02-render\u002Fout.docx\" | jq -r .pages)\nTITLE=$(jq -r .title \"$D\u002Fprepare.json\")\nCLIENT=${CLIENT:?set CLIENT to a variable value you supplied, e.g. the --var client_name value}\npi-craft verify \"$JOB\u002F02-render\u002Fout.pdf\" --pages \"$N\" --text-contains \"$TITLE\" --text-contains \"$CLIENT\"\n```\n\nA page-count mismatch or a missing title stops the workflow here: the package step does not start. Look at the rendered pages\n(`pi-craft pdfcraft exec render out.pdf --page 1 --out \u003Cabs>.png`, then read the image) before step 3 — the gate cannot see a\nwrong picture or a broken cover.\n\n### Step 3 — Package (optional)\n\n**Output:** `03-package\u002Ffinal.pdf` (combined, audited, optionally password-protected).\n**Gate:** `pi-craft verify` on the **unprotected** pdf (`--pages` = sum of the parts); a protected pdf cannot be probed, so the protect\nstep is checked by `check: protected` (opening without the password must fail).\n\n```bash\npi-craft pdfcraft exec combine \"$JOB\u002F02-render\u002Fout.pdf\" appendix.pdf --out \"$JOB\u002F03-package\u002Ffinal.pdf\"     # skip when there is nothing to add\npi-craft pdfcraft exec audit \"$JOB\u002F03-package\u002Ffinal.pdf\"                                                   # faux-redaction finder, fails when found\npi-craft verify \"$JOB\u002F03-package\u002Ffinal.pdf\" --pages 5 --text-contains \"$(jq -r .title \"$JOB\u002F01-prepare\u002Fprepare.json\")\"\n```\n\nProtect only when asked. The password comes from the user at run time; it goes to a `0600` temp file outside the job directory\n(argv would show it in the process list for the call; the temp file is deleted at once) and **never** into `job.json`, reports or\nthe job directory:\n\n```bash\nS=$(mktemp); chmod 600 \"$S\"\njq -nc --arg pw \"$PASSWORD\" --arg in \"$JOB\u002F03-package\u002Ffinal.pdf\" --arg out \"$JOB\u002F03-package\u002Ffinal-protected.pdf\" \\\n  '[{tool:\"doc_open\",args:{path:$in}},{tool:\"doc_protect\",args:{doc:1,open_password:$pw}},{tool:\"doc_save\",args:{doc:1,path:$out}}]' > \"$S\"\npi-craft pdfcraft exec run --script \"$S\"; rm -f \"$S\"\n```\n\n```bash check: protected\n# run from the directory that contains craft-jobs\u002F: opening without the password must fail\n! pi-craft pdfcraft exec info \"craft-jobs\u002F$SLUG\u002F03-package\u002Ffinal-protected.pdf\" >\u002Fdev\u002Fnull 2>&1\n```\n\n## Resume\n\nFollow the **Craft jobs** convention in `craft-studio`: read `craft-jobs\u002F\u003Cslug>\u002Fjob.json` as data, confirm the job name, and start\nat the first step with no passing report **or** whose recorded inputs (path, size, mtime) changed — an edited `report.md`, a new\ntemplate, an image. Re-run every step downstream of it (a changed `report.md` re-prepares, re-renders and re-packages) and reuse the\nverified outputs before it. Record each step with the `job-helper` snippet after its gate passed; the prepare step's report is\nthe `prepare.json` summary (`defaulted`, `unresolved`, counts). A job stopped after step 2 verified resumes at step 3 with the\nverified pdf. Never record a protect password.\n\n## When a gate fails\n\nStop at the failed gate; never continue past it. Re-discover the commands you used (`pi-craft wordcraft exec commands --json | jq\n…` — WordCraft has no `describe`; `pi-craft pdfcraft exec tools` for PdfCraft), repeat the step and re-run the gate. At most 2\nretries per step; after the second failure stop and report the verify output and what was tried. `pi-craft verify` exit `3` means\na probe tool is missing (PdfCraft cannot be provisioned): stop and report the missing tool — never treat it as a pass. If\nWordCraft itself cannot be provisioned, offer `document-converter` as the fallback renderer.\n\n## Recipes\n\n```bash recipe: doc-publish-core\n# A WordCraft-made template -> doc prepare -> WordCraft render with TOC -> pdf gate. (The real company template is\n# ~\u002FDocuments\u002Ftemplates\u002Fdefault; this one is built on the spot so the recipe needs nothing installed.)\nmkdir -p templates\u002Fdefault 01-prepare 02-render\npi-craft wordcraft exec run --cmd para.heading1 --cmd 'text.insert={\"text\":\"{{ client_name }}\"}' \\\n  --cmd text.newParagraph --cmd para.normal --cmd 'text.insert={\"text\":\"Version {{ version }}\"}' \\\n  --save templates\u002Fdefault\u002Ftemplate.docx\nprintf -- '---\\ndocument_title: Quarterly Report\\nclient_name: ACME Kft.\\nversion: \"2.0\"\\nenable_toc: true\\ntoc_heading: Contents\\n---\\n# Quarterly Report\\n\\nHello {{ client_name }}.\\n\\n## Results\\n\\nRevenue grew by twelve percent.\\n' > report.md\npi-craft doc prepare report.md --out 01-prepare --templates-dir templates\njq -e '(.unresolved|length==0) and (.mermaid.unrendered==0) and (.images.skipped|length==0) and (.images.remote|length==0) and (.defaulted|length==0)' 01-prepare\u002Fprepare.json\n\nD=\"$PWD\u002F01-prepare\"; TOC=$(jq -r .toc.enabled \"$D\u002Fprepare.json\")\nARGS=(--cmd 'caret.docEnd={}' --cmd 'text.pageBreak={}')\nif [ \"$TOC\" = true ]; then\n  ARGS+=(--cmd \"references.toc=$(jq -c '{levels:.toc.levels,title:.toc.heading}' \"$D\u002Fprepare.json\")\" --cmd 'caret.docEnd={}' --cmd 'text.pageBreak={}')\nfi\nARGS+=(--cmd \"insert.textFromFile=$(jq -nc --arg p \"$D\u002Fbody.md\" '{path:$p}')\")\nARGS+=(--cmd \"file.properties=$(jq -c '{title:.title}' \"$D\u002Fprepare.json\")\")\n[ \"$TOC\" = true ] && ARGS+=(--cmd 'references.updateToc={}')\npi-craft wordcraft exec run --file \"$D\u002Ftemplate.filled.docx\" \"${ARGS[@]}\" --save 02-render\u002Fout.docx\npi-craft wordcraft exec convert 02-render\u002Fout.docx 02-render\u002Fout.pdf\nN=$(pi-craft wordcraft exec info 02-render\u002Fout.docx | jq -r .pages)\npi-craft verify 02-render\u002Fout.pdf --pages \"$N\" --text-contains \"Quarterly Report\" --text-contains \"ACME Kft.\" --text-contains \"Version 2.0\"\n```\n\n```bash recipe: doc-publish-protect\n# Package step: protect with a password from a 0600 temp file (never in the job directory), then prove the protection.\npi-craft wordcraft exec run --cmd 'text.insert={\"text\":\"Confidential offer\"}' --save src.docx\npi-craft wordcraft exec convert src.docx final.pdf\npi-craft verify final.pdf --pages 1 --text-contains \"Confidential offer\"\nPASSWORD=${PASSWORD:-recipe-only-secret}\nS=$(mktemp); chmod 600 \"$S\"\njq -nc --arg pw \"$PASSWORD\" --arg in \"$PWD\u002Ffinal.pdf\" --arg out \"$PWD\u002Ffinal-protected.pdf\" \\\n  '[{tool:\"doc_open\",args:{path:$in}},{tool:\"doc_protect\",args:{doc:1,open_password:$pw}},{tool:\"doc_save\",args:{doc:1,path:$out}}]' > \"$S\"\npi-craft pdfcraft exec run --script \"$S\"; rm -f \"$S\"\n! pi-craft pdfcraft exec info final-protected.pdf >\u002Fdev\u002Fnull 2>&1\ntest -f final-protected.pdf\npi-craft verify final.pdf --pages 1\n```\n","# craft-doc-publish — Markdown + template → DOCX + PDF (→ packaged PDF)\n\nThe **default** Markdown → templated DOCX\u002FPDF path. `pi-craft doc prepare` fills the template's placeholders (frontmatter,\n`--var`, template defaults, system variables) and prepares the body; WordCraft then only appends the body, builds the TOC and\nexports; PdfCraft packages the result. No Docker, no pandoc. Read `wordcraft` (and `pdfcraft` for step 3) first. Resumable-job\nrules are in the `craft-studio` router, section **Craft jobs**. Ingest\u002FOCR of existing documents, round-trip editing\n(extract → edit → merge back), PlantUML and table-width profiles stay with `document-converter`.\n\n## Step table\n\n| # | Step | Tool | Input → Output | Gate |\n|---|---|---|---|---|\n| 0 | Preflight + job | agent | request → `job.json` | `check: job` |\n| 1 | Prepare | `pi-craft doc prepare` | `report.md` + template → `01-prepare\u002F` (`template.filled.docx`, `body.md`, `prepare.json`) | `check: prepare` (+ user confirms defaults) |\n| 2 | Render | WordCraft | filled template + body → `02-render\u002Fout.docx`, `out.pdf` | `pi-craft verify --pages --text-contains` |\n| 3 | Package (optional) | PdfCraft | pdf (+ extra pdfs) → `03-package\u002Ffinal.pdf` | `pi-craft verify` (before protecting) |\n\nHand-off formats: filled `docx` + Markdown body between 1 and 2, `pdf` out (the docx is verified through its pdf). The\ntemplate is a doc-engine template directory `\u003Ctemplates-dir>\u002F\u003Cname>\u002Ftemplate.docx` (+ `variables.xml`, `manifest.xml`).\nPasswords and API keys are never written to `job.json`, gate reports or step files.\n\n### Step 0 — Preflight and job\n\n**Output:** `craft-jobs\u002F\u003Cslug>\u002Fjob.json` (created or loaded).\n**Gate:** `check: job`.\n\n| Sibling | Package | Check | If missing |\n|---|---|---|---|\n| `document-converter` | `@blackbelt-technology\u002Fpi-dashboard-document-converter` | skill in the loaded skill list | not needed here: only for ingest\u002FOCR, round-trip editing and PlantUML — route those requests to it, continue otherwise |\n| `mmdc` | `@mermaid-js\u002Fmermaid-cli` | `command -v mmdc` (it needs a Chromium; if it cannot find one set `PUPPETEER_EXECUTABLE_PATH`) | diagrams stay code blocks; step 1's gate asks you to install it or accept code-block diagrams |\n| `pi-nano-banana` | already a dependency of craft-apps | usable credentials, only when the frontmatter sets `nano_banana.enabled: true` | no credentials: diagrams render with `mmdc` (the fallback runs anyway) |\n\n\"Loaded skill list\" is the available-skills list in your own system prompt. `nano_banana.enabled` is a **paid** API call per\nnew diagram: state that to the user before step 1; results are cached in `.mermaid-cache\u002F` next to the Markdown.\nResolve the template first and **echo its path to the user** (it is in `prepare.json` after step 1): `.\u002Ftemplates` is searched\nbefore `~\u002FDocuments\u002Ftemplates`, so a repo-local template can win without being asked for.\n\nSet up the job (**Craft jobs** in `craft-studio`: slug rule, `job-helper`) and run **Resume**.\n\n```bash check: job\n# run from the directory that contains craft-jobs\u002F (SLUG set as in step 0)\njq -e '.name and .workflow and (.steps | type == \"object\")' \"craft-jobs\u002F$SLUG\u002Fjob.json\"\n```\n\n### Step 1 — Prepare\n\n**Output:** `01-prepare\u002Ftemplate.filled.docx`, `01-prepare\u002Fbody.md`, `01-prepare\u002Fprepare.json`.\n**Gate:** `check: prepare` — the report has no unresolved placeholder, unrendered diagram, skipped or remote image, and\nevery template-defaulted variable was confirmed by the user.\n\n```bash\npi-craft doc prepare report.md --out \"$JOB\u002F01-prepare\" [--template default] [--templates-dir \u003Cdir>] [--var client_name=\"ACME Kft.\"]… [--allow-path \u003Cdir>]…\n```\n\nFrontmatter uses the doc-engine keys: `template`, `templates_dir`, `language`, `document_title`, `document_name`,\n`enable_toc`, `toc_heading`, `nano_banana`; every other scalar key is a template variable (`--var` wins over frontmatter,\nwhich wins over the template's own `variables.xml` default). Read `prepare.json`:\n\n- `defaulted` — variables that still carry the **template's default** (a real template ships another customer's name, offer\n  number…). **Show each default value and ask the user to confirm or supply a value** (`--var name=value`, rerun). Only then run the\n  gate with `DEFAULTS_CONFIRMED=1`.\n- `unresolved` — placeholders with no value (also a token split across paragraphs): supply the variable or, with the user's\n  consent, `--allow-missing`.\n- `mermaid.unrendered` — diagrams left as code (no `mmdc`, no browser, render error): **ask the user to install `mmdc` or accept\n  code-block diagrams** before rendering.\n- `images.skipped` \u002F `images.remote` — images outside the Markdown's directory (pass `--allow-path`), missing, or remote\n  (WordCraft does not fetch them): fix the path or accept the omission with the user.\n- `warnings` — PlantUML blocks stay code (use `document-converter`); a variable value that contained image\u002Fdiagram syntax stays literal.\n- `pictures` — present when the template owns images (WordCraft 0.7.0 would paste every Markdown-imported image onto the\n  template's first one): `body.md` then carries `CRAFTIMG0001`-style markers and step 2 puts the pictures in.\n\n```bash check: prepare\n# run inside the step directory: cd \"$JOB\u002F01-prepare\" (DEFAULTS_CONFIRMED=1 once the user confirmed every defaulted variable)\njq -e --arg ok \"${DEFAULTS_CONFIRMED:-0}\" '\n  (.unresolved | length == 0) and (.mermaid.unrendered == 0) and (.images.skipped | length == 0) and (.images.remote | length == 0)\n  and ((.defaulted | length == 0) or $ok == \"1\")' prepare.json\n```\n\n### Step 2 — Render\n\n**Output:** `02-render\u002Fout.docx` and `02-render\u002Fout.pdf` (the docx is verified through its pdf).\n**Gate:** `pi-craft verify out.pdf --pages N --text-contains \"\u003Ctitle>\"` — `N` is WordCraft's own page count of the docx.\n\nOne WordCraft run opens the **filled** template with `run --file` (never `run --template`: it drops the template's header\u002Ffooter\nparts), appends the body after a page break, builds the TOC if enabled, puts in any pictures, sets the properties, then `convert`\nexports the pdf. The TOC is inserted **before** the body: `references.toc` leaves the caret above the TOC, so move to the end\n(`caret.docEnd`) again before the second page break and the body.\n\n```bash\nD=\"$PWD\u002F$JOB\u002F01-prepare\"; TOC=$(jq -r .toc.enabled \"$D\u002Fprepare.json\")\nARGS=(--cmd 'caret.docEnd={}' --cmd 'text.pageBreak={}')\nif [ \"$TOC\" = true ]; then\n  ARGS+=(--cmd \"references.toc=$(jq -c '{levels:.toc.levels,title:.toc.heading}' \"$D\u002Fprepare.json\")\" --cmd 'caret.docEnd={}' --cmd 'text.pageBreak={}')\nfi\nARGS+=(--cmd \"insert.textFromFile=$(jq -nc --arg p \"$D\u002Fbody.md\" '{path:$p}')\")\n# pictures (only when prepare.json has them): find the marker, insert the picture, delete the marker\nwhile IFS= read -r pic; do\n  m=$(jq -r .marker \u003C\u003C\u003C\"$pic\"); f=$(jq -r .file \u003C\u003C\u003C\"$pic\")\n  ARGS+=(--cmd \"edit.find=$(jq -nc --arg t \"$m\" '{text:$t}')\" --cmd \"insert.picture=$(jq -nc --arg p \"$D\u002F$f\" '{path:$p}')\" --cmd \"edit.replaceAll=$(jq -nc --arg t \"$m\" '{text:$t,with:\"\"}')\")\ndone \u003C \u003C(jq -c '.pictures[]?' \"$D\u002Fprepare.json\")\nARGS+=(--cmd \"file.properties=$(jq -c '{title:.title}' \"$D\u002Fprepare.json\")\")\n[ \"$TOC\" = true ] && ARGS+=(--cmd 'references.updateToc={}')\npi-craft wordcraft exec run --file \"$D\u002Ftemplate.filled.docx\" \"${ARGS[@]}\" --save \"$JOB\u002F02-render\u002Fout.docx\"\npi-craft wordcraft exec convert \"$JOB\u002F02-render\u002Fout.docx\" \"$JOB\u002F02-render\u002Fout.pdf\"\nN=$(pi-craft wordcraft exec info \"$JOB\u002F02-render\u002Fout.docx\" | jq -r .pages)\nTITLE=$(jq -r .title \"$D\u002Fprepare.json\")\nCLIENT=${CLIENT:?set CLIENT to a variable value you supplied, e.g. the --var client_name value}\npi-craft verify \"$JOB\u002F02-render\u002Fout.pdf\" --pages \"$N\" --text-contains \"$TITLE\" --text-contains \"$CLIENT\"\n```\n\nA page-count mismatch or a missing title stops the workflow here: the package step does not start. Look at the rendered pages\n(`pi-craft pdfcraft exec render out.pdf --page 1 --out \u003Cabs>.png`, then read the image) before step 3 — the gate cannot see a\nwrong picture or a broken cover.\n\n### Step 3 — Package (optional)\n\n**Output:** `03-package\u002Ffinal.pdf` (combined, audited, optionally password-protected).\n**Gate:** `pi-craft verify` on the **unprotected** pdf (`--pages` = sum of the parts); a protected pdf cannot be probed, so the protect\nstep is checked by `check: protected` (opening without the password must fail).\n\n```bash\npi-craft pdfcraft exec combine \"$JOB\u002F02-render\u002Fout.pdf\" appendix.pdf --out \"$JOB\u002F03-package\u002Ffinal.pdf\"     # skip when there is nothing to add\npi-craft pdfcraft exec audit \"$JOB\u002F03-package\u002Ffinal.pdf\"                                                   # faux-redaction finder, fails when found\npi-craft verify \"$JOB\u002F03-package\u002Ffinal.pdf\" --pages 5 --text-contains \"$(jq -r .title \"$JOB\u002F01-prepare\u002Fprepare.json\")\"\n```\n\nProtect only when asked. The password comes from the user at run time; it goes to a `0600` temp file outside the job directory\n(argv would show it in the process list for the call; the temp file is deleted at once) and **never** into `job.json`, reports or\nthe job directory:\n\n```bash\nS=$(mktemp); chmod 600 \"$S\"\njq -nc --arg pw \"$PASSWORD\" --arg in \"$JOB\u002F03-package\u002Ffinal.pdf\" --arg out \"$JOB\u002F03-package\u002Ffinal-protected.pdf\" \\\n  '[{tool:\"doc_open\",args:{path:$in}},{tool:\"doc_protect\",args:{doc:1,open_password:$pw}},{tool:\"doc_save\",args:{doc:1,path:$out}}]' > \"$S\"\npi-craft pdfcraft exec run --script \"$S\"; rm -f \"$S\"\n```\n\n```bash check: protected\n# run from the directory that contains craft-jobs\u002F: opening without the password must fail\n! pi-craft pdfcraft exec info \"craft-jobs\u002F$SLUG\u002F03-package\u002Ffinal-protected.pdf\" >\u002Fdev\u002Fnull 2>&1\n```\n\n## Resume\n\nFollow the **Craft jobs** convention in `craft-studio`: read `craft-jobs\u002F\u003Cslug>\u002Fjob.json` as data, confirm the job name, and start\nat the first step with no passing report **or** whose recorded inputs (path, size, mtime) changed — an edited `report.md`, a new\ntemplate, an image. Re-run every step downstream of it (a changed `report.md` re-prepares, re-renders and re-packages) and reuse the\nverified outputs before it. Record each step with the `job-helper` snippet after its gate passed; the prepare step's report is\nthe `prepare.json` summary (`defaulted`, `unresolved`, counts). A job stopped after step 2 verified resumes at step 3 with the\nverified pdf. Never record a protect password.\n\n## When a gate fails\n\nStop at the failed gate; never continue past it. Re-discover the commands you used (`pi-craft wordcraft exec commands --json | jq\n…` — WordCraft has no `describe`; `pi-craft pdfcraft exec tools` for PdfCraft), repeat the step and re-run the gate. At most 2\nretries per step; after the second failure stop and report the verify output and what was tried. `pi-craft verify` exit `3` means\na probe tool is missing (PdfCraft cannot be provisioned): stop and report the missing tool — never treat it as a pass. If\nWordCraft itself cannot be provisioned, offer `document-converter` as the fallback renderer.\n\n## Recipes\n\n```bash recipe: doc-publish-core\n# A WordCraft-made template -> doc prepare -> WordCraft render with TOC -> pdf gate. (The real company template is\n# ~\u002FDocuments\u002Ftemplates\u002Fdefault; this one is built on the spot so the recipe needs nothing installed.)\nmkdir -p templates\u002Fdefault 01-prepare 02-render\npi-craft wordcraft exec run --cmd para.heading1 --cmd 'text.insert={\"text\":\"{{ client_name }}\"}' \\\n  --cmd text.newParagraph --cmd para.normal --cmd 'text.insert={\"text\":\"Version {{ version }}\"}' \\\n  --save templates\u002Fdefault\u002Ftemplate.docx\nprintf -- '---\\ndocument_title: Quarterly Report\\nclient_name: ACME Kft.\\nversion: \"2.0\"\\nenable_toc: true\\ntoc_heading: Contents\\n---\\n# Quarterly Report\\n\\nHello {{ client_name }}.\\n\\n## Results\\n\\nRevenue grew by twelve percent.\\n' > report.md\npi-craft doc prepare report.md --out 01-prepare --templates-dir templates\njq -e '(.unresolved|length==0) and (.mermaid.unrendered==0) and (.images.skipped|length==0) and (.images.remote|length==0) and (.defaulted|length==0)' 01-prepare\u002Fprepare.json\n\nD=\"$PWD\u002F01-prepare\"; TOC=$(jq -r .toc.enabled \"$D\u002Fprepare.json\")\nARGS=(--cmd 'caret.docEnd={}' --cmd 'text.pageBreak={}')\nif [ \"$TOC\" = true ]; then\n  ARGS+=(--cmd \"references.toc=$(jq -c '{levels:.toc.levels,title:.toc.heading}' \"$D\u002Fprepare.json\")\" --cmd 'caret.docEnd={}' --cmd 'text.pageBreak={}')\nfi\nARGS+=(--cmd \"insert.textFromFile=$(jq -nc --arg p \"$D\u002Fbody.md\" '{path:$p}')\")\nARGS+=(--cmd \"file.properties=$(jq -c '{title:.title}' \"$D\u002Fprepare.json\")\")\n[ \"$TOC\" = true ] && ARGS+=(--cmd 'references.updateToc={}')\npi-craft wordcraft exec run --file \"$D\u002Ftemplate.filled.docx\" \"${ARGS[@]}\" --save 02-render\u002Fout.docx\npi-craft wordcraft exec convert 02-render\u002Fout.docx 02-render\u002Fout.pdf\nN=$(pi-craft wordcraft exec info 02-render\u002Fout.docx | jq -r .pages)\npi-craft verify 02-render\u002Fout.pdf --pages \"$N\" --text-contains \"Quarterly Report\" --text-contains \"ACME Kft.\" --text-contains \"Version 2.0\"\n```\n\n```bash recipe: doc-publish-protect\n# Package step: protect with a password from a 0600 temp file (never in the job directory), then prove the protection.\npi-craft wordcraft exec run --cmd 'text.insert={\"text\":\"Confidential offer\"}' --save src.docx\npi-craft wordcraft exec convert src.docx final.pdf\npi-craft verify final.pdf --pages 1 --text-contains \"Confidential offer\"\nPASSWORD=${PASSWORD:-recipe-only-secret}\nS=$(mktemp); chmod 600 \"$S\"\njq -nc --arg pw \"$PASSWORD\" --arg in \"$PWD\u002Ffinal.pdf\" --arg out \"$PWD\u002Ffinal-protected.pdf\" \\\n  '[{tool:\"doc_open\",args:{path:$in}},{tool:\"doc_protect\",args:{doc:1,open_password:$pw}},{tool:\"doc_save\",args:{doc:1,path:$out}}]' > \"$S\"\npi-craft pdfcraft exec run --script \"$S\"; rm -f \"$S\"\n! pi-craft pdfcraft exec info final-protected.pdf >\u002Fdev\u002Fnull 2>&1\ntest -f final-protected.pdf\npi-craft verify final.pdf --pages 1\n```\n",{"name":5,"description":7},"develop","fb9a5af356f540de4839ef851ebbe14bcce64c0f","packages\u002Fcraft-apps\u002F.pi\u002Fskills\u002Fcraft-doc-publish",56,"https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard","https:\u002F\u002Fpi-dashboard.dev\u002F","https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology","https:\u002F\u002Fwww.blackbelt.hu","2026-11-12 23:37:37",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add BlackBeltTechnology\u002Fpi-agent-dashboard --skill craft-doc-publish",{"tool":66,"command":67},"bunx","bunx skills add BlackBeltTechnology\u002Fpi-agent-dashboard --skill craft-doc-publish",{"tool":69,"command":70},"pnpm","pnpm dlx skills add BlackBeltTechnology\u002Fpi-agent-dashboard --skill craft-doc-publish","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard\u002Fblob\u002Fdevelop\u002Fpackages\u002Fcraft-apps\u002F.pi\u002Fskills\u002Fcraft-doc-publish\u002FSKILL.md",true,[],[75,101,127,150,170,191],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":46},"01M6HQYQ5B82AM5T9Y299S9CFY","youtube-srt","Download YouTube subtitles (SRT + timestamped TXT) for a channel, playlist or video via yt-dlp, no media download; optionally mine them into a categorized catalog (e.g. AI models by function, open weights, local runnability, hardware tier). Use on \"download the srt of this video\", \"transcripts of channel X for the last N months\", \"catalog the models AI Search talked about\", \"update docs\u002Fmodels\".","https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard\u002Fblob\u002Fdevelop\u002Fpackages\u002Fvideo-transcription\u002F.pi\u002Fskills\u002Fyoutube-srt\u002FSKILL.md",[],[82,83,84,85,86,87,88,89,90,91,92,38,93,94,95,96,97,98,99,30,100],"youtube","srt","youtube srt","update","search","subtitles","dlp","Video","Media","open","catalog","update docs","yt-dlp","local","mine","via","ai models","last","media download",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":46},"01M6HQYJBKSXR55T5RSYNJQG4D","video-transcription","Transcribe video and audio files to SRT subtitles with speaker diarization using the Soniox (default) or AssemblyAI API. Use when the user wants to transcribe meetings, videos, or audio files. Supports MKV, MP4, MOV, M4A, MP3. Triggers on \"\u002Ftranscribe\", \"transcribe my meetings\", \"transcribe videos in ~\u002FMovies\", or any request to convert audio\u002Fvideo to text.","https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard\u002Fblob\u002Fdevelop\u002Fpackages\u002Fvideo-transcription\u002F.pi\u002Fskills\u002Fvideo-transcription\u002FSKILL.md",[],[89,108,109,110,87,111,112,113,114,115,116,38,117,118,119,120,32,121,122,83,123,124,125,126],"transcription","video transcription","transcribe","api","Audio","convert","mp4","text","meetings","files","default","mp3","triggers","videos","assemblyai","my","srt subtitles","request","when",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":46},"01M6HQYECMVDC5TDHHW22VC5RX","speaker-id","Name anonymous diarized SRT speakers from a persistent local voiceprint library and repair speaker drift; local, CPU-only, no API key. Triggers \"who is speaker 2\", \"put names on the transcript\", \"label the meeting SRT\", \"the diarization split one person into three\", \"enroll my voice\". Backed by the pi-voiceid CLI.","https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard\u002Fblob\u002Fdevelop\u002Fpackages\u002Fvideo-transcription\u002F.pi\u002Fskills\u002Fspeaker-id\u002FSKILL.md",[],[134,135,136,137,111,138,139,140,141,142,143,95,120,144,145,146,147,83,148,149],"id","speaker id","cli","transcript","voice","pi","only","three","drift","repair","name","CPU","meeting","anonymous","split","person",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":46},"01M6HQYAZWDXE9QJEG592E5PXK","veo-showreel-production-kit","Turn a video timeline + voiceover into a reproducible, sliceable Veo 3.1 prompt package with a consistency anchor and AI storyboard sketches.","https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard\u002Fblob\u002Fdevelop\u002Fpackages\u002Fvideo-production\u002F.pi\u002Fskills\u002Fveo-showreel-production-kit\u002FSKILL.md",[],[157,158,159,160,43,161,162,89,163,164,165,166,32,167,168,169],"Production","veo","kit","veo showreel production kit","Reproducible","timeline","prompt","voiceover","storyboard","anchor","consistency","veo 3","2026",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"publishedAt":46},"01M6HQY6TJ0X1ADDKYPMVJY6NV","veo-generator","Render a scripted video project into mp4 clips with the Google Veo 3.1 API. Reads a project's shot package (shots\u002F*.md), one clip per camera cut, reusing each shot's prompt and sketch — world anchor only with `--with-reference`, seed unless `--no-seed`. Use on \"render the Veo video for \u003Cproject>\", \"generate the videos from the shot scripts\", \"make the clips with Veo\".","https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard\u002Fblob\u002Fdevelop\u002Fpackages\u002Fvideo-production\u002F.pi\u002Fskills\u002Fveo-generator\u002FSKILL.md",[],[158,177,178,179,180,43,111,89,114,163,38,181,140,182,183,184,185,186,166,187,188,33,189,32,190,30,168],"generator","veo generator","google","generate","clip","sketch","camera","world","seed","project","cut","scripts","render","google veo",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":46},"01M6HQY1K2NZJ3B2YHSJJPPVAF","hyperframes-showreel","Turn real screen and site footage into a rhythmic showreel rendered with HyperFrames: sampling, edit script, redacted clips, a generated composition, Veo only as additive FX, music edit + camera punches, delivery render and export QA. Use on \"make a showreel from these recordings\", \"build the HyperFrames video\", \"assemble the footage edit\", \"render and QA the showreel\".","https:\u002F\u002Fgithub.com\u002FBlackBeltTechnology\u002Fpi-agent-dashboard\u002Fblob\u002Fdevelop\u002Fpackages\u002Fvideo-production\u002F.pi\u002Fskills\u002Fhyperframes-showreel\u002FSKILL.md",[],[198,199,200,89,201,202,203,38,204,205,206,140,207,208,35,209,210,189,32,211],"hyperframes","hyperframes showreel","qa","Composition","edit","generated","assemble","export","sampling","build","delivery","fx","screen","script"]