docx

Edit and generate DOCX files by unpacking OOXML into XML and repacking with validation.

190|27|Updated Apr 22, 2026
One-click install
npx skills add https://github.com/linxuan-sys/opencode-skills-chinese --skill docx-linxuan-sys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/linxuan-sys/opencode-skills-chinese/tree/main/docx
Command: npx skills add https://github.com/linxuan-sys/opencode-skills-chinese --skill docx-linxuan-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandoc, docx, LibreOffice, Poppler, gcc, soffice, pdftoppm, and includes scripts (resource) components.

What problem does it solve?

This Skill streamlines creating, editing, and repairing Microsoft Word (.docx) documents by operating on their underlying OOXML content, so you can produce consistent layouts and apply structured changes without breaking document integrity.

Core Features & Use Cases

  • Read, analyze, and repair DOCX content: Unpack DOCX into XML, pretty-print XML, preserve whitespace rules, and support tracked-change cleanup.
  • Create professional DOCX from scratch (docx-js): Generate documents programmatically with correct page sizing, styles, tables, images, hyperlinks, footnotes, and table of contents constraints.
  • Edit existing DOCX at the XML level: Unpack → carefully edit word/ XML (including revisions/comments markers) → repack with validation and auto-repair for common ID/whitespace issues.
  • Convert formats for inspection: Use Pandoc for text extraction and LibreOffice to convert to PDF/images for downstream review.
  • Validate against OOXML schemas: Run schema validation (DOCX XSD + structural checks) and enforce tracked-change and ID constraints, including comment marker pairing.

Quick Start

Use the docx skill to convert the attached file 'report.docx' into an unpacked, editable XML directory for safe inspection: python scripts/office/unpack.py report.docx unpacked/

Frequently Asked Questions about docx

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

FAQPage Schema
How do I edit OOXML directly to modify an existing DOCX file?

To edit OOXML in a DOCX file, you can unpack the document into editable XML, apply safe XML-level modifications to the underlying structure, and repack it into a valid .docx file with schema validation and auto-repair.

What is the best way to programmatically generate Word documents with tracked changes and images?

Generating Word documents programmatically is best handled by using docx-js to create files from scratch with correct styles, or by unpacking OOXML to insert tracked changes, images, and comments before repacking with validation.

Why does my DOCX file break after modifying the XML structure?

Your DOCX file breaks because OOXML requires strict schema validation, whitespace preservation rules, and relationship integrity. You must enforce ID constraints and use auto-repair for common structural issues when repacking the document.

Can I use LibreOffice and Pandoc to convert DOCX files for automated review?

Yes, you can use Pandoc for text extraction and LibreOffice to convert DOCX files to PDF or images, allowing you to perform downstream review and inspect document output systematically.

Do I need Pandoc and LibreOffice installed to create and validate Word documents?

You need Pandoc and LibreOffice installed if your workflow involves text extraction or converting DOCX to PDF for inspection. For creating and editing DOCX, the environment requires unpacking tools and schema validation dependencies.