docx
Installation
SKILL.md
DOCX
Use this skill for .docx work. A .docx file is a ZIP archive of XML parts, so creation and editing require validation after changes.
Workflow
- Choose the task path.
- Read or analyze: use
pandocfirst, or unpack XML when tracked changes, comments, or formatting matter. - Create from scratch: use
docxfor JavaScript and follow references/creation.md. - Edit an existing file: unpack, edit XML, repack, and validate with references/editing.md.
- Add tracked changes, comments, images, or OOXML details: read references/xml-reference.md.
- Validate visual output or convert formats: use references/qa.md.
- Read or analyze: use
- Preserve the original file. Write output to a new path unless the user explicitly asks to overwrite.
- Use the bundled clean-room OOXML helper before falling back to raw ZIP commands:
python <skill-dir>/scripts/ooxml_tool.py --help. - Use
python <skill-dir>/scripts/docx_text.py --helpfor comments/tracked-change inspection and exact text-node replacement. - Use
python <skill-dir>/scripts/docx_comments.py --helpto add comments by exact text target (supports cross-run boundaries). - Use
python <skill-dir>/scripts/docx_track_changes.py --helpto programmatically accept or reject all simple tracked changes. - Validate generated or edited files before reporting success.