docx

Create, unpack, edit, and validate DOCX files as OOXML.

Updated May 15, 2026
One-click install
npx skills add https://github.com/lth0/codexSkill --skill docx-lth0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/lth0/codexSkill/tree/main/skills/agents/docx
Command: npx skills add https://github.com/lth0/codexSkill --skill docx-lth0

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you create, read, convert, and precisely edit .docx Word documents (including tracked changes and comments) while keeping the underlying OOXML structure valid and render-safe.

Core Features & Use Cases

  • Read & analyze DOCX internals: Unpack DOCX to XML for inspection, tracked-change extraction, and content reorganization.
  • Create and edit professional documents: Generate new Word documents using docx-js, or modify existing documents by safely editing OOXML.
  • Preserve formatting and correctness: Handle page sizing, tables, images, hyperlinks, footnotes, TOC heading rules, smart quotes, and tracked-change/comment XML marker conventions.
  • Validate and auto-repair: Validate unpacked/edit XML against Office Open XML schemas and apply safe repairs (e.g., whitespace preservation and durableId limits).

Quick Start

Use the docx skill to convert and rebuild a DOCX while preserving tracked changes for the attached file 'draft.docx'.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I edit the underlying OOXML of a Word document to preserve tracked changes?

To edit Word document OOXML while preserving tracked changes, unpack the DOCX to XML, inspect the tracked-change markers, and apply schema-aware auto-repair to ensure structural integrity before rebuilding the file. This process keeps tracked changes and comments valid and render-safe.

Can I programmatically create a Word document with tables, images, and hyperlinks using docx-js?

Yes, you can generate new Word documents containing tables, images, hyperlinks, and footnotes using docx-js. This approach allows you to programmatically create professional reports, memos, or letters while maintaining correct OOXML formatting and page sizing.

What's the best way to validate a DOCX file for correct Office Open XML schema compliance?

The best way to validate DOCX schema compliance is to unpack the document to XML and validate it against Office Open XML schemas. This schema-aware validation checks for correct structure, smart-quote XML entities, and tracked-change markers, applying safe auto-repairs if needed.

Why does my Word document break after manually editing its internal XML structure?

Manually editing DOCX XML often breaks the document due to invalid OOXML structure, incorrect smart-quote entities, or malformed tracked-change and comment markers. Schema-aware validation and auto-repair steps are required to fix whitespace preservation and durableId limits before rebuilding.

Do I need LibreOffice or pandoc installed to convert and rebuild DOCX files?

Yes, converting and rebuilding DOCX files requires external dependencies like pandoc for format conversion, LibreOffice for document processing, and pdftoppm for rendering tasks. These tools ensure the generated or edited Word documents maintain their structural validity and formatting.

How do I extract and analyze comments from an existing DOCX file?

To extract and analyze comments from a DOCX file, unpack the document to its underlying XML components for inspection. This allows you to directly read the comment markers, reorganize content, and validate the OOXML structure to ensure all annotations are safely preserved.