Sign in
Explore
Skills · SkillWriting & ContentDocuments & filesReviewed

docx

Creates, reads and edits Word .docx and .dotx files, including tables of contents, headings and page numbers.

Kind
Skill
Works with
Claude Code
Source
anthropics/skills @ 33375500bcea
Path
skills/docx/SKILL.md
Jobs
Documentation
Topics
Documents & files

Credit

Made by
anthropics
Original
github.com/anthropics/skills/blob/33375500bcea98d610eb30ce10a…
License
Apache-2.0

Listed by Skill Manifest; not made by us.

InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
Adds
  • .claude/skills/docx/ (the skill folder)
  • 21 other files in the folder: LICENSE.txt, scripts/__init__.py, scripts/accept_changes.py, scripts/comment.py and 17 more
Runs scripts
Yes
  • scripts/office/soffice.py
  • scripts/merge_runs.py
  • scripts/office/validate.py
  • scripts/comment.py
Uses the network
Yes
  • HTTP client calls (scripts/office/helpers/__init__.py)
Needs secrets
None found
Calls other skills
  • /script:module
  • /w:r
  • /w:t
  • /w:p
  • /w:comment
  • /w:comments
  • and 4 more
Value without its scripts
Low
  • The main file runs 5 of the 15 bundled scripts (scripts/accept_changes.py, scripts/comment.py, scripts/merge_runs.py), so most of the job needs them.
  • scripts/__init__.py
  • scripts/accept_changes.py: Accept all tracked changes in a DOCX file using LibreOffice.
  • scripts/comment.py: Add comments to a DOCX document.
  • scripts/merge_runs.py: Merge adjacent identically-formatted runs in a DOCX.
Source revision
33375500bcea
Licence
Apache-2.0
Last activity
16 Nov 2026
Source changed after the scan
Yes
  • Last push 16 Nov 2026, scanned 3 Nov 2026; read it again before you rely on this scan
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

# DOCX creation, editing, and analysis

A `.docx` is a ZIP archive of XML files. Choose your approach by task:

| Task | Approach |
|---|---|
| **Create** a new document | Write a `docx` (npm) script — see gotchas below |
| **Edit** an existing document | `unzip` → edit `word/document.xml` → `zip` (docx-js cannot open existing files) |
| **Read** content | `pandoc -t markdown file.docx` |

> Script paths below are relative to this skill's directory.

## Creating with docx-js — gotchas

`docx` is preinstalled — do not run `npm install` first; write the script and `require('docx')` directly. Only if that require fails: `npm install docx`. The model knows the API; these are the footguns:

- **Page size defaults to A4.** For US Letter set `page: { size: { width: 12240, height: 15840 } }` (DXA; 1440 = 1″).
- **Landscape:** pass portrait dimensions and `orientation: PageOrientation.LANDSCAPE` — docx-js swaps width/height internally.
- **Tables need dual widths:** set `columnWidths` on the table AND `width` on every cell, both in `WidthType.DXA` (PERCENTAGE breaks in Google Docs). Column widths must sum to the table width.
…