docx

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

Updated Jul 30, 2026
One-click install
npx skills add https://github.com/johsquaree/claude-basic-docs --skill docx-johsquaree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/johsquaree/claude-basic-docs/tree/main/.claude/skills/document-skills/docx
Command: npx skills add https://github.com/johsquaree/claude-basic-docs --skill docx-johsquaree

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Working with .docx files programmatically is difficult because they are ZIP archives of XML files, making tasks like editing content, adding tracked changes, or inserting comments error-prone without the right workflows and tooling. ## 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. - Editing & Redlining: Modify existing documents with tracked changes and comments using a Python Document library that handles OOXML infrastructure, RSIDs, and validation automatically. - Content Analysis: Extract text via pandoc, access raw XML for comments and metadata, and convert documents to images for visual review. - Use Case: A legal team needs contract revisions reviewed. Convert the .docx to markdown, plan batched tracked changes, implement them with the Document library, and verify the final redlined document. ## Quick Start Ask the assistant to create a new Word document or add tracked changes and comments to an existing .docx file.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I create a Word document with JavaScript?

Use the docx npm library to build documents with Document, Paragraph, and TextRun components, then export with Packer.toBuffer(). Define custom styles, tables, lists, and images, and always use separate Paragraph elements instead of newline characters.

How do I add tracked changes to a docx file in Python?

Unpack the document with the pack/unpack scripts, then use the Document library's replace_node, suggest_deletion, revert_insertion, and revert_deletion methods. The library auto-injects RSIDs, author, and date attributes, and validates the result on save.

How do I extract text from a Word document?

Convert the .docx 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.

Does the docx library support comments and replies?

Yes, the Python Document class provides add_comment to anchor comments to elements and reply_to_comment for threaded replies. It automatically manages comments.xml, commentsExtended.xml, commentsIds.xml, and people.xml infrastructure.

Why does my generated Word document fail to open?

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 documented critical rules and run validation on save.