docx

Edit and validate Word .docx files by manipulating document XML.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/dobrinz123/claude-skills-share --skill docx-dobrinz123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/dobrinz123/claude-skills-share/tree/main/anthropic-skills/docx
Command: npx skills add https://github.com/dobrinz123/claude-skills-share --skill docx-dobrinz123

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Many users need to produce, modify, or repair professional Microsoft Word documents but struggle with the DOCX ZIP/XML format, tracked changes, images, tables, and cross-platform rendering problems. This Skill centralizes best practices and tooling to create polished .docx outputs, safely edit existing documents (including tracked changes and comments), and validate or repair Office XML so documents remain compatible across Word, LibreOffice, and cloud editors.

Core Features & Use Cases

  • Create polished DOCX: Generate new Word documents with explicit page sizes, styles, TOC, headers/footers, multi-column layouts, and correct table/ image handling using docx-js guidance.
  • Edit existing DOCX: Unpack DOCX archives, safely edit word XML (preserve runs, smart quotes, styles), manage tracked changes and comments, then repack and validate.
  • Validation & Repair: Run XSD and redlining validations, auto-repair common issues (durableId/paraId limits, xml:space preservation), and optionally accept tracked changes via LibreOffice macros.
  • Use Case Examples: Convert legacy .doc to .docx, insert/replace images and alt text, perform find-and-replace while preserving tracked changes, merge adjacent runs for cleaner XML, or generate a final deliverable with an accepted-changes clean output.

Quick Start

Use the docx skill to unpack a document, apply edits (comments, image insertion, or content replacement), validate and repack into a clean, schema-compliant DOCX file.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I edit a Word docx file by modifying the underlying XML?

To edit a Word docx file, you unpack the DOCX ZIP package, directly modify the document XML while preserving runs and styles, then repack it into a clean, schema-compliant file. This ensures your structural edits remain compatible across Word and LibreOffice.

What is the best way to programmatically add and manage tracked changes in a docx file?

Managing tracked changes in a docx file involves unpacking the archive, manipulating the redline markers within the Word XML, and running a redlining validator before repacking. You can also use LibreOffice macros to automatically accept tracked changes for final output generation.

How do I validate and repair Office XML when a docx file is corrupted?

You validate and repair Office XML by running XSD schema validations against the unpacked document XML and applying auto-repair fixes for common issues like durableId limits and xml:space preservation. This process restores compatibility with cloud editors and desktop applications.

Can I use LibreOffice to convert legacy doc files to docx format?

Yes, LibreOffice is used to convert legacy doc files to docx format and optionally accept tracked changes via macros. The Skill handles cross-platform rendering problems by ensuring the generated docx XML passes validation and renders correctly across different editors.

How do I create a new Word document with a table of contents and multi-column layout?

Creating a polished docx with a TOC and multi-column layout uses docx-js guidance to explicitly set page sizes, apply styles, and handle correct table and image embedding. You then pack the XML into a standard DOCX ZIP structure for distribution.