docx

Generate or transform Microsoft Word .docx files by editing OOXML safely.

16|2|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/thtskaran/claude-skills --skill docx-thtskaran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/thtskaran/claude-skills/tree/main/docx
Command: npx skills add https://github.com/thtskaran/claude-skills --skill docx-thtskaran

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python, pandoc, npm (docx), LibreOffice (soffice), poppler (pdftoppm), validators, lxml, and includes scripts (resource) components.

What problem does it solve?

This Skill helps you create, edit, and validate professional Word (.docx) documents while avoiding common DOCX corruption pitfalls caused by invalid XML, broken relationships, or incorrect tracked-change/comment structure.

Core Features & Use Cases

  • Create DOCX from scratch: Programmatically generate .docx files (including headers/footers, tables, images, TOC-friendly headings, and page settings).
  • Edit existing DOCX at the XML level: Unpack a DOCX into editable XML, make targeted edits, then repack and validate to produce a working Word file.
  • Work with tracked changes & comments: Add and accept tracked changes and insert Word comments reliably using the provided tooling.
  • Convert and render pages to images/PDF: Convert DOCX to PDF (and optionally rasterize pages) for previewing or downstream processing.

Quick Start

Use the docx skill to convert an existing document into an editable Word file by unpacking it, applying the requested formatting/text changes, and then packing it back into a new .docx.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I edit an existing Word document without corrupting the file?

To safely edit an existing Word document, unpack the .docx file into editable XML, apply targeted text or formatting changes, then repack and validate the OOXML structure to produce a working file.

How do I programmatically add tracked changes and comments to a DOCX file?

You can insert tracked changes and comments into a DOCX file by using the provided tooling to generate the correct tracked-change and comment marker structures within the document.xml during the unpack and repack process.

What's the best way to generate a Word document from scratch with tables and images?

The best way to generate a Word document from scratch is to programmatically create the .docx file, building structures like headers, footers, tables, images, and TOC-friendly headings directly into the OOXML output.

Does editing OOXML directly require schema validation to prevent file corruption?

Yes, direct OOXML editing requires schema, relationship, and ID validation to avoid common DOCX corruption pitfalls caused by invalid XML, broken relationships, or incorrect tracked-change marker structure.

Can I convert a DOCX file to PDF for previewing or downstream processing?

Yes, you can convert DOCX files to PDF and optionally rasterize document pages to images for previewing or for use in downstream processing workflows.

Why do my Word documents break after inserting text with smart quotes?

Word documents break after inserting text because the OOXML requires correct smart-quote XML entities and xml:space preservation rules to maintain valid document structure when repacking the file.