docx

Automate Word document creation, editing, and redlining workflows via OOXML.

1|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/fajshah/hackhathone-2-phase-5 --skill docx-fajshah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/fajshah/hackhathone-2-phase-5/tree/main/skills/docx
Command: npx skills add https://github.com/fajshah/hackhathone-2-phase-5 --skill docx-fajshah

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Automates the end-to-end workflow for creating, editing, and analyzing Word documents (.docx) while preserving formatting, tracked changes, comments, and structural integrity.

Core Features & Use Cases

  • Programmatic document creation: generate Word files from templates and data.
  • Editing and redlining: modify content with tracked changes and comments for review.
  • Formatting preservation: maintain fonts, styles, tables, and images when transforming documents.
  • Use Case: A legal team drafts a contract in Word, uses this skill to apply edits with proper redlines, and outputs a final, clean .docx for distribution.

Quick Start

Load an unpacked Word document, apply edits, and repack into a new .docx.

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 generation with tracked changes and comments?

You can automate Word document generation by manipulating OOXML inside .docx files using Python. This approach applies tracked changes and comments programmatically while preserving formatting, author metadata, and content integrity for professional review workflows.

Can I edit .docx files programmatically while preserving existing formatting and styles?

Yes, editing .docx files programmatically through direct OOXML manipulation preserves existing formatting, styles, tables, and images. You apply scriptable edits with RSID annotations and author metadata to maintain document structure and formatting integrity.

What is the best way to apply redlines and tracked changes to a contract in Word using Python?

The best way to apply redlines to a contract in Word is using a Python-based Document library to manipulate OOXML directly. This allows deterministic, scriptable edits with proper RSID annotation and multi-user author metadata for collaboration.

Does this approach to Word document automation require specific XML libraries?

Yes, this approach to Word document automation requires lxml and defusedxml libraries to parse and manipulate the internal OOXML structure safely. These dependencies enable scriptable edits while maintaining content integrity validations.

How do tracked changes work when manipulating OOXML in .docx files?

Tracked changes in .docx files work by directly modifying the underlying OOXML elements to insert revisions, comments, and RSID annotations. This ensures edits are visible as redlines during review and maintains author metadata for collaborative editing.

Are there limitations when generating Word documents by editing raw OOXML?

Generating Word documents by editing raw OOXML requires careful handling of structural integrity validations to avoid corruption. Complex formatting transformations may need manual XML tree navigation, and you must repack the unpacked document correctly into a valid .docx file.