docx

Create, edit, validate, and analyze Microsoft Word .docx files via Office Open XML.

199|41|Updated Oct 25, 2020
One-click install
npx skills add https://github.com/rvdbreemen/OTGW-firmware --skill docx-rvdbreemen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/rvdbreemen/OTGW-firmware/tree/main/.github/skills/docx
Command: npx skills add https://github.com/rvdbreemen/OTGW-firmware --skill docx-rvdbreemen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, lxml, validators, gcc, soffice, pandoc, pdftoppm, git, and includes scripts (resource) components.

What problem does it solve?

This Skill helps you generate, modify, and validate Word documents (.docx) without manually wrestling with the underlying Office XML structure.

Core Features & Use Cases

  • Create DOCX documents: Build new .docx files programmatically (including headings, tables, images, page breaks, and table of contents).
  • Edit existing DOCX documents: Safely unpack to XML, perform targeted XML edits, then repack into a valid .docx.
  • Analyze and repair Office structure: Unpack, validate against schemas, and auto-repair common OOXML issues (IDs, whitespace preservation, tracked change constraints).
  • Work with tracked changes and comments: Accept tracked changes, add structured comments, and handle XML comment markers correctly.

Quick Start

Use the docx skill to unpack 'contract.docx', make the required edits to the extracted XML, and repack it into 'contract-updated.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 and validate Office Open XML in .docx files?

To edit Office Open XML in .docx files, you unpack the document, apply targeted XML edits, and repack it into a valid file. This process validates against schemas and auto-repairs common OOXML issues like whitespace preservation and tracked-change nesting.

What is the best way to accept tracked changes and add comments to a Word document?

The best way to manage tracked changes and comments is to unpack the .docx XML, modify the tracked-change structures and comment markers, validate the nesting rules, and repack. This handles insertions, deletions, and structured comment marker validation correctly.

How do I convert legacy .doc files to .docx and then export to PDF?

You can convert legacy .doc files to .docx format and then export to PDF by applying controlled document transformations. This workflow unpacks the Office Open XML structure and uses conversion tools to generate the final PDF or image outputs.

Why does my .docx XML editing break document validation and table formatting?

Document validation fails during .docx XML editing when you violate schema-safe repacking rules, such as improper comment markers, incorrect tracked-change nesting, missing xml:space="preserve" for whitespace, or invalid table width constraints.

Can I generate new Word documents with tables, images, and a table of contents without manually writing XML?

Yes, you can generate new .docx documents featuring headings, tables, images, page breaks, and a table of contents without manually wrestling with the underlying Office XML structure by using controlled document transformations.

Does editing .docx files require specific XML schema knowledge for whitespace and tracked changes?

Editing .docx files requires correct DOCX XML editing patterns, including proper comment markers, tracked-change nesting rules, whitespace preservation via xml:space="preserve", and table width rules to ensure schema-safe repacking and validation.