docx

Create, edit, and analyze Word documents with OOXML-based Python scripts.

Updated Dec 9, 2025
One-click install
npx skills add https://github.com/h4v1d/extension-collection-geminicli --skill docx-h4v1d
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/h4v1d/extension-collection-geminicli/tree/main/docx
Command: npx skills add https://github.com/h4v1d/extension-collection-geminicli --skill docx-h4v1d

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

The DOCX skill provides a comprehensive framework to create, edit, and analyze Word documents (.docx) while preserving formatting, comments, and tracked changes, reducing manual, error-prone workflows.

Core Features & Use Cases

  • Create new DOCX documents with structured content (paragraphs, tables, images) using an OOXML-based API.
  • Edit and redline existing documents, manage tracked changes, and preserve author metadata.
  • Analyze content (text extraction, formatting, comments, and change-tracking) across Word documents.
  • Real-world use: drafting legal briefs, corporate reports, academic manuscripts requiring precise formatting and change history.

Quick Start

Start by creating a new Word document with a title and a paragraph, then add a 2x2 table and a simple image using the library.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I automate editing Word documents with tracked changes?

You can automate tracked changes in Word documents by using a Python OOXML-based workflow that edits w:document.xml directly, managing redlining and preserving author metadata for professional document workflows.

Can I create Word DOCX files with tables and images using Python?

You can create Word DOCX files with structured content like paragraphs, tables, and images through an OOXML-based API, generating new documents with precise formatting for corporate or academic use.

How do I extract text and comments from a DOCX file for analysis?

To extract text and comments from a DOCX file for analysis, the Skill parses the underlying OOXML structure, allowing you to review change-tracking history and document content across multiple Word files.

Does this approach preserve formatting when editing existing Word documents?

Yes, editing existing Word documents preserves original formatting, comments, and tracked changes by validating and modifying the raw OOXML structure, ensuring professional document integrity is maintained.

What dependencies are needed for OOXML document editing in Python?

OOXML document editing in Python requires defusedxml, lxml, and Pillow to parse XML structures, process the document tree, and handle embedded images within the Word files.

When should I use an OOXML script instead of a Word document editor?

You should use an OOXML script for drafting legal briefs or corporate reports requiring precise formatting and change history, reducing manual error-prone workflows across multiple documents.