docx

Unpack and repack DOCX files to edit internal OOXML.

83|18|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/mainza-ai/milimovideo --skill docx-mainza-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/mainza-ai/milimovideo/tree/main/skills/skills/docx
Command: npx skills add https://github.com/mainza-ai/milimovideo --skill docx-mainza-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Word documents (.docx) are ZIP archives containing XML. This skill provides a programmatic workflow to create, read, edit, and analyze Word docs by unpacking the DOCX, modifying the underlying OOXML (e.g., word/document.xml), and repacking into a valid DOCX.

Core Features & Use Cases

  • Unpack and inspect DOCX structure to access word/document.xml, [Content_Types].xml, and relationship files.
  • Create new documents using docx-js and generate DOCX packages, or edit existing documents by updating the OOXML and repacking.
  • Validate, repair, and re-pack documents with the included scripts (unpack.py, pack.py, validate.py).

Quick Start

Unpack a DOCX, edit word/document.xml, and repack to create 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 programmatically edit the internal XML of a Word document?

To programmatically edit Word document XML, you unpack the .docx file to expose the underlying OOXML structure, modify files like word/document.xml directly, and repack the archive into a valid .docx using the included scripts.

What is the best way to automate batch generation of Word documents from templates?

Automating batch generation of Word documents involves unpacking a template .docx, modifying the OOXML content programmatically for each iteration, and repacking the files into individual validated .docx archives.

Do I need lxml and defusedxml to parse and modify OOXML files?

Yes, this workflow relies on lxml for XML parsing and defusedxml for secure XML processing, ensuring that the unpacked OOXML files like word/document.xml are handled safely and efficiently during modification.

Can I extract and analyze content from existing .docx files for automation workflows?

Yes, you can extract and analyze content from existing .docx files by unpacking the archive to access the internal OOXML structure, allowing you to inspect relationships, content types, and document XML for automation workflows.

How do I validate a modified Word document before repacking?

You validate a modified Word document by using the included validation script on the unpacked OOXML directory, checking the integrity of the XML structure before executing the repack pipeline to generate the final .docx file.

Why does editing a .docx file require unpacking and repacking the archive?

Editing a .docx file requires unpacking and repacking because a Word document is a ZIP archive containing XML, meaning direct edits must target the internal OOXML files like word/document.xml before repacking into a valid .docx.