docx

Read, edit, or create Microsoft Word DOCX files with python-docx and OOXML patching.

6.6k|511|Updated May 6, 2026
One-click install
npx skills add https://github.com/opensquilla/opensquilla --skill docx-opensquilla
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/opensquilla/opensquilla/tree/main/src/opensquilla/skills/bundled/docx
Command: npx skills add https://github.com/opensquilla/opensquilla --skill docx-opensquilla

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires docx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you read, edit, or create Microsoft Word .docx files without losing document structure or formatting.

Core Features & Use Cases

  • Inspect .docx structure: Extract paragraphs, tables, and detect tracked changes for safe, informed edits.
  • Edit in place: Perform run-level text replacements that preserve styles, or apply deeper XML patches for layout/numbering needs.
  • Create from scratch: Generate a new .docx from a simple JSON specification for repeatable document drafting.

Quick Start

Ask to have the AI inspect and extract the structure of your file, then apply run-level edits to replace specific phrases while preserving the original styling.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I edit a Word document without losing its original formatting?

To edit a Word document without losing formatting, perform run-level text replacements that preserve the original styling. This structure-aware approach modifies specific phrases inside individual runs while keeping paragraphs, tables, and overall document styles intact.

Can I create a new DOCX file from a JSON specification?

Yes, you can generate a new DOCX from a simple JSON specification. This allows for repeatable document drafting by mapping JSON structural definitions directly into Word document elements like paragraphs and tables.

How do you handle tracked changes and advanced layout when editing OOXML?

For tracked changes and advanced layout, the system falls back to OOXML unzip-and-patch XML patching rules. This carefully preserves namespaces, whitespace, and [Content_Types] integrity while modifying the underlying XML structure.

Does python-docx support inspecting and extracting document structure like tables?

python-docx supports inspecting existing DOCX content by extracting paragraphs, tables, and detecting tracked changes. This enables safe, informed edits by providing a clear structural view of the document before modifications are applied.

What is the best way to automate Word document generation for legal compliance?

The best way to automate Word document generation is by creating deterministic scripts that build new DOCX files from JSON specs. This ensures repeatable, structure-aware document drafting suitable for legal and compliance workflows.