docx

Automate Word document creation, editing, and tracked-changes analysis via Python scripts.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/rafaelramosdf/antigravity-agents --skill docx-rafaelramosdf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/rafaelramosdf/antigravity-agents/tree/main/templates/agent-template-en/skills/docx
Command: npx skills add https://github.com/rafaelramosdf/antigravity-agents --skill docx-rafaelramosdf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, lxml, Pillow, and includes scripts (resource) components.

## What problem does it solve? This Skill automates advanced Word document creation, editing, and review with tracked changes and comments, preserving formatting.

## Core Features & Use Cases

  • Create new .docx files with structured content and formatting retention.
  • Edit existing documents with tracked changes, inline comments, and reformatting while preserving OOXML integrity.
  • Use case: collaborate on a contract draft, enabling reviewers to add comments and track changes while preserving layout and styles.

### Quick Start Create a new Word document with a title and initial content using the Docx skill.

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 editing with tracked changes in Python?

You can automate Word document editing with tracked changes by running Python scripts that manipulate OOXML paragraphs directly, preserving formatting integrity while inserting revisions and comments deterministically.

Can I add inline comments to a Word doc using Python without breaking the formatting?

Yes, adding inline comments to a Word doc with Python preserves formatting by applying paragraph-level XML manipulation that maintains OOXML integrity and document layout structure.

Does this approach work with existing .docx files or only for creating new documents?

This approach works with both creating new .docx files and editing existing documents, applying tracked changes, annotations, and reformatting while retaining the original content structure.

What Python dependencies are needed for OOXML document manipulation and tracked changes?

Python dependencies required for OOXML document manipulation include defusedxml, lxml, and Pillow, which provide secure XML parsing, document tree traversal, and image processing capabilities.

What is the best way to script contract revision workflows with tracked changes?

The best way to script contract revision workflows is using deterministic Python scripts to apply tracked changes and comments at the paragraph XML level, preserving styles and layout for reviewer collaboration.

Are there limitations when handling complex OOXML structures with lxml for Word documents?

Handling complex OOXML structures with lxml requires careful paragraph-level XML manipulation to avoid breaking formatting, as incorrect tracked changes or comment insertion can corrupt document integrity.