docx

Create, edit, and analyze Microsoft Word .docx files with Python and JavaScript.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Zehong-Wang/Kosmos --skill docx-zehong-wang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/Zehong-Wang/Kosmos/tree/main/kosmos-reference/kosmos-claude-scientific-writer/.claude/skills/document-skills/docx
Command: npx skills add https://github.com/Zehong-Wang/Kosmos --skill docx-zehong-wang

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the creation, editing, and analysis of Microsoft Word documents, automating complex tasks like tracked changes and formatting preservation.

Core Features & Use Cases

  • Document Creation: Generate new .docx files from scratch using JavaScript/TypeScript.
  • Document Editing: Modify existing .docx files, including tracked changes, comments, and formatting.
  • Content Analysis: Extract text and raw XML for detailed document inspection.
  • Use Case: Automatically redline a legal contract by applying specific edits and comments, ensuring all changes are tracked and preserved for review.

Quick Start

Use the docx skill to convert the document at 'path/to/your/document.docx' into markdown format with all tracked changes enabled.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I automate tracked changes and redlining in Word documents?

You can automate tracked changes and redlining in Word documents by programmatically editing .docx files using Python and JavaScript libraries to apply edits, insert comments, and preserve all revisions for professional review workflows.

Can I extract text from a .docx file using pandoc?

Yes, you can extract text from a .docx file using pandoc to convert the document into markdown format, enabling detailed content analysis and seamless integration into automated document processing pipelines.

What's the best way to generate a .docx file from scratch programmatically?

The best way to generate a .docx file from scratch is using JavaScript or TypeScript libraries to programmatically construct the document structure, format text, and output a valid Word file for business or academic use.

How do I manipulate raw XML in a Word document to fix complex formatting?

You can manipulate raw XML in a Word document by parsing the underlying .docx structure with Python libraries and defusedxml, allowing precise modification of complex formatting elements that standard editors cannot access.

Do I need LibreOffice installed to process .docx files for automated editing?

Yes, processing .docx files for automated editing requires LibreOffice along with pandoc, poppler-utils, and defusedxml installed in your environment to fully support document conversion, text extraction, and raw XML manipulation.

Does this approach to Word document editing preserve comments and tracked changes?

Yes, this approach to Word document editing preserves comments and tracked changes by programmatically managing the redlining workflow, ensuring all inserted revisions and annotations remain intact for legal and academic review.