# word-document-processor

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3600 installs · ★ 46
- Author: qodex-ai
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qodex-ai/ai-agent-skills/tree/HEAD/skills/word-document-processor/SKILL.md
- Updated: 2026-01-05
- HTML: https://affpapa.org/en/nevibecode/skills/word-document-processor

## What it does

The skill covers three jobs: read a .docx, create a new one, and edit an existing one. For reading, text goes out to markdown through pandoc with `--track-changes=all`, so insertions and deletions stay visible. Comments, embedded images and metadata need raw XML instead: unpack with `python ooxml/scripts/unpack.py <office_file> <output_directory>` and read the parts directly. Main content sits in `word/document.xml`, comments in `word/comments.xml`, media in `word/media/`, and tracked changes use `<w:ins>` and `<w:del>` tags.

New documents are built with docx-js. You write a JavaScript or TypeScript file out of Document, Paragraph and TextRun components, then export through `Packer.toBuffer()`. Editing goes through the Python Document library, which handles the unpack and pack steps and still lets you reach the DOM when a case gets messy. Either way the skill insists you read `docx-js.md` or `ooxml.md` in full first.

Reviewing someone else's document is its own path. Changes get planned in markdown, then applied to OOXML in batches of 3–10, with each batch tested before the next one starts. Only the text that actually changes gets marked; unchanged runs keep their original RSID, because a redline full of untouched words is painful to review. For legal, academic, business and government documents this path is required. Install runs through `npx skills add`, and the license is proprietary.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill word-document-processor -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/word-document-processor/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/word-document-processor/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill word-document-processor -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/word-document-processor/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill word-document-processor -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/word-document-processor/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install qodex-ai/ai-agent-skills word-document-processor
```

2. **Manually: put the files in place**
- File: `.github/skills/word-document-processor/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill word-document-processor -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/qodex-ai/ai-agent-skills --path skills/word-document-processor
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/word-document-processor/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill word-document-processor -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qodex-ai/ai-agent-skills/tree/HEAD/skills/word-document-processor/SKILL.md

## When to use it
- pull text out of a .docx into markdown
- generate a new document from JavaScript
- redline a contract with tracked changes
- extract comments and images from the XML
- split a review into testable batches

## Example prompts
- read this .docx and show me the tracked changes
- create a document with a heading and a table using docx-js
- edit section 3.2 and leave the changes as tracked changes

## Similar
- [docx](https://affpapa.org/en/nevibecode/skills/appautomaton-docx.md) — skill · 1300 installs
- [word-document](https://affpapa.org/en/nevibecode/skills/word-document.md) — skill · 790 installs
- [document-processing](https://affpapa.org/en/nevibecode/skills/document-processing.md) — skill · 1300 installs
- [translate-book](https://affpapa.org/en/nevibecode/skills/translate-book.md) — skill · 1800 installs
- [latex-document-skill](https://affpapa.org/en/nevibecode/skills/latex-document-skill.md) — skill · 561 installs
- [doc-to-markdown](https://affpapa.org/en/nevibecode/skills/doc-to-markdown.md) — skill · 872 installs

From the same set: [qodex-ai/ai-agent-skills](https://affpapa.org/en/nevibecode/by/qodex-ai/ai-agent-skills.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
