docx

Create and edit Word documents by manipulating WordprocessingML XML.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/glfruit/gorin-skills --skill docx-glfruit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/glfruit/gorin-skills/tree/main/openclaw/docx
Command: npx skills add https://github.com/glfruit/gorin-skills --skill docx-glfruit

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Automates the creation, reading, editing, and formatting of Word documents to reduce manual editing time and ensure consistent styling and layout.

Core Features & Use Cases

  • Create new .docx documents with precise formatting (headings, tables, images) and styles.
  • Edit existing Word documents by manipulating WordprocessingML XML (document.xml) and content types to apply edits, insert images, update styles, and maintain proper relationship mappings.
  • Validate and reconcile DOCX structure during pack/unpack cycles to ensure compatibility across editors and viewers.

Quick Start

Unpack a sample DOCX, modify document.xml to apply a simple change, and re-pack 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 creation and formatting with Python?

Automate Word document creation by unpacking the .docx file, modifying the WordprocessingML XML structure, and repacking it. This Python XML tooling approach applies precise formatting, inserts tables and images, and ensures consistent styling across generated documents.

How does editing WordprocessingML XML modify existing .docx files?

Editing WordprocessingML XML modifies .docx files by directly manipulating the document.xml structure inside the archive. This unpacks the DOCX, updates content types and relationship mappings, applies style changes, and repacks the file while maintaining compatibility across editors.

Can I insert tracked changes and comments into a .docx file using XML manipulation?

Yes, you can insert tracked changes and comments into a .docx file through XML manipulation. The process targets professional document workflows by modifying the WordprocessingML structure to add revisions and annotations while maintaining proper content type relationships.

Do I need lxml and defusedxml to process Word documents?

You need lxml and defusedxml to process Word documents because they provide the Python XML tooling required to safely unpack, parse, and modify the WordprocessingML structure before repacking the DOCX archive.

What is the best way to validate DOCX structure during pack and unpack cycles?

The best way to validate DOCX structure during pack and unpack cycles is to reconcile content types and relationship mappings. This ensures the repacked WordprocessingML output remains compatible across different document editors and viewers.