docx

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

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/jvsandhu/agentic-skills --skill docx-jvsandhu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/jvsandhu/agentic-skills/tree/main/skills/docx
Command: npx skills add https://github.com/jvsandhu/agentic-skills --skill docx-jvsandhu

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 error-prone because they are ZIP archives of XML with strict schema rules. This Skill provides structured workflows for creating new Word documents, editing existing ones, and performing professional redlining with tracked changes and comments without corrupting files. ## Core Features & Use Cases - Document Creation: Generate new .docx files with docx-js (JavaScript/TypeScript), including styles, tables, lists, images, headers, and tables of contents. - Tracked Changes & Redlining: Implement precise insertions and deletions using <w:ins>/<w:del> tags via a Python Document library that auto-handles RSIDs, authors, and validation. - Content Analysis: Extract text with pandoc, unpack raw OOXML for comments and metadata, and convert documents to images for visual review. - Use Case: Review a legal contract by converting it to markdown, planning batched edits, applying tracked changes to the XML, and packing it back into a Word file ready for counterparty review. ## Quick Start Ask the agent to review the attached contract.docx and propose 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 these 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 a Document from Paragraph, TextRun, Table, and ImageRun components, then export with Packer.toBuffer(). Always use proper numbering configs for lists and separate Paragraph elements instead of newline characters.

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.

Why does my generated docx fail to open in Word?

Common causes include standalone PageBreak elements outside a Paragraph, missing ImageRun type parameters, unicode bullets instead of numbering configs, and invalid tracked-change nesting. Follow the schema ordering rules and run the built-in validation on save.

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

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