Skip to content
Agentmart
Submit a tool

docx

Edit, revise, and redline Word documents with tracked changes, comments, and validation.

Skill by peterchang77

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/peterchang77-docx

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Edit, revise, and redline Word documents with tracked changes, comments, and validation.

Use cases: documents, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/docx

What's inside

Skill name
docx
Description
Edit, revise, and redline Word documents with tracked changes, comments, and validation.
License
MIT
Instructions
70 lines in SKILL.md · view on GitHub

Files (4)

  • SKILL.md
  • comments.md · references/
  • xml-and-validation.md · references/
  • skill.json

SKILL.md (first lines)

# Word documents

Use the `docx` CLI. Verify the command before editing:

```bash
command -v docx
docx --help
```

## Installation

If `docx` is unavailable, install the immutable `v0.1.1` release. This requires `uv`, network access, and Python 3.12 or later:

```bash
uv tool install 'git+https://github.com/peterchang77/agent-docx@v0.1.1'
command -v docx
docx --help
```

To replace an existing installation with that release, add `--force`. Do not rely on a checkout at a machine-specific path. `docx accept-changes` additionally requires LibreOffice (`soffice`) on `PATH`.

Use `Peter` as the tracked-change and comment author unless the user requests another name. Do not use em dashes in inserted or edited text. Write comments as direct statements or questions without labels such as `TODO:` or `Note:`.

## Workflow

1. Preserve the original and unpack into a new, empty working directory:

   ```bash
   docx unpack document.docx unpacked/
   ```

   Read `unpacked/word/document.xml` directly. It is the ground truth for content, formatting, fields, and tracked changes. Unpacking defaults to merging runs and simplifying adjacent redlines. Use `--merge-runs false --simplify-redlines false` when original run boundaries or redline boundaries matter.

2. Edit with `docx edit` whenever possible:

   ```bash
   docx edit unpacked/ --find "old text" --replace "new text"
   docx edit unpacked/ --find "text" --mode delete
   docx edit unpacked/ --find "anchor" --replace " added" --mode insert
   ```

   Use `--paragraph N` for ambiguous matches, and `--author NAME` or `--date ISO_TIMESTAMP` when needed. Use `--allow-field-edit` only when deliberately editing a Word field. For comments, follow [the comment workflow](references/comments.md).

3. For structural changes, edit `unpacked/word/document.xml` directly. Replace complete `<w:r>...</w:r>` blocks, preserve each run's `<w:rPr>`, make matches unique, and recheck the surrounding XML after every edit. Preserve field markers (`w:fldChar`, `w:fldData`, and `w:instrText`) exactly. Use XML entities for quotes and apostrophes. See [XML and validation details](references/xml-and-validation.md).

4. Validate before packing:

   ```bash
   docx pack unpacked/ --check --diff --original document.docx
   docx validate unpacked/ --original document.docx
   docx find-artifacts unpacked/ --verbose
   ```

   `validate` without `--original` performs schema validation but skips redlining comparison. Review artifacts before using `find-artifacts --fix`, then validate again. `pack --check` is the dry-run validation path; `pack --diff` checks untracked text and field structure.

5. Pack the result:

   ```bash
   docx pack unpacked/ output.docx --original document.docx
   ```

   Keep `--validate` enabled unless explicitly appropriate. Accept all tracked changes only when requested and after review:

   ```bash
   docx accept-changes tracked.docx clean.docx
   ```

   Validate the final output when practical. Run `docx <subcommand> --help` for options not shown here.

From peterchang77/agent-ai-skills, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Sep 3, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from peterchang77

Cite this page

docx skill. Agent Mart. https://agentmart.dev/skills/peterchang77-docx (last updated 2026-10-24)