docx

Create, edit, and analyze Word documents with tracked changes, comments, and OOXML manipulation.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-skills --skill docx-clay-hhk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/Clay-HHK/claude-skills/tree/main/docx
Command: npx skills add https://github.com/Clay-HHK/claude-skills --skill docx-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, pandoc, docx, libreoffice, poppler-utils, and includes scripts (resource) components.

What problem does it solve? Working with .docx files programmatically is difficult because they are ZIP archives of complex OOXML, and tasks like tracked changes, comments, and formatting preservation require deep knowledge of Word's XML schema. ## Core Features & Use Cases - Document Creation: Generate new Word documents from scratch using the docx-js JavaScript library with styles, tables, lists, images, headers, and footers. - Redlining & Tracked Changes: Edit existing documents with proper tracked changes (<w:ins>/<w:del>) and comments via a Python Document library, ideal for legal, academic, and business document review. - Text Extraction & Analysis: Convert documents to markdown with pandoc, unpack raw XML for comments and metadata, and render pages to images for visual inspection. - Use Case: Review a contract by converting it to markdown, planning batched edits, implementing tracked changes with the Document library, and packing the result back into a reviewed .docx file. ## Quick Start Ask the assistant to review the attached contract.docx and add tracked changes replacing all 30-day terms with 60-day terms.

Frequently Asked Questions about docx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add tracked changes to a Word document programmatically?▼

Unpack the .docx file, then use the Python Document library to wrap edits in <w:ins> and <w:del> tags with author, date, and RSID attributes. The library auto-injects required attributes and validates the result before packing back to .docx.

How do I create a Word document with JavaScript?▼

Use the docx npm package to build documents with Document, Paragraph, and TextRun components, then export with Packer.toBuffer(). It supports styles, tables, lists, images, headers, footers, and tables of contents.

How do I extract text from a .docx file?▼

Convert the document to markdown using pandoc with the --track-changes=all flag to preserve insertions and deletions. For comments, embedded media, or complex formatting, unpack the file and read the raw XML in word/document.xml directly.

Can I add comments to an existing Word document?▼

Yes, the Document library's add_comment method anchors comments to document nodes and automatically manages comments.xml, commentsExtended.xml, and people.xml infrastructure. It also supports replying to existing comments by parent comment ID.

Why does my generated docx fail to open in Word?▼

Common causes include standalone PageBreak elements outside a Paragraph, unicode bullets instead of numbering config, missing ImageRun type parameters, or invalid tracked-change nesting. Follow the schema ordering rules and use the library's validation on save.