docx

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

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/usf-cen4020-s26/in_college_program --skill docx-usf-cen4020-s26
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/usf-cen4020-s26/in_college_program/tree/main/.claude/skills/docx
Command: npx skills add https://github.com/usf-cen4020-s26/in_college_program --skill docx-usf-cen4020-s26

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, pandoc, docx, libreoffice, poppler-utils, and includes scripts (resource) and references (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 via a Python Document library that handles tracked changes, comments, RSIDs, and OOXML infrastructure automatically. - Content Analysis: Extract text with pandoc, unpack raw XML for comments and media, and convert documents to images for visual review. - Use Case: A legal team needs contract revisions reviewed. Use the redlining workflow to implement batched tracked changes with minimal, precise edits, then verify the final document against the original. ## Quick Start Use the docx skill to add tracked changes replacing "30 days" with "60 days" in the attached contract.docx file.

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 at the paragraph level. The library auto-injects RSIDs, author, and date attributes, and validates the result on save.

How do I create a Word document with JavaScript?

Use the docx npm package to build a Document from Paragraph, TextRun, Table, and ImageRun components, then export with Packer.toBuffer(). Define custom styles and numbering configs for professional formatting and proper lists.

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.

Why does my generated Word document fail to open?

Common causes include standalone PageBreak elements outside a Paragraph, using ShadingType.SOLID for table cells, or nesting tracked changes inside <w:r> elements. Follow the schema ordering rules and use the Document library's validation on save.

Can I reject another author's tracked changes in a docx file?

Yes. Use revert_insertion() to wrap an insertion in a deletion, or revert_deletion() to restore deleted content as a new insertion. Never modify text inside another author's <w:ins> or <w:del> tags directly.