Skip to main content
skill CX Codex

docx · appautomaton — Claude Code skill for Word docs with redlines

A skill for .docx work: builds documents, makes tracked edits, reads comments and footnotes. Useful when an agent touches someone else's contract or report.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add appautomaton/document-SKILLs --skill docx -a claude-code
Open on GitHub

What docx does

The skill covers what you can't see from the code: a library that produces correct tracked changes and comments, schema validation that catches untracked edits, and page rendering so you can look at the document the way a reader will. It also documents docx-js and OOXML behaviours that quietly break a file.

The workflow runs in steps. Read the document with pandoc --track-changes=all file.docx -t markdown, unpack it with unpack.py, edit through a script built on the Document library, then repack with pack.py. doc.save() refuses to write a file with untracked edits or broken schema and prints the differences — fix the script instead of skipping validation. Existing changes go through doc.accept_all_changes() or doc.reject_all_changes().

Rendering pages needs LibreOffice (soffice) and poppler (pdftoppm); reading needs pandoc. Node scripts run as NODE_PATH=<skill>/node_modules node build.js, and if that folder is missing you run npm install in the skill directory once. One trap worth knowing: pandoc is fine for reading, never for the deliverable, because it rewrites the whole document and drops formatting, comments and tracked changes.

What it helps with

  • build a .docx from a template and data
  • redline someone else's contract
  • pull comments and footnotes out of a finished file
  • accept or reject changes another author left
  • confirm every edit is marked as a tracked change

Example prompts for the agent

  • read contract.docx and list all tracked changes and comments
  • redline this contract with tracked changes
  • repack the unpacked folder into reviewed.docx and validate it

How to install docx

1Skills CLI (Vercel)

npx skills add appautomaton/document-SKILLs --skill docx -a claude-code

2Manually: put the files in place

~/.claude/skills/docx/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/docx/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about docx

How do I install docx in Claude?

Run npx skills add appautomaton/document-SKILLs --skill docx -a claude-code. The skill lands in ~/.claude/skills/docx/SKILL.md.

What does the docx skill do?

It creates and edits Word documents and reads their text, comments and tracked changes. It also validates that every edit is tracked and renders pages to PNG.

What does the docx skill need to run?

Page rendering needs LibreOffice (soffice) and poppler (pdftoppm); reading needs pandoc. Node scripts expect NODE_PATH=<skill>/node_modules.

Source text

SKILL.md · MIT
---
name: docx
description: Create, edit, review, and read Word documents (.docx), including tracked changes (redlines), comments, footnotes, tables, images, headers and page setup. Use when a task produces or modifies a .docx, reviews or redlines one, or needs its text, comments or tracked changes read.
---

# Word documents

You already know Word's features. This skill adds what you can't see from the code: a library that makes tracked changes and comments correctly, validation that catches untracked edits, a way to see pages as a reader will, and the docx-js and OOXML behaviours that silently produce broken files.

## Running scripts

`<skill>` is the directory containing this file. Run bundled scripts by absolute path from the user's working directory, so relative paths to their files keep working:

```bash
uv run <skill>/ooxml/scripts/unpack.py contract.docx unpacked
```

Run Python you write with its dependencies declared, either `uv run --with defusedxml script.py` or a PEP 723 header. Run Node scripts as `NODE_PATH=<skill>/node_modules node build.js`; if `<skill>/node_modules` is missing, run `npm install` in `<skill>` once. Rendering pages needs LibreOffice (`soffice`) and poppler (`pdftoppm`); reading needs pandoc.

## Choosing a workflow

| Task | Use |
|---|---|
| Read the text | `pandoc --track-changes=all file.docx -t markdown`. It also shows tracked changes and comments. Use `accept` or `reject` instead of `all` to see either outcome. |
| Create a document | docx-js: read [docx-js.md](docx-js.md) first. It covers the page size, style and image behaviours that otherwise break the file. |
| Edit someone else's document, or anything legal, academic, business or official | Tracked changes, so every edit is reviewable: the redlining workflow below. |
| Small edits to a document you created in this session | The same library, untracked. Make the edits, then call `doc.save(require_tracking=False)`, which still checks the schema. For larger changes, regenerate the file with docx-js. |
| Comments, metadata, embedded media, raw structure | Unpack and read the XML; [ooxml.md](ooxml.md) has the patterns. |

## Redlining workflow

1. **Read.** Convert the document with pandoc (above) and list every change you will make. Locate each one by its surrounding text, never by markdown line numbers, which have no relation to the XML.
2. **Unpack.** `uv run <skill>/ooxml/scripts/unpack.py contract.docx unpacked` prints a suggested RSID. Pass it as `Document(..., rsid=...)` so the session's edits share one revision ID.
3. **Edit.** Read [ooxml.md](ooxml.md), then write a script that uses the `Document` library. `tracked_replace(old, new)` handles most edits: it finds text across runs and marks only the words that differ. Work in batches of related changes, a few to a dozen per script, so a failure is easy to locate. Grep `unpacked/word/document.xml` again before each batch, because line numbers move after every save.
4. **Save.** `doc.save()` refuses to write a document with untracked edits, or with XML that breaks the schema, and prints what differs. Fix the script rather than skipping validation.
5. **Pack.** `uv run <skill>/ooxml/scripts/pack.py unpacked reviewed.docx` repacks the file and checks that LibreOffice can open it.
6. **Verify.** Run `pandoc --track-changes=all reviewed.docx -t markdown` and confirm every intended change appears and nothing else changed. Then check the output (below).

To accept or reject existing changes, call `doc.accept_all_changes()` or `doc.reject_all_changes()` before making edits of your own.

## Checking the output

1. **Validate.** `uv run <skill>/ooxml/scripts/validate.py reviewed.docx --original contract.docx` checks the schema, and that every change from the original is tracked; `doc.save()` runs the same checks. Pass `--author NAME` to let that author's earlier insertions be edited directly. For a document generated from scratch, leave out `--original` to check the schema alone.
2. **Look.** `uv run <skill>/ooxml/scripts/render.py reviewed.docx pages` prints one PNG path per page (`--pages 2-4` for a range). Read them before delivering a document you created or restructured. LibreOffice renders a docx-js table of contents empty; Word fills it in when it opens the file.

## Pitfalls that fail silently

- **Partial edits inside other authors' changes.** To remove text inside someone else's insertion, nest your `<w:del>` inside it. Never edit their text directly.
- **pandoc as an editor.** It rewrites the whole document and drops formatting, comments and tracked changes. Use it to read, never to produce the deliverable.

© appautomaton · MIT · appautomaton/document-SKILLs

Similar skills

Everything for Office documents →

docx by other authors comes first.

docx official anthropics This skill creates, reads, and edits Word documents and templates. Use it for reports, letters, and files that need headings, tables, or page numbers. 206,304installs docx nexu-io Create, edit, and analyze Word documents with tracked changes, comments, and formatting. Use it for design briefs, copy docs, and materials ready for review. CX Codex +1 3,000installs docx Nous Research A skill for creating, reading, editing, and templating Word .docx files via Python CLI scripts. Helpful when automating reports, comments, and tracked changes. CX Codex +1 306installs kimi-docx thvroyal Generates and edits Word documents (.docx) using C# and direct XML manipulation in Python. Useful for creating formatted reports with covers, charts, and track changes. CX Codex +1 506installs word-document-processor qodex-ai A skill for .docx work: extract text, build documents from scratch, and edit existing files with tracked changes. Useful when the agent has to touch someone else's contract. CX Codex +1 3,600installs docx-manipulation claude-office-skills The skill builds and edits Word files through python-docx: headings, tables, images, headers. Useful when a report or contract has to come out of code. CX Codex +1 6,100installs docx-generator agent-skills Generates and edits Word documents: fills branded templates with data or builds a DOCX from a JSON spec. CX Codex +1 734installs minimax-docx MiniMaxAI A skill for generating, filling and formatting Word documents with OpenXML SDK. Use it when the agent must deliver a .docx, not plain text. CX Codex +1 4,500installs file-conversion Seth Hobson Converts local media, documents, and data formats using tools already installed on your machine. Prevents uploading files to third-party APIs. CX Codex 3,100installs

From the same set3

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor