docx

Edit and generate .docx files at the XML and package level.

1|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/liueggy/my_mini_skills --skill docx-liueggy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/liueggy/my_mini_skills/tree/main/docx
Command: npx skills add https://github.com/liueggy/my_mini_skills --skill docx-liueggy

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill removes the complexity of programmatic Word document creation, editing, and repair by operating at the .docx (Office Open XML) package and XML level so users can generate polished documents, apply tracked changes, and fix schema or relationship errors without manual Office UI steps.

Core Features & Use Cases

  • Unpack / Pack Workflows: Safely unpack .docx to editable XML, apply deterministic edits, and repack while validating and auto-repairing common issues.
  • Tracked Changes & Comments: Insert, reply, accept, or repair tracked changes and comments consistently (includes tools to add comments and manage comment markers).
  • Validation & Auto-repair: Run schema validation, fix xml:space and durableId/paraId problems, check relationships and content types, and produce actionable repair logs.
  • Document Generation Conventions: Guidance and examples for generating .docx via docx (docx-js) with critical rules for page size, tables, images, TOC, styles, and numbering to ensure cross-platform compatibility.
  • Use Case: Convert a draft Markdown report into a validated, corporate-ready .docx with correct styles, images, table widths, and a functioning table of contents, then run validation and auto-repair before delivery.

Quick Start

Ask the assistant to "Unpack my file.docx, accept all tracked changes, apply the provided corporate styles, validate and re-pack to final.docx".

Frequently Asked Questions about docx

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

FAQPage Schema
How do I programmatically accept tracked changes in a docx file without using the Word UI?

You can accept tracked changes in a docx file by unpacking the Office Open XML package and applying LibreOffice-based handling to manage and accept revisions programmatically without manual Word UI interaction.

What is the best way to repair corrupted docx schema and relationship errors?

The best way to repair docx schema errors is to unpack the file, run XSD validation, fix xml:space and durableId issues, verify relationship and content-type integrity, and repack the document deterministically.

How do I generate a Word document with a functioning table of contents and images from Markdown?

You can generate a Word document from Markdown by applying document generation conventions at the XML level, configuring page size, tables, images, TOC, and styles to produce a validated, corporate-ready docx file.

Does docx processing require LibreOffice for tracked-change management?

LibreOffice is utilized specifically for accepting and managing tracked changes in docx files, whereas standard XML unpacking, packing, and schema validation operations rely on the lxml and defusedxml dependencies.

How do I insert comments into a Word document programmatically?

To insert comments programmatically, you unpack the docx file, modify the underlying Office Open XML to add comment markers and content, and then repack the document deterministically while validating relationships.

Why does my generated docx file fail validation after adding custom tables and styles?

Docx files fail validation due to misapplied generation conventions for tables or styles, requiring an auto-repair pass to fix xml:space, durableId, and relationship integrity issues before final packing.