docx

Create, edit, and validate Word .docx documents via XML workflows.

18|6|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/alter123-zz/RaccoonClaw --skill docx-alter123-zz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/alter123-zz/RaccoonClaw/tree/main/skills/docx
Command: npx skills add https://github.com/alter123-zz/RaccoonClaw --skill docx-alter123-zz

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Enable reliable, programmatic creation, editing, and validation of Microsoft Word .docx files so users can produce polished documents, manage tracked changes and comments, and fix XML-level issues without manual Office UI work.

Core Features & Use Cases

  • Create formatted DOCX: Guidance and templates for generating Word documents with tables of contents, headers/footers, page size, numbering, lists, tables, and images using docx-js (npm docx) patterns.
  • Unpack → Edit → Pack workflow: Tools and scripts to unpack DOCX to XML, merge runs, simplify or apply tracked changes, add comments, validate against OOXML XSDs, and repack with auto-repair.
  • Tracked changes & comments: Consistent patterns for insertions, deletions, comment markers, and author handling (defaults to "Claude" unless specified).
  • Conversions & tooling: Helpers for converting legacy .doc to .docx and DOCX → PDF/images via LibreOffice; includes a LibreOffice shim for sandboxed environments.
  • Validation & safety: XSD-based validators and relationship/content-type checks to detect broken references, duplicate IDs, and other corruption that would make documents appear corrupt.

Quick Start

Unpack report.docx, accept or apply tracked changes and comments as requested, perform the XML edits or image replacements, and repack to produce report-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 edit a Word .docx file without opening Microsoft Word?

To edit a .docx file programmatically, you unpack the document to its underlying XML, apply changes like text replacements or image insertions, and repack it. This workflow bypasses the Office UI by directly manipulating the OOXML structure using Python scripts.

What is the best way to automate tracked changes and comments in Word documents?

Automating tracked changes and comments involves unpacking the DOCX to XML and inserting specific OOXML markers for insertions, deletions, and comment ranges. The Skill provides consistent patterns for author handling, defaulting to a specified author like "Claude" during the unpack-edit-pack workflow.

Do I need LibreOffice to convert legacy .doc files to .docx format?

Yes, converting legacy .doc files to .docx requires LibreOffice. The Skill includes a LibreOffice shim designed for sandboxed environments to handle legacy format conversions and export DOCX files to PDF or images reliably.

How can I validate a corrupted .docx file and fix broken XML references?

Validating a .docx file involves running XSD-based validators and relationship checks against the unpacked XML. This process detects broken references, duplicate IDs, and content-type issues that make documents appear corrupt, allowing for auto-repair during the repacking stage.

Can I generate Word documents with tables of contents and headers using docx-js?

Yes, generating Word documents with complex formatting like tables of contents, headers, footers, and custom page sizes uses docx-js patterns. The Skill provides templates and guidance for programmatically building these structured DOCX files without manual formatting.

Why does my generated .docx file appear corrupt when opened in Microsoft Word?

A generated .docx file appears corrupt when internal XML references are broken or duplicate IDs exist. Running XSD-based validation and relationship content-type checks before repacking identifies these structural issues so you can apply auto-repair to produce a valid document.