tw prop. Content flows, and the engine paginates, repeats table headers, and resolves page counters in running header and footer bands.
The preview is not an HTML approximation. The dev server renders actual PDF bytes with the Takumi engine in a web worker, so the page you see in the browser is the page you export. Preview and export share one renderer.
The loop
- The agent writes. You prompt your coding agent (Claude Code, Cursor, Codex) and it authors
docs/<id>/index.tsxusing the bundledcreate-docskill. - You watch a live PDF.
npm run devserves the preview atlocalhost:5173. Every save re-renders the real PDF in well under half a second. - You inspect and comment. Press
ito enter Inspect mode. Clicking any element maps to its exact source lines. Comments are saved into the source as@pdf-commentmarkers. - The agent applies. Ask the agent to run
apply-comments. It reads the markers, makes the edits, and deletes the markers. The dev server also writesnode_modules/.open-pdf/current.json, a cursor the agent reads so “this page” and “this element” resolve without you naming them. - You export.
open-pdf exportrenders headlessly to PDF.--format docxproduces an editable Word file, and dropping that into Google Drive converts it to a Google Doc.
What a document looks like
A document is one folder underdocs/ with a kebab-case id. Its index.tsx default-exports one component and optionally exports meta and pageOptions:
docs/getting-started/index.tsx
pageOptions.header and pageOptions.footer, and hard page starts via breakBefore: 'page'.
Built for agents
A scaffolded workspace ships five agent skills alongside anAGENTS.md guide, so the agent knows the file contract before it writes a line:
create-docwalks the agent through scoping, structure, and hand-off for a new document.doc-authoringis the technical reference: thetwdialect, page geometry, tables, pagination, running bands.apply-commentsturns inspector comments into edits.current-docresolves “this page” and “this element” from the dev server’s cursor file.create-themeextracts reusable themes as markdown underthemes/.
Quickstart
Scaffold a workspace, create your first document, and export it in a few minutes.
Documents
The file contract:
docs/<id>/index.tsx, meta, pageOptions, and the tw dialect.Inspector
Click-to-inspect, comments as source markers, and the apply-comments loop.
Export
Headless PDF export and editable DOCX for Word and Google Docs.