Word documents (.docx)
Creates Word files with docx-js, edits existing ones as unpacked XML, adds tracked changes and comments through bundled scripts, then validates and renders the result. Use when the deliverable or input is a .docx or .dotx file.
docx- Author
- Anthropic
- Source
- anthropics/skills/skills/docx @ e4bb5d9
- License
- Apache-2.0
About this skill
What it does
The skill treats a .docx as a ZIP of XML files and picks the route by task. A new document is a Node script using the docx npm library; SKILL.md skips the API and lists its traps, such as A4 by default, table widths needed on every cell, SOLID shading rendering black, and heading styles that need font, spacing and keepNext at every level. An existing file is unpacked with Python (not unzip, which restores symlinks from an untrusted file), edited in word/document.xml and zipped back. Reading goes through pandoc -t markdown. Every output is rendered to images and inspected. Tracked changes are written by hand as <w:ins> and <w:del>, and SKILL.md shows how.
The scripts:
merge_runs.pyjoins the runs Word splits text into, so phrases become searchable.office/validate.pychecks the XML against the bundled XSD schemas;--auto-repairfixes common ID and whitespace faults,--authorlists edits made outside tracked changes.accept_changes.pyaccepts all tracked changes through a LibreOffice macro.comment.pyadds a comment or reply, writing the six linked parts Word needs, and prints the markers that anchor it.office/soffice.pyruns LibreOffice in sandboxes where it otherwise fails.
When to use it, and when not
Use it for Word deliverables and .dotx templates, a contract redlined with tracked changes and comments, find-and-replace in an existing file, or reading one.
Not for PDFs, spreadsheets or Google Docs. No API keys; it needs Node with docx, pandoc, LibreOffice, Poppler's pdftoppm and Python with defusedxml and lxml. It assumes docx is installed and installs it only if the require fails.
How to run it
The install command below puts the whole folder in place: SKILL.md, scripts, schemas, templates and the licence. The agent picks the skill up whenever a Word file comes up; to call it yourself:
- Claude Code:
/docx, or ask for the skill by name. - Codex:
$docx. - Cursor: type
/in the Agent chat and pickdocx.
Example: /docx Redline contract.docx as "Legal": cap liability at 12 months of fees and comment on why.
How it differs from similar skills
Document co-authoring workflow shapes what a document says and writes Markdown or an artifact, not a .docx: draft there, build the file here. PowerPoint decks (.pptx) and Excel spreadsheets (.xlsx) each carry their own copy of the same scripts/office/ folder, so all three install independently. No other Word skill is in the catalog.
Install
Run one command — it saves SKILL.md and the files it uses into your agent's skills folder. Claude Code and Codex pick up a new skill without a restart; if it does not show up, restart the agent.
curl -fsSL --create-dirs -o ~/.claude/skills/docx/SKILL.md https://anymodel.org/en/skills/anthropic/docx/SKILL.md -o ~/.claude/skills/docx/LICENSE.txt https://anymodel.org/en/skills/anthropic/docx/LICENSE.txt -o ~/.claude/skills/docx/scripts/__init__.py https://anymodel.org/en/skills/anthropic/docx/scripts/__init__.py -o ~/.claude/skills/docx/scripts/accept_changes.py https://anymodel.org/en/skills/anthropic/docx/scripts/accept_changes.py -o ~/.claude/skills/docx/scripts/comment.py https://anymodel.org/en/skills/anthropic/docx/scripts/comment.py -o ~/.claude/skills/docx/scripts/merge_runs.py https://anymodel.org/en/skills/anthropic/docx/scripts/merge_runs.py -o ~/.claude/skills/docx/scripts/office/helpers/__init__.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/helpers/__init__.py -o ~/.claude/skills/docx/scripts/office/helpers/pptx_chart.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/helpers/pptx_chart.py -o ~/.claude/skills/docx/scripts/office/helpers/pptx_slide.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/helpers/pptx_slide.py -o ~/.claude/skills/docx/scripts/office/helpers/pptx_theme.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/helpers/pptx_theme.py -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd -o ~/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd -o ~/.claude/skills/docx/scripts/office/schemas/mce/mc.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/mce/mc.xsd -o ~/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-2010.xsd -o ~/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-2012.xsd -o ~/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-2018.xsd -o ~/.claude/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd -o ~/.claude/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd -o ~/.claude/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd -o ~/.claude/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd -o ~/.claude/skills/docx/scripts/office/soffice.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/soffice.py -o ~/.claude/skills/docx/scripts/office/validate.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validate.py -o ~/.claude/skills/docx/scripts/office/validators/__init__.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/__init__.py -o ~/.claude/skills/docx/scripts/office/validators/base.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/base.py -o ~/.claude/skills/docx/scripts/office/validators/docx.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/docx.py -o ~/.claude/skills/docx/scripts/office/validators/pptx.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/pptx.py -o ~/.claude/skills/docx/scripts/office/validators/redlining.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/redlining.py -o ~/.claude/skills/docx/scripts/templates/comments.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/comments.xml -o ~/.claude/skills/docx/scripts/templates/commentsExtended.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/commentsExtended.xml -o ~/.claude/skills/docx/scripts/templates/commentsExtensible.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/commentsExtensible.xml -o ~/.claude/skills/docx/scripts/templates/commentsIds.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/commentsIds.xml -o ~/.claude/skills/docx/scripts/templates/people.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/people.xml && chmod +x ~/.claude/skills/docx/scripts/__init__.py ~/.claude/skills/docx/scripts/accept_changes.py ~/.claude/skills/docx/scripts/comment.py ~/.claude/skills/docx/scripts/merge_runs.py ~/.claude/skills/docx/scripts/office/validate.py
curl -fsSL --create-dirs -o ~/.agents/skills/docx/SKILL.md https://anymodel.org/en/skills/anthropic/docx/SKILL.md -o ~/.agents/skills/docx/LICENSE.txt https://anymodel.org/en/skills/anthropic/docx/LICENSE.txt -o ~/.agents/skills/docx/scripts/__init__.py https://anymodel.org/en/skills/anthropic/docx/scripts/__init__.py -o ~/.agents/skills/docx/scripts/accept_changes.py https://anymodel.org/en/skills/anthropic/docx/scripts/accept_changes.py -o ~/.agents/skills/docx/scripts/comment.py https://anymodel.org/en/skills/anthropic/docx/scripts/comment.py -o ~/.agents/skills/docx/scripts/merge_runs.py https://anymodel.org/en/skills/anthropic/docx/scripts/merge_runs.py -o ~/.agents/skills/docx/scripts/office/helpers/__init__.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/helpers/__init__.py -o ~/.agents/skills/docx/scripts/office/helpers/pptx_chart.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/helpers/pptx_chart.py -o ~/.agents/skills/docx/scripts/office/helpers/pptx_slide.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/helpers/pptx_slide.py -o ~/.agents/skills/docx/scripts/office/helpers/pptx_theme.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/helpers/pptx_theme.py -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd -o ~/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd -o ~/.agents/skills/docx/scripts/office/schemas/mce/mc.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/mce/mc.xsd -o ~/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-2010.xsd -o ~/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-2012.xsd -o ~/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-2018.xsd -o ~/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd -o ~/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd -o ~/.agents/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd -o ~/.agents/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd https://anymodel.org/en/skills/anthropic/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd -o ~/.agents/skills/docx/scripts/office/soffice.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/soffice.py -o ~/.agents/skills/docx/scripts/office/validate.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validate.py -o ~/.agents/skills/docx/scripts/office/validators/__init__.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/__init__.py -o ~/.agents/skills/docx/scripts/office/validators/base.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/base.py -o ~/.agents/skills/docx/scripts/office/validators/docx.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/docx.py -o ~/.agents/skills/docx/scripts/office/validators/pptx.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/pptx.py -o ~/.agents/skills/docx/scripts/office/validators/redlining.py https://anymodel.org/en/skills/anthropic/docx/scripts/office/validators/redlining.py -o ~/.agents/skills/docx/scripts/templates/comments.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/comments.xml -o ~/.agents/skills/docx/scripts/templates/commentsExtended.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/commentsExtended.xml -o ~/.agents/skills/docx/scripts/templates/commentsExtensible.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/commentsExtensible.xml -o ~/.agents/skills/docx/scripts/templates/commentsIds.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/commentsIds.xml -o ~/.agents/skills/docx/scripts/templates/people.xml https://anymodel.org/en/skills/anthropic/docx/scripts/templates/people.xml && chmod +x ~/.agents/skills/docx/scripts/__init__.py ~/.agents/skills/docx/scripts/accept_changes.py ~/.agents/skills/docx/scripts/comment.py ~/.agents/skills/docx/scripts/merge_runs.py ~/.agents/skills/docx/scripts/office/validate.py
foreach ($f in 'SKILL.md','LICENSE.txt','scripts/__init__.py','scripts/accept_changes.py','scripts/comment.py','scripts/merge_runs.py','scripts/office/helpers/__init__.py','scripts/office/helpers/pptx_chart.py','scripts/office/helpers/pptx_slide.py','scripts/office/helpers/pptx_theme.py','scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd','scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd','scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd','scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd','scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd','scripts/office/schemas/mce/mc.xsd','scripts/office/schemas/microsoft/wml-2010.xsd','scripts/office/schemas/microsoft/wml-2012.xsd','scripts/office/schemas/microsoft/wml-2018.xsd','scripts/office/schemas/microsoft/wml-cex-2018.xsd','scripts/office/schemas/microsoft/wml-cid-2016.xsd','scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd','scripts/office/schemas/microsoft/wml-symex-2015.xsd','scripts/office/soffice.py','scripts/office/validate.py','scripts/office/validators/__init__.py','scripts/office/validators/base.py','scripts/office/validators/docx.py','scripts/office/validators/pptx.py','scripts/office/validators/redlining.py','scripts/templates/comments.xml','scripts/templates/commentsExtended.xml','scripts/templates/commentsExtensible.xml','scripts/templates/commentsIds.xml','scripts/templates/people.xml') { $p = Join-Path "$HOME\.claude\skills\docx" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/anthropic/docx/$f" -UseBasicParsing -OutFile $p }foreach ($f in 'SKILL.md','LICENSE.txt','scripts/__init__.py','scripts/accept_changes.py','scripts/comment.py','scripts/merge_runs.py','scripts/office/helpers/__init__.py','scripts/office/helpers/pptx_chart.py','scripts/office/helpers/pptx_slide.py','scripts/office/helpers/pptx_theme.py','scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd','scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd','scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd','scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd','scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd','scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd','scripts/office/schemas/mce/mc.xsd','scripts/office/schemas/microsoft/wml-2010.xsd','scripts/office/schemas/microsoft/wml-2012.xsd','scripts/office/schemas/microsoft/wml-2018.xsd','scripts/office/schemas/microsoft/wml-cex-2018.xsd','scripts/office/schemas/microsoft/wml-cid-2016.xsd','scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd','scripts/office/schemas/microsoft/wml-symex-2015.xsd','scripts/office/soffice.py','scripts/office/validate.py','scripts/office/validators/__init__.py','scripts/office/validators/base.py','scripts/office/validators/docx.py','scripts/office/validators/pptx.py','scripts/office/validators/redlining.py','scripts/templates/comments.xml','scripts/templates/commentsExtended.xml','scripts/templates/commentsExtensible.xml','scripts/templates/commentsIds.xml','scripts/templates/people.xml') { $p = Join-Path "$HOME\.agents\skills\docx" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/anthropic/docx/$f" -UseBasicParsing -OutFile $p }Any other agent: save the file into its skills folder, or give it the link to the file: https://anymodel.org/en/skills/anthropic/docx/SKILL.md
SKILL.md
DOCX creation, editing, and analysis
A .docx is a ZIP archive of XML files. Choose your approach by task:
| Task | Approach |
|---|---|
| Create a new document | Write a docx (npm) script — see gotchas below |
| Edit an existing document | unpack → edit word/document.xml → zip (docx-js cannot open existing files) |
| Read content | pandoc -t markdown file.docx |
Script paths below are relative to this skill's directory.
Creating with docx-js — gotchas
docx is preinstalled — do not run npm install first; write the script and require('docx') directly. Only if that require fails: npm install docx. The model knows the API; these are the footguns:
- Page size defaults to A4. For US Letter set
page: { size: { width: 12240, height: 15840 } }(DXA; 1440 = 1″). - Landscape: pass portrait dimensions and
orientation: PageOrientation.LANDSCAPE— docx-js swaps width/height internally. - Tables need dual widths: set
columnWidthson the table ANDwidthon every cell, both inWidthType.DXA(PERCENTAGE breaks in Google Docs). Column widths must sum to the table width. - Table shading: use
ShadingType.CLEAR, neverSOLID(renders black). - Lists: never insert
•literally; use anumberingconfig withLevelFormat.BULLET. ImageRunrequirestype:("png","jpg", …).PageBreakmust be inside aParagraph.- Never use
\n— use separateParagraphelements. - Headings: style every level you use (
title,heading1,heading2…) instyles.default:heading1: { run: { font: "Arial", size: 32, bold: true }, paragraph: { spacing: { before: 240, after: 120 }, keepNext: true } }. Every level needs its own font (even with a document default),beforeandafter(even if 0) andkeepNext: the built-in styles set none of them. - TOC: headings must use built-in
HeadingLevel.*; custom heading styles needoutlineLevelset or they won't appear. - Don't use a table as a horizontal rule — use a paragraph bottom border instead.
- Dot-leader / right-aligned-on-same-line: use
PositionalTab(alignment: PositionalTabAlignment.RIGHT,leader: PositionalTabLeader.DOT) inside aTextRun, not literal.or space padding.
Verify the output
After writing a .docx, render it and look at it:
zip -d output.docx '*/' >/dev/null || true # drop the ZIP's folder entries: Word has refused a file that has them when opened through a cloud co-editing service
python scripts/office/soffice.py --headless --convert-to pdf output.docx
pdftoppm -jpeg -r 100 output.pdf page
ls page-*.jpg # then Read the images
pdftoppm zero-pads page numbers to the width of the page count (page-01.jpg…page-12.jpg).
Editing existing documents
Legacy .doc files must be converted first: python scripts/office/soffice.py --headless --convert-to docx file.doc.
python3 -c "import sys,zipfile; zipfile.ZipFile(sys.argv[1]).extractall('unpacked')" doc.docx # not unzip, which restores symlinks — docx from external parties is untrusted
python scripts/merge_runs.py unpacked/ # coalesce fragmented runs so text is findable
# edit unpacked/word/document.xml in place — do NOT reformat or pretty-print
(cd unpacked && rm -f ../out.docx && zip -XrDy ../out.docx .)
python scripts/office/validate.py out.docx --original doc.docx # XSD checks; --auto-repair fixes common issues
# redlining? add --author "<the name you redlined under>" to check every edit is tracked
Word splits text across many <w:r> runs (revision ids, spell-check markers), so a phrase you can see in the document often doesn't exist as a contiguous string in the XML. merge_runs.py merges adjacent identically-formatted runs in word/document.xml without changing content or rendering; it also accepts a .docx directly (python scripts/merge_runs.py doc.docx -o merged.docx).
Tracked changes: when redlining, validate with --author "<the name you redlined under>" (needs --original) — it reports any text you changed without a <w:ins>/<w:del> around it, which is easy to do by accident and invisible in the accepted view. Wrap runs in <w:ins>/<w:del> with w:id, w:author, w:date attributes. Inside <w:del>, the text element is <w:delText>, not <w:t>. A deleted paragraph mark (<w:pPr><w:rPr><w:del w:id=".." w:author=".." w:date=".."/></w:rPr></w:pPr>) means "merge this paragraph into the next" — so deleting a paragraph outright is that plus a <w:del> around every run. The <w:del/> must come before the rPr's other children; their order is schema-enforced.
To produce a clean copy with all tracked changes accepted: python scripts/accept_changes.py in.docx out.docx.
Accepting a deleted paragraph mark should join that paragraph to the one below it, so a paragraph whose runs are all deleted vanishes. Word does this; accept_changes.py and pandoc --track-changes=accept don't always. Both fail the same way — they strip the deleted text but leave the emptied paragraph behind, which reads as a stray empty bullet when it was auto-numbered:
pandoc --track-changes=acceptnever joins the paragraphs.accept_changes.py(LibreOffice) joins them correctly, except when the deleted paragraph is followed by an empty spacer paragraph.
An empty bullet in either view is an artifact of that view, not a defect in the document. Check paragraph deletions in the XML.
Comments
Comments require six cross-linked files. Use the helper — directory mode when you'll also be editing document.xml (saves an unzip/rezip cycle), .docx-direct mode otherwise:
# Against an already-unpacked directory (preferred when also placing markers)
python scripts/comment.py unpacked/ "Fees & expenses cap is too low"
python scripts/comment.py unpacked/ "Agreed" --parent 0
# Against a .docx directly
python scripts/comment.py contract.docx "This cap is too low" -o annotated.docx
The script writes comments.xml, commentsExtended.xml, commentsIds.xml, commentsExtensible.xml, the relationships, and the content-type overrides. Comment IDs are auto-assigned. It then prints the <w:commentRangeStart>/<w:commentRangeEnd>/<w:commentReference> snippet to add to word/document.xml so the comment anchors to specific text — until you place those markers, the comment exists but is not visible.
Dependencies
docx (npm, preinstalled — install only if require('docx') fails) · pandoc · LibreOffice (soffice) · pdftoppm (Poppler)
Connect through AnyModel API
This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.
AnyModel