docx

Create, edit, and analyze .docx files via XML-level manipulation.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/coderhormaz/ethmumbai2026 --skill docx-coderhormaz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/coderhormaz/ethmumbai2026/tree/main/skills/docx
Command: npx skills add https://github.com/coderhormaz/ethmumbai2026 --skill docx-coderhormaz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, lxml.

What problem does it solve?

Streamline the end-to-end workflow for Word documents by enabling programmatic creation, editing, formatting, and analysis of .docx files without manual steps.

Core Features & Use Cases

  • Create new documents from templates using a DOM-like approach (unpacking, editing XML, and repacking).
  • Edit existing documents by modifying underlying XML in word/document.xml and related parts, then repack into a valid DOCX.
  • Read content, convert legacy formats to DOCX, and generate professionally formatted outputs (headers/footers, tables, images) with automated validation.

Quick Start

Install the required tooling and run the provided scripts to begin generating or updating Word documents.

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 from templates?

Automate Word document generation by unpacking the .docx file, editing the underlying XML in word/document.xml, and repacking it into a valid DOCX using a DOM-like approach. This enables programmatic template-driven workflows without manual steps.

What is XML-level DOCX manipulation and when do I need it?

XML-level DOCX manipulation modifies the raw XML parts inside a .docx package to alter document structure and formatting. You need it when creating, editing, or validating Word documents programmatically for reports and communications.

Can I edit existing .docx files by modifying their underlying XML?

Yes, you can edit existing .docx files by unpacking the package, modifying the XML in word/document.xml and related parts, and repacking the file. This ensures the output remains a valid DOCX with updated content and formatting.

Does this approach support adding headers, footers, tables, and images to Word documents?

Yes, XML-level DOCX manipulation supports generating professionally formatted outputs including headers, footers, tables, and images. It reads content, converts legacy formats to DOCX, and applies automated validation to ensure structural integrity.

Do I need lxml and defusedxml to process Word document XML safely?

You need lxml for parsing and manipulating the XML structure within .docx files, and defusedxml to process that XML safely against security vulnerabilities. These dependencies enable secure, automated document creation and validation.

What are the limitations of editing Word documents through XML manipulation?

Editing Word documents through XML manipulation requires understanding the internal DOCX structure and formatting rules. Complex formatting may break if the XML is modified incorrectly, though automated validation tooling helps verify structural integrity after repacking.