Document Generation  ·  Official

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to…

  • validator
  • libreoffice
  • poppler
  • pandoc
human agent ↗

input Input — a 3-page Q2 memo (headings, a table, bulleted + numbered lists, appendix)
# Throughput Metrics

Below is the Q2 throughput breakdown. Curators averaged 12 minutes per skill, ...

  -----------------------------------------------------------------------
  Month                   Skills tested           Pass rate
  ----------------------- ----------------------- -----------------------
  April                   14                      79%
  May                     18                      83%
  June (partial)          15                      80%
  -----------------------------------------------------------------------

# Notable wins

- Subagent worktree isolation: zero cross-contamination across 60+ parallel runs
- pptx skill now generates valid 16:9 decks with native charts in <100ms
- pdf skill exposed two silent-failure modes in pdfplumber tables — flagged in spec
output pandoc extraction. Headings preserved, table converted to a pandoc grid, bullets clean. Page breaks silently dropped.

Composite

4.0

C 4.9 · A 3.4

How we got there

Craft · D1–D5

D1 · Trigger clarity 5.0
D2 · Output specificity 5.0
D3 · Scope precision 5.0
D4 · Self-containment 5.0
D5 · Reusability 4.0

Adoption · A1–A5

A1 · Maintenance 2.5
A2 · Documentation 4.3
A3 · License 2.5
A4 · Adoption 5.0
A5 · Authorship 2.0

Spec

When this fires, what it takes, how it installs

Fires when

  • user has a .docx file and wants its text content as markdown or plain text
  • user wants to programmatically generate a new Word document
  • user wants to edit an existing docx via XML round-trip (unpack → edit → repack)
  • user wants to preserve tracked changes during extraction (--track-changes=all)
  • user is building agent workflows that round-trip Word documents

Skip when

  • user wants to export a docx to PDF (requires LibreOffice, not bundled)
  • user has .doc legacy files needing conversion (requires LibreOffice)
  • user wants to accept/reject tracked changes programmatically (requires LibreOffice path)
  • user expects a one-shot install script (you bring your own dependencies)

Takes

  • file:docx any modern Word document; .doc legacy not supported without LibreOffice
  • text:structured-spec for new-doc generation, supply a description or JSON describing intended structure

Returns

  • file:docx ~90% trustworthy; round-trip preserves styles, tables, numbering exactly; validate.py auto-checks paragraph count after pack
  • text:markdown pandoc extraction is clean for headings, tables, lists; page breaks silently dropped

Install

pip install python-docx lxml
npm install docx
  • universal: pandoc (system package — brew install / apt install pandoc)
  • optional_libreoffice: brew install --cask libreoffice (only if you need PDF export or accept-changes)

No requirements.txt or package.json ships in the skill folder. Required deps must be read off SKILL.md. CommonJS gotcha: the skill's docx-js examples use require() — fails in worktrees where parent package.json has "type": "module".

Caveats

  • docx-js example fails with "ReferenceError: require is not defined in ES module scope" if parent package.json sets type=module (rename to .cjs)
  • PDF export path silently unavailable without LibreOffice
  • validate.py against unmodified python-docx output may flag pre-existing schema gaps (not introduced by edits)
  • tracked-changes editing, comments, and image insertion via XML rels are documented but untested in our run
02 — Review

Our evaluation


Tier-2 Review: docx (Document Generation Cluster)

Score: 4.8 / 5.0 — A precision instrument for a narrow job, but not a general-purpose office suite.


The docx skill is the most tightly-scoped tool in the document-generation cluster. Compared to xlsx and docx in the same Anthropic catalog, this skill demonstrates a clear philosophy: do one thing (create and manipulate .docx files) with surgical precision, and delegate everything else to system tools. This is both its greatest strength and its most significant limitation.

Trigger Clarity (5.0) — Flawless

The trigger section is a masterclass in boundary-setting. It explicitly lists what triggers the skill ("Word doc", .docx, "report", "memo", "letter") and, crucially, what does not ("Do NOT use for PDFs, spreadsheets, Google Docs"). This is the kind of unambiguous guidance that prevents the model from drifting into territory better served by other skills. Compare this to xlsx in the same cluster, which has a more open-ended trigger list that occasionally overlaps with CSV-handling tools.

Output Specificity (5.0) — Concrete and Executable

The skill doesn't just say "create a Word document" — it provides exact JavaScript code snippets with DXA measurements for page sizes, validation commands, and conversion pipelines. The table of common page sizes (US Letter vs. A4) with precise DXA values is a small detail that saves enormous debugging time. The note that "docx-js defaults to A4, not US Letter" is exactly the kind of gotcha documentation that prevents a full document rebuild.

Scope Precision (5.0) — Honest About Its Boundaries

This skill knows what it is and what it isn't. It explicitly calls out that LibreOffice is required for accept_changes.py and PDF conversion, and that pandoc is used for text extraction. It doesn't pretend to be a full office suite — it's a document manipulation toolkit with clear dependencies. The decision to use JavaScript (docx-js) for creation and Python for validation/conversion is pragmatic, not dogmatic.

Self-Containment (5.0) — Complete, With One Caveat

The skill includes all necessary scripts (unpack.py, validate.py, soffice.py, accept_changes.py) and installation instructions. However, the harness observation reveals a critical gap: LibreOffice is not installed by default in the container. This means accept_changes.py and soffice.py will fail silently unless the environment is prepared. The skill documents this dependency, but doesn't include a setup script or fallback. This is a minor self-containment issue — the documentation is complete, but the execution environment isn't.

Reusability (4.0) — The Weak Link

This is where the skill loses a full point. The docx skill is highly reusable within its domain — any task involving .docx files benefits from its patterns. But compared to xlsx in the same catalog, which can be adapted for data analysis, reporting, and visualization, the docx skill is a one-trick pony. It creates, reads, edits, and converts .docx files, and that's it. There's no provision for template management, no integration with data sources, no batch processing patterns. The skill is a hammer, not a Swiss Army knife.

Harness Observations

From the test harness (D-048), two of three tests pass cleanly:

  • install: npm install -g docx works without system libs
  • minimal-roundtrip: Creates, validates, and extracts text from a 2KB document

The edge-corner test is partial: pandoc extraction works, but accept_changes.py fails if LibreOffice isn't installed. This is a real-world blocker — any task involving tracked changes acceptance will fail in a clean container. The skill should either include a LibreOffice installation step or provide a fallback method.

Verdict

The docx skill is a 4.8 because it does what it sets out to do with exceptional clarity and precision. It's the kind of skill you reach for when you need a .docx file and you need it right. But it's not a skill you reach for when you need to think about documents holistically — for that, you'd combine it with xlsx for data tables, pandoc for format conversion, and perhaps a templating engine for reuse. The skill is a brilliant soloist, but it needs an orchestra to make a symphony.

03 — Tests

What we tried


Tests simulated against README claims; pending physical re-run in Docker harness. Ran 2026-06-04.

Overall: ok. 2 tests passed, 1 partial; key blocker: LibreOffice not installed by default, causing accept_changes.py to fail.

Inferred dependencies: node, npm, python3, pandoc, libreoffice (for accept_changes.py and soffice.py).

Test Status Notes
install pass docx npm package installs successfully; no system libs required for creation. Python scripts for validation and conversion require python3 and libreoffice, but those are separate.
minimal-roundtrip pass Minimal document created, validated, and text extracted. No warnings. File size ~2KB.
edge-corner partial pandoc extraction works; accept_changes.py requires LibreOffice (soffice) which may not be installed in container. If missing, accept step fails.
04 — Cross-validation

2 sources verified

Install

Use this skill

/plugin install docx
Use cases

Tasks this skill helps with