docs.write_docx
Schema
Input = { path: string, // .docx appended automatically if missing title: string, markdown: string, // headings, paragraphs, lists, bold/italic, code, tables subtitle?: string, author?: string,}
Output = { path: string, size: number, mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', blocks?: number,}How the document is built
markdownToDocx() parses the markdown with a small hand-rolled block parser
(packages/skills/src/docs/markdown.ts) into headings, paragraphs, quotes, rules, fenced code,
ordered/unordered lists, and tables, then renders each block type with the docx library into real
Word structures — not an HTML-to-Word conversion. Headings use a serif display font (Georgia), body
text uses Calibri, code gets a monospace font with a light shaded background, and tables get a
shaded header row. A title page block (title + optional subtitle) is always prepended. This is the
engine behind the Business plan and
Research report generators, both of which declare docx as an
output kind.
Example
curl -s -X POST http://localhost:4000/api/studio/skills/invoke \ -H 'content-type: application/json' -b cookies.txt \ -d '{"name":"docs.write_docx","input":{"path":"plan","title":"Lumen Bakehouse","subtitle":"Business plan","markdown":"## Summary\n\nA neighbourhood sourdough bakery..."}}'{ "ok": true, "output": { "path": "plan.docx", "size": 14832, "mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "blocks": 2 } }A sibling not in the canonical list
docs.write_pdf (same input shape, minus author) exists alongside it, rendering the identical
markdown parse tree onto real PDF pages with pdf-lib — page breaks, wrapped text, code blocks with
a shaded box, and simple tables — but it is not one of the 25 names in BUILTIN_SKILLS, so no
generator can declare it as an allowed skill yet even though it’s registered and invokable.