docx

Automates DOCX creation, editing, and validation via XML manipulation and packaging.

45|12|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/LdotJdot/OpenLum --skill docx-ldotjdot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/LdotJdot/OpenLum/tree/main/OpenLum.Console/Skills/docx
Command: npx skills add https://github.com/LdotJdot/OpenLum --skill docx-ldotjdot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, lxml.

What problem does it solve?

This Skill automates Word document creation, reading, editing, and validation, enabling you to generate polished .docx files and modify existing ones without manual XML handling.

Core Features & Use Cases

  • Create new documents from structured inputs (title, sections, and tables) using a programmatic approach and DOCX generation libraries.
  • Edit existing documents by unpacking the Word file, editing word/document.xml and related content, and repacking to produce a valid .docx with correct relationships and content types.
  • Validate and repair DOCX structure (content types, relationships, whitespace preservation, and tracked changes) to ensure compatibility with downstream tools like LibreOffice for conversions.

Quick Start

Create a new DOCX document with a title and several sections, then save it as output.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 generation from structured inputs?

Automate Word document generation by using a programmatic approach and DOCX generation libraries to create new files with titles, sections, and tables. This Skill handles the underlying XML manipulation required to package structured inputs into a valid .docx file.

How do I edit an existing DOCX file by modifying the underlying XML?

Edit an existing DOCX file by unpacking the Word file, modifying word/document.xml and related content directly, and repacking it. This process ensures correct relationships and content types are maintained for a valid output document.

How can I validate DOCX structure to ensure compatibility with LibreOffice?

Validate DOCX structure by running integrity checks on content types, relationships, whitespace preservation, and tracked changes. This ensures your Word documents remain compatible with downstream tools like LibreOffice for format conversions.

Can I use Python and lxml to unpack and modify word/document.xml?

Yes, Python scripts utilizing lxml and defusedxml handle the XML processing, unpacking, and repacking. This toolchain manipulates the internal document structure and packages files back into a valid DOCX format.

What is the best way to repair broken relationships and content types in a DOCX file?

Repair broken relationships and content types in a DOCX file by unpacking the archive and running validation scripts. This Skill fixes structural integrity issues and repackages the XML files to produce a valid document.

Why does my automated DOCX file fail to open in downstream conversion tools?

Automated DOCX files fail to open when structural integrity is compromised during XML editing. Validating content types, relationships, and whitespace preservation before repacking ensures compatibility with downstream conversion tools.