docx · Word Document Toolkit
最后更新:
Aiglade is a Windows desktop application that runs several command-line AI agents at once — Claude Code, Codex CLI, Hermes, OpenClaw — inside one window, with a shared task queue and a single approval gate for consequential actions.

docx creates, reads, edits, and reviews Word documents (.docx/.dotx). New documents are generated with docx-js scripts (plus a built-in checklist of layout pitfalls: page size, dual table widths, list numbering, TOC outlines); editing existing files goes through unzip → edit word/document.xml → zip (docx-js can't open existing files); reading goes through pandoc to Markdown.
It supports tracked changes (review with per-author validation), comments (auto-generated six-file linkage), and clean accepted copies — with every output rendered to PDF for visual verification.
Example invocation: "Turn this report into a Word document with a table of contents."
Full brief
Positioning
docx is the general-purpose Word document toolkit: creating, reading, editing, and reviewing .docx/.dotx files, with a dedicated path per task. It does not handle PDFs or spreadsheets.
Core capabilities
- New documents: generated by
docx(npm) scripts with a built-in pitfall checklist — A4 default vs Letter DXA sizes, landscape via portrait dimensions + orientation, table column widths AND cell widths in DXA,ShadingType.CLEAR(never SOLID), lists vianumberingconfig,ImageRunrequirestype:, page breaks inside paragraphs, TOC needs built-in heading styles oroutlineLevel. - Editing existing documents:
unzip→merge_runs.pyto coalesce fragmented runs (Word splits visible text across runs; only merged text is findable) → editword/document.xmlin place (no reformatting) →zip; legacy.docconverts first; symlinks stripped from untrusted files. - Reading:
pandoc -t markdown file.docxfor extraction. - Tracked changes: edits wrapped in
w:ins/w:delwith id/author/date;validate.py --authorchecks every edit is tracked;accept_changes.pyproduces a clean accepted copy. - Comments:
comment.pyauto-generates the six cross-linked comment files (directory or direct mode); anchor markers placed in document.xml. - Output verification: soffice to PDF + pdftoppm rendering — every document is visually checked.
Workflow
- Create: write the docx-js script → generate → render and visually verify
- Edit: unzip → merge_runs → edit XML in place → zip → validate (XSD;
--auto-repairfor common issues) → render and verify - Review: tracked edits / comments →
--authorvalidation → clean accepted copy
Inputs & outputs
| Input | Notes |
|---|---|
| Requirements / template | Content and layout for new documents |
| Existing document | .docx / .dotx (legacy .doc converts first); external files treated as untrusted |
Output: .docx file + rendered verification images (PDF/JPG); author-validation report for tracked reviews.
Boundaries with adjacent skills
- md2resume (office docs): a fixed template pipeline for Markdown → one-page Chinese resumes; docx is the general Word creation/editing/review toolkit.
Fit
- Formal reports, memos, letters, and templates with TOCs, page numbers, tables, letterheads
- Editing existing contracts with tracked-change review
- Bulk find-and-replace, image swaps, content reorganization
- Commenting and closing the review loop
Before you start
- Dependencies:
docx(npm, preinstalled), pandoc, LibreOffice (soffice), pdftoppm. - No API key; no PDFs, spreadsheets, or Google Docs.
- Tracked review needs the reviewer's name (
--author) to validate complete change tracking.
docx is part of the Aiglade Skill library. Invoke it from the Aiglade chat box in plain language.
Key numbers
- docx handling: describe what you need in plain words, no commands to memorize — the guided flow walks you through it.
- 4 built-in AIs: Claude Code, Codex CLI, Hermes, OpenClaw.
- Local database: 24 tables, 131 HTTP endpoints.
- Concurrency: up to 10 tasks by default (max 5 per agent), 8 built-in agent nodes.
- Get your gateway key in about a minute after signing up.
- Task and confirmation records stay on your machine; only the actual AI call uses the network.
FAQ
What can it do with Word files?
A general-purpose toolkit for creating, reading, editing, and reviewing .docx/.dotx — with a dedicated path per task. No PDFs, no spreadsheets.
How does it edit an existing document?
unzip → edit word/document.xml → zip, because docx-js can't open existing files. merge_runs.py coalesces fragmented runs first (Word splits visible text across runs; only merged text is findable). Legacy .doc converts first.
Can it track changes and comments?
Yes. Tracked changes are wrapped in w:ins/w:del with id/author/date; validate.py --author checks every edit is tracked; accept_changes.py produces a clean accepted copy. comment.py auto-generates six cross-linked comment files.
What do I need installed?
docx (npm, preinstalled), pandoc, LibreOffice (soffice), pdftoppm. No API key. Tracked review needs the reviewer's name (--author) for complete change tracking.
Call it in 3 steps
- New document: write a docx-js script → generate → render to PDF and check the layout visually (pitfall checklist: A4 vs Letter DXA sizes, table column AND cell widths, list numbering config, TOC needs built-in heading styles).
- Existing document: unzip → merge_runs.py → edit word/document.xml → zip; convert legacy .doc first.
- Reading:
pandoc -t markdown file.docx. - Review: pass
--authorso validate.py can verify complete change tracking; produce the clean copy with accept_changes.py. - Always verify visually: soffice → PDF → pdftoppm render — don't trust the XML, look at the picture.