/ Claude Skills / Docx
Documents

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 produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation."

About this skill

# DOCX creation, editing, and analysis

Overview

A .docx file is a ZIP archive containing XML files.

Quick Reference

| Task | Approach |

|------|----------|

| Read/analyze content | pandoc or unpack for raw XML |

| Create new document | Use docx-js - see Creating New Documents below |

| Edit existing document | Unpack β†’ edit XML β†’ repack - see Editing Existing Documents below |

Converting .doc to .docx

Legacy .doc files must be converted before editing:

python scripts/office/soffice.py --headless --convert-to docx document.doc

Reading Content

# Text extraction with tracked changes
pandoc --track-changes=all document.docx -o output.md

# Raw XML access
python scripts/office/unpack.py document.docx unpacked/

Converting to Images

python scripts/office/soffice.py --headless --convert-to pdf document.docx
pdftoppm -jpeg -r 150 document.pdf page

Accepting Tracked Changes

To produce a clean document with all tracked changes accepted (requires LibreOffice):

python scripts/accept_changes.py input.docx output.docx

---

Creating New Documents

Generate .docx files with JavaScript, then validate. Install: npm install -g docx

Setup

const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun,
        Header, Footer, AlignmentType, PageOrientation, LevelForm

…

Use cases

  • **Always use `WidthType.DXA`** β€” never `WidthType.PERCENTAGE` (incompatible with Google Docs)
  • Table width must equal the sum of `columnWidths`
  • Cell `width` must match corresponding `columnWidth`
  • Cell `margins` are internal padding - they reduce content area, not add to cell width
  • For full-width tables: use content width (page width minus left and right margins)
  • **Set page size explicitly** - docx-js defaults to A4; use US Letter (12240 x 15840 DXA) for US documents

Installation

  1. Download the ZIP using the button on the right.
  2. Unzip the folder.
  3. Drop the docx/ folder inside ~/.claude/skills/.
  4. Restart Claude Code (or your Claude Desktop session) β€” the skill loads automatically.
# macOS / Linux
mkdir -p ~/.claude/skills
unzip claude-skill-docx.zip -d ~/.claude/skills/

What's included

scripts/comment.py
scripts/office/pack.py
scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd
scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd
scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd
scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd
scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd
scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd
scripts/office/schemas/microsoft/wml-2010.xsd
scripts/office/schemas/microsoft/wml-2012.xsd
scripts/office/schemas/microsoft/wml-2018.xsd
scripts/office/schemas/microsoft/wml-cex-2018.xsd
scripts/office/schemas/microsoft/wml-cid-2016.xsd
scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd
scripts/office/schemas/microsoft/wml-symex-2015.xsd
scripts/office/soffice.py

Frequently asked

What does the Docx skill do?
"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 produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation."
Who should use it?
Anyone working with Claude on documents-related tasks β€” consultants, founders, product teams, operators, and AI users who want repeatable, high-quality outputs from Claude.
How does it work?
Drop the folder into your `~/.claude/skills/` directory. Claude detects the SKILL.md instructions automatically and applies them when relevant.
What problem does it solve?
It removes the need to re-prompt Claude with the same context every time. Once the skill is installed, Claude already knows the rules, conventions, and procedures for this task.
How do I install it?
Download the ZIP, unzip it, and place the `docx/` folder inside `~/.claude/skills/`. No other setup required.
Is it free?
Yes β€” free download. We just ask for your name and work email so we can send useful Claude updates.
Can I get a custom version?
Yes. Abbas ElDeniney builds tailored Claude skills for specific business workflows and data sources. Book a consultation to scope your version.

Almost there

Share a few details and we'll start your download in one click.

Stay in the loop

Get notified the moment I publish a new blog, course, or case study.

πŸ”” Browser alerts
Instant pop-ups on this device