The docx skill: Word documents an agent can draft and redline
Under the hood a .docx is a ZIP of XML files, and careless edits break the layout. The docx skill splits the work by task: new documents come from a script on the docx npm package, existing ones are unpacked and edited in word/document.xml, and every result is rendered to page images so it can be checked by eye.
Builds new documents with docx-js while dodging its traps: A4 by default, dual table widths in DXA, ShadingType.CLEAR instead of SOLID.
Edits an existing file in place: unzips it, merges fragmented runs with merge_runs.py so phrases become findable, then rezips.
Redlines with w:ins and w:del, and validate.py --author flags any text you changed outside a tracked revision.
Adds comments and threaded replies through comment.py, which writes all six cross-linked comment parts for you.
Renders the output to PDF with LibreOffice and to JPEG pages with pdftoppm, then reviews the images.
When to use it
Counsel sent back a contract and every one of your edits has to show up as a tracked change under your name.
You need a memo or report in Word with a table of contents, page numbers and tables that also open cleanly in Google Docs.
An old .doc file must become a .docx before you swap out letterhead details or images.
Ask your agent
Redline contract.docx with the changes from this email, tracked under the author name Legal
Make a Word report on US Letter with a table of contents, page numbers and a budget table
Add a comment to the penalty clause in offer.docx saying the cap is too low
Questions
How do I add the docx skill to my agent?
Run npx skills add anthropics/skills@docx. In Claude Code it also ships in the document-skills plugin from the anthropics/skills marketplace.
Can the docx skill open legacy .doc files?
Yes, after conversion: it runs scripts/office/soffice.py with --convert-to docx through LibreOffice before editing.
How does the docx skill produce a clean copy after redlining?
scripts/accept_changes.py accepts every tracked change and writes a clean file. A stray empty bullet in that copy is an artefact of the view, so the skill says to check paragraph deletions in the XML.