docx

Create and edit Word .docx documents with tracked changes and comments.

Updated Feb 2, 2026
One-click install
npx skills add https://github.com/Chai-Un/wedding --skill docx-chai-un
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/Chai-Un/wedding/tree/main/.github/skills/docx
Command: npx skills add https://github.com/Chai-Un/wedding --skill docx-chai-un

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, lxml, Pillow.

What problem does it solve?

This Skill streamlines programmatic Word (.docx) workflows by enabling automated creation, editing, and review of documents, including support for tracked changes and comments.

Core Features & Use Cases

  • Document creation: Generate new Word documents programmatically from templates and data.
  • Editing with redlining: Apply, reject, or combine tracked changes while preserving formatting and structure.
  • Comment management: Add, reply, and track comments tied to specific content ranges.
  • Formatting preservation: Maintain OOXML structure, fonts, spacing, and styles across edits.
  • Use Case: Automatically generate a contract draft from a template, apply edits with tracked changes, and attach reviewer notes.

Quick Start

Use the docx skill to automatically create a new Word document and apply a tracked change to the first paragraph.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I automate Word document creation and editing with tracked changes?

You can automate Word document creation and editing by using Python to manipulate OOXML content. This approach supports applying and rejecting tracked changes while preserving document formatting and structure during redlining workflows.

Can I programmatically add and manage comments in a .docx file?

Yes, you can programmatically add, reply to, and track comments tied to specific content ranges in a .docx file. This is achieved by directly manipulating the OOXML structure to support collaborative review scenarios.

How does Python manipulate OOXML to preserve formatting when editing Word documents?

Python libraries like lxml and defusedxml parse and modify the underlying OOXML structure directly. By manipulating the XML tree while maintaining document integrity, fonts, spacing, and styles are preserved across edits.

What is the best way to generate a contract draft from a template and apply reviewer notes?

The best way to generate a contract draft from a template is to programmatically inject data into the Word document, apply edits as tracked changes, and attach reviewer notes as comments tied to specific text ranges.

Do I need Pillow to handle images when automating Word document workflows?

Yes, you need the Pillow library specifically for image handling when automating Word document workflows. It works alongside lxml and defusedxml to ensure images are processed correctly within the OOXML structure.

When should I not use direct OOXML manipulation for document editing?

You should avoid direct OOXML manipulation for document editing if your workflow requires complex desktop publishing features or real-time co-authoring capabilities that extend beyond programmatic redlining, comments, and template generation.