Agent skill

Word DOCX Toolkit

by NousResearch in NousResearch/hermes-agent

Creates, reads, edits and templates Word .docx files with python-docx scripts, including tracked changes, comments, tables of contents and health checks.

MITAuto-check passedDocuments & Office

Install Word DOCX Toolkit

skills CLI
$ npx skills add NousResearch/hermes-agent --skill docx -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NousResearch/hermes-agent docx --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NousResearch/hermes-agent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/productivity/docx .claude/skills/docx && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docx
GitHub stars
252k
Token cost
~2.6k tokens
SKILL.md length
1,246 words
Files
12 (incl. scripts, references)
Skills in repo
32
Repo updated
First seen
Licence
MIT

At a glance

Creates, reads, edits and templates Word .docx files with python-docx scripts, including tracked changes, comments, tables of contents and health checks.

  • Works in 7 steps: Create. Write a JSON spec with… → Read. Use scripts/docx_read.py with… → Edit. Use scripts/docx_edit.py. replace… → …
  • Generating a Word report, letter or contract from structured content
  • SKILL.md covers When to Use, Prerequisites, How to Run and Quick Reference, plus 4 more sections
  • Runs Python scripts from its folder; calls python, soffice and pip

What it does

The skill ships small command-line helpers in `scripts/` built on python-docx; each supports `--help` and prints JSON. `docx_create.py` builds a document from a JSON spec, `docx_read.py` returns the text, heading outline, styles in use, embedded images or detected revisions, and `docx_edit.py` replaces text with formatting kept and sets table cells. Further scripts cover templating, comments, revisions and validation.

Documents can include text, styles, lists, tables, images, headers and footers, double-brace token placeholders filled from data, tracked changes (list, accept, reject), comments (list, add, delete) and table-of-contents and page-number fields. It does not render anything, so PDF export needs LibreOffice, and it does not edit legacy `.doc` or `.odt` files or do WYSIWYG layout. It needs Python 3.10 or newer with python-docx installed, and image blocks need PNG or JPEG files on disk.

When your agent uses it

  • Generating a Word report, letter or contract from structured content
  • Filling a .docx template that contains token placeholders from data
  • Reviewing tracked changes and comments in a document
  • Diagnosing a .docx that will not open or behaves oddly

Example prompts

  • “Create a two-page project status report as report.docx with a table of milestones.”
  • “Fill offer-letter-template.docx with the details in candidate.json.”
  • “List every tracked change in contract-v3.docx and accept the ones from the legal reviewer.”
  • “Add a table of contents and Page X of Y footers to thesis.docx.”

Requirements

  • Python 3.10 or newer with `python-docx` installed
  • LibreOffice, only for converting to PDF

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Create. Write a JSON spec with write_file, then run
  2. Read. Use scripts/docx_read.py with exactly one mode flag.
  3. Edit. Use scripts/docx_edit.py. replace walks body, tables
  4. Review revisions. docx_revisions.py list reports every w:ins
  5. Comments. docx_comments.py list returns each comment's id,
  6. Template. Put {{name}}-style tokens in the document. Run
  7. Verify (always): re-read the output with --text or

What it can do on your machine

Read from SKILL.md and the folder at commit 2966cb6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 8 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • soffice
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Word DOCX Toolkit loads about 2.6k tokens when it runs, and up to ~3.6k if it reads all its reference files. Until then it costs about 16 tokens; SKILL.md has 1,246 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~16
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from NousResearch/hermes-agent at commit 2966cb6, republished under its MIT licence (© NousResearch). 1,246 words, ~2,595 tokens.

Download SKILL.mdSave it as .claude/skills/docx/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
docx
description
Create, read, edit, template, and review Word .docx files.
version
1.1.0
author
Nous Research
license
MIT
platforms
linux, macos, windows

Docx Skill

Create, read, edit, and template Microsoft Word .docx files with python-docx via small CLIs. It handles text, styles, lists, tables, images, headers/footers, {{token}} templating, tracked changes (list/accept/reject), comments (list/add/delete), TOC and page-number fields, and package health checks. It does not render documents itself (PDF needs LibreOffice — see Converting to PDF) or edit legacy .doc.

When to Use

  • The user asks to generate a Word document (report, letter, contract).
  • You need the text, outline, styles, or embedded images of a .docx.
  • You must change an existing .docx: replace text, edit table cells, insert/delete paragraphs, apply styles, merge fragmented runs.
  • You have a .docx template with {{placeholders}} to fill from data.
  • The document has tracked changes to review, accept, or reject.
  • You need to read reviewers' comments, or add/delete comments.
  • A .docx won't open or behaves oddly and you need corruption triage.
  • The document needs a table of contents or "Page X of Y" footers.
  • Not for: .doc (legacy), .odt, or WYSIWYG layout work.

Prerequisites

  • Python 3.10+ with python-docx installed: pip install python-docx (import name is docx; lxml comes with it).
  • Comments add uses the native API on python-docx >= 1.2 and an XML fallback on older versions — both are automatic.
  • For image blocks: the image files must exist locally (PNG/JPEG).

How to Run

All helpers live in scripts/ next to this file. Run them with the terminal tool; each supports --help and prints JSON to stdout.

bash
python scripts/docx_create.py spec.json out.docx
python scripts/docx_read.py out.docx --text
python scripts/docx_edit.py replace out.docx --find old --replace new
python scripts/docx_template.py tpl.docx values.json filled.docx
python scripts/docx_revisions.py list out.docx
python scripts/docx_comments.py list out.docx
python scripts/docx_validate.py out.docx

Quick Reference

TaskCommand
Create from JSON specdocx_create.py spec.json out.docx
Full text (body+tables+headers/footers)docx_read.py f.docx --text
Heading outline + table shapesdocx_read.py f.docx --structure
Styles actually useddocx_read.py f.docx --styles
Extract embedded imagesdocx_read.py f.docx --images outdir/
Detect tracked changes/commentsdocx_read.py f.docx --revisions
Find/replace (formatting kept)docx_edit.py replace f.docx --find A --replace B -o out.docx
Set a table celldocx_edit.py set-cell f.docx --table 0 --row 1 --col 2 --text X
Insert paragraph before index Ndocx_edit.py insert f.docx --index N --text X --style Normal
Delete paragraph Ndocx_edit.py delete f.docx --index N
Apply style to paragraph Ndocx_edit.py style f.docx --index N --style "Heading 1"
Merge equal-format adjacent runsdocx_edit.py normalize f.docx -o out.docx
Insert TOC field before para Ndocx_edit.py toc f.docx --index N -o out.docx
"Page X of Y" footer fieldsdocx_edit.py page-numbers f.docx
Fill {{tokens}}docx_template.py tpl.docx values.json out.docx --strict
List revisions (id/author/date/text)docx_revisions.py list f.docx
Accept / reject all revisionsdocx_revisions.py accept-all f.docx -o out.docx (or reject-all)
Accept / reject one revisiondocx_revisions.py accept f.docx --id 3 -o out.docx
List comments (+anchored text)docx_comments.py list f.docx
Add comment anchored to textdocx_comments.py add f.docx --target "phrase" --text "note" --author You
Delete comment by iddocx_comments.py delete f.docx --id 0
Health-check the packagedocx_validate.py f.docx (exit 1 on errors)

Procedure

  1. Create. Write a JSON spec with write_file, then run scripts/docx_create.py. The spec supports: page (size + margins in mm), header/footer strings, footer_page_numbers (adds a "Page X of Y" field footer), styles (custom paragraph styles with font, size, bold/italic, hex color), and blocks — heading (level 1-9), paragraph (either text or a runs list where each run may set bold/italic/underline), bullet_list, numbered_list, table (header row rendered bold, rows, optional built-in table style such as Table Grid), image (path, optional width_mm), toc (Table of Contents field), and page_break. The full spec format is documented at the top of scripts/docx_create.py.
  2. Read. Use scripts/docx_read.py with exactly one mode flag. --text returns body paragraphs, all table cell text, and header/footer text as JSON. --structure returns the heading outline plus paragraph/table/section counts. --images DIR copies every file under word/media/ out of the package.
  3. Edit. Use scripts/docx_edit.py. replace walks body, tables (nested included), headers and footers, and preserves run formatting; add --body-only to skip headers/footers. Pass -o out.docx to keep the original; omit it to edit in place. Paragraph indices for insert/delete/style/toc refer to --structure/--text body order. Run normalize first on documents that came out of heavy Word editing — it merges adjacent runs with identical formatting so later find-replace matches reliably.
  4. Review revisions. docx_revisions.py list reports every w:ins and w:del (id, author, date, affected text) anywhere in body, tables, headers, or footers. accept-all / reject-all resolve them in bulk; accept/reject --id N handles a single revision. Accept keeps insertions and drops deleted text; reject does the reverse.
  5. Comments. docx_comments.py list returns each comment's id, author, date, body text, and the document text it is anchored to. add --target "some phrase" anchors a new comment to the first occurrence of that phrase (runs are split as needed; formatting is preserved). delete --id N removes the comment and its markers without touching document text.
  6. Template. Put {{name}}-style tokens in the document. Run scripts/docx_template.py with a JSON object of values. Use --strict to fail when tokens remain unfilled; the JSON output lists filled counts and unfilled_tokens either way.
  7. Verify (always): re-read the output with --text or --structure, and run docx_validate.py on anything you produced via revision/comment surgery.
Show full SKILL.md (438 more words)Show less

Converting to PDF

No script needed. When LibreOffice is installed, convert headlessly:

bash
soffice --headless --convert-to pdf --outdir outdir/ file.docx

Check availability first (command -v soffice || command -v libreoffice). If neither exists, tell the user PDF conversion is unavailable in this environment rather than improvising — python-docx cannot render PDFs, and layout fidelity requires a real renderer.

Pitfalls

  • Tokens split across runs. Word often fragments text into several runs. The replace helpers collapse matched runs (replacement inherits the first run's formatting); running docx_edit.py normalize first reduces fragmentation for all later edits.
  • Revision coverage. docx_revisions.py resolves run-level insertions and deletions (the overwhelming majority). Paragraph-mark and table-row revisions, format-change records, and moves are detected by --revisions but not auto-resolved — see references/revisions-and-comments.md and hand those to Word.
  • Comment threading. Replies and "resolved" status live in commentsExtended.xml, which this skill ignores; comments it adds are plain top-level comments.
  • Field results are computed by Word. toc, page-numbers, and the toc/footer_page_numbers spec options write field codes. Word/LibreOffice populates the actual entries and numbers when the file is opened (Word may prompt to update fields); python-docx never computes them, so placeholder text shows until then.
  • Validation is a health check, not schema validation. docx_validate.py verifies the zip, required parts, relationship targets, image magic bytes, and referenced styles. It is NOT XSD validation — a file can pass and still contain XML Word dislikes.
  • Style names must exist. Applying a style that isn't defined in the document raises KeyError. Built-ins like Heading 1, List Bullet, List Number, Table Grid exist in the default template; custom styles must be declared in the create spec first.
  • Numbered lists restart. List Number relies on Word's default numbering; separate lists in one document may continue numbering instead of restarting. Warn users needing precise multi-list numbering.
  • Cell writes replace formatting. set-cell uses cell.text = ..., which resets runs in that cell to plain formatting.
  • Encoding. All JSON specs/values files are read as UTF-8 explicitly; never rely on locale defaults when writing your own glue code.
  • Don't unzip-and-sed the XML. Edit through the scripts (or python-docx); raw text substitution in document.xml corrupts files easily. Use patch/write_file only for the JSON inputs, never on the .docx itself.

Verification

  • After create/edit/template, run docx_read.py out.docx --text and check the expected strings appear (and old strings are gone).
  • After accept/reject, docx_revisions.py list should return [] (or only the ids you intentionally left); after comment surgery, docx_comments.py list should reflect the change and --text output must be unchanged.
  • docx_validate.py out.docx exits 0 with "ok": true on a healthy package — run it after any revision/comment/field manipulation.
  • For templates run with --strict, or check unfilled_tokens == [].
  • Structure checks: --structure should show the expected heading outline and table shapes; --styles confirms custom styles applied.

© NousResearch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (scripts, references) in skills/productivity/docx of NousResearch/hermes-agent.

  • SKILL.md
  • LICENSE
  • references/revisions-and-comments.md
  • scripts/docx_comments.py
  • scripts/docx_common.py
  • scripts/docx_create.py
  • scripts/docx_edit.py
  • scripts/docx_read.py
  • scripts/docx_revisions.py
  • scripts/docx_template.py
  • scripts/docx_validate.py
  • tests/test_docx_skill.py

Open the folder on GitHubat commit 2966cb6

Compare with similar skills

Word DOCX Toolkit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Word DOCX Toolkit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Word DOCX Toolkit this skillNousResearch/hermes-agent252k—~2.6kAutomated safety check: PassMIT
DOCX ToolkitXiaomiMiMo/MiMo-Code14k—~2.4kAutomated safety check: PassApache-2.0
DOCXnexus-research-lab/nexus150—~484Automated safety check: PassApache-2.0
DocsAFK-surf/OpenBridge430—~1.2kAutomated safety check: PassMIT
DOCX Creation and Editinganthropics/skills180k6 repos~1.7kAutomated safety check: PassProprietary
Office DOCXsingula-ai/alego1091 repos~1.5kAutomated safety check: PassMIT

Similar skills

  • DOCX Toolkit

    XiaomiMiMo/MiMo-Code

    Produces, edits and reads Microsoft Word files through python-docx and lxml, with a decision table for picking the lightest workflow for a given task.

    14k GitHub stars~2.4k tokensUpdated 5 days ago
    Documents & OfficeAuto-check passed
  • DOCX

    nexus-research-lab/nexus

    只要 Word 文档或模板(.docx、.dotx、旧版 .doc)是任务的输入或输出,或者需要被打开、 读取、创建、修改,就使用本 Skill。也适用于 Word 内的表格、图片、批注、修订和格式调整, 以及要求以 Word 交付的报告、备忘录、信函和模板。不用于 PDF、电子表格或不涉及 Word 文件的普通写作。

    150 GitHub stars~484 tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Docs

    AFK-surf/OpenBridge

    Read, create, and review DOCXs guidance

    430 GitHub stars~1.2k tokensUpdated 4 mo ago
    Documents & OfficeAuto-check passed
  • DOCX Creation and Editing

    anthropics/skills

    Official

    Creates, edits and reviews Word documents: new files with docx-js, edits through the underlying XML, plus tracked changes, comments and conversions.

    180k GitHub starsUsed in 6 repos~1.7k tokens
    Documents & OfficeAuto-check passed
  • Office DOCX

    singula-ai/alego

    Create, read, edit, and check Word documents (.docx), including reports, letters, and formatted tables.

    109 GitHub starsUsed in 1 repo~1.5k tokens
    Documents & OfficeAuto-check passed
  • Reads, creates and edits Word .docx files with python-docx, and drops to raw OOXML for tracked changes, comments and byte-exact edits.

    41k GitHub stars~2.5k tokensUpdated today
    Documents & OfficeAuto-check passed

More from NousResearch/hermes-agent

All 32 skills in this repo
  • Google Workspace

    NousResearch/hermes-agent

    Gmail, Calendar, Drive, Docs, Sheets via gws CLI or Python. An agent skill from NousResearch/hermes-agent.

    252k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check passed
  • AI Presenter Video

    NousResearch/hermes-agent

    Produces a presenter-led video from a topic or script plus one authorized presenter image, with captions, lip-sync checks and acceptance reports.

    252k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Grounded Citations

    NousResearch/hermes-agent

    Attaches a numbered, URL-backed citation to every outside fact in an answer or document, rejecting quotes that aren't real.

    252k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • PDF

    NousResearch/hermes-agent

    PDF files: create, read, merge, fill, OCR, edit text. An agent skill from NousResearch/hermes-agent.

    252k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Scrollcraft

    NousResearch/hermes-agent

    Premium scroll-driven landing pages; scroll = timeline. An agent skill from NousResearch/hermes-agent.

    252k GitHub stars~3k tokensUpdated today
    Auto-check passed
  • XLSX

    NousResearch/hermes-agent

    Create, read, edit Excel .xlsx workbooks and CSVs. An agent skill from NousResearch/hermes-agent.

    252k GitHub stars~2.4k tokensUpdated today
    Auto-check passed

Questions about Word DOCX Toolkit

What does Word DOCX Toolkit do?

Creates, reads, edits and templates Word .docx files with python-docx scripts, including tracked changes, comments, tables of contents and health checks. The skill ships small command-line helpers in `scripts/` built on python-docx; each supports `--help` and prints JSON.py` replaces text with formatting kept and sets table cells.

When should I use Word DOCX Toolkit?

Word DOCX Toolkit fits situations like: generating a Word report, letter or contract from structured content; filling a .docx template that contains token placeholders from data; reviewing tracked changes and comments in a document; diagnosing a .docx that will not open or behaves oddly.

How do I install Word DOCX Toolkit in Claude Code?

Run `npx skills add NousResearch/hermes-agent --skill docx -a claude-code`. Or copy the skill folder (skills/productivity/docx in NousResearch/hermes-agent) into .claude/skills/docx in your project. Claude Code loads it when a task matches its description.

How do I install Word DOCX Toolkit in Codex?

Run `npx skills add NousResearch/hermes-agent --skill docx -a codex`. Or copy the skill folder (skills/productivity/docx in NousResearch/hermes-agent) into .agents/skills/docx in your project. Codex loads it when a task matches its description.

Can I use Word DOCX Toolkit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NousResearch/hermes-agent --skill docx -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docx, .gemini/skills/docx, .github/skills/docx and .opencode/skills/docx in your project.

What does Word DOCX Toolkit need to run?

Going by SKILL.md and its folder, Word DOCX Toolkit needs Python for the scripts in its folder and the command-line tools its instructions call (python, soffice and pip). Our summary lists: Python 3.10 or newer with `python-docx` installed; LibreOffice, only for converting to PDF.

Does Word DOCX Toolkit access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Word DOCX Toolkit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Word DOCX Toolkit use?

Word DOCX Toolkit is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Word DOCX Toolkit use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1k tokens, read only when the agent opens those files.

What are the alternatives to Word DOCX Toolkit?

Skills that share tags, products or a category with Word DOCX Toolkit: DOCX Toolkit (XiaomiMiMo/MiMo-Code, 14k stars), DOCX (nexus-research-lab/nexus, 150 stars), Docs (AFK-surf/OpenBridge, 430 stars) and DOCX Creation and Editing (anthropics/skills, 180k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Word DOCX Toolkit?

NousResearch (a GitHub organization) maintains it in NousResearch/hermes-agent, which has 251,991 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 8, 2026.

Source: NousResearch/hermes-agent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.