docx

Create, edit, and validate Word .docx documents via OOXML manipulation.

Updated Jun 21, 2025
One-click install
npx skills add https://github.com/seriiserii825/dotfiles --skill docx-seriiserii825
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/seriiserii825/dotfiles/tree/main/apps/claude/skills/synced/48e265c5-be08-4ca3-88ab-78707f398de7_1df978a8-b501-4d2b-b556-83317b565971/docx
Command: npx skills add https://github.com/seriiserii825/dotfiles --skill docx-seriiserii825

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Working with Word documents programmatically is error-prone: docx-js cannot open existing files, Word fragments text across XML runs, tracked changes require precise markup, and invalid OOXML produces corrupt files. This Skill provides tested workflows and scripts for creating, editing, reading, and validating .docx and .dotx files. ## Core Features & Use Cases - Document Creation: Generate new Word documents with the docx npm library, with guidance on page size, tables, lists, images, and tables of contents. - Editing & Redlining: Unzip, edit word/document.xml directly, merge fragmented runs for reliable find-and-replace, and manage tracked changes with validation. - Comments & Validation: Add threaded comments with all required satellite XML files, accept tracked changes via LibreOffice, and run XSD schema validation with auto-repair. - Use Case: Redline a contract by unpacking the .docx, wrapping edits in tracked-change elements, then validating with the author flag to confirm every change is properly recorded. ## Quick Start Ask the assistant to create a polished Word report with a table of contents, or to edit and redline an existing .docx contract file.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I create a Word document programmatically with docx-js?

Write a Node script that requires the preinstalled docx npm package and builds paragraphs, tables, and images. Set page size in DXA units, use numbering configs for bullets instead of literal characters, and render the output to PDF for visual verification.

How do I edit an existing .docx file?

Unzip the .docx, edit word/document.xml directly without reformatting, then rezip. Run merge_runs.py first to coalesce fragmented runs so target text is findable, and validate the result against the original with the XSD validator.

Why does find-and-replace fail in Word document XML?

Word splits visible text across many w:r runs due to revision IDs and spell-check markers, so phrases rarely exist as contiguous strings. The merge_runs.py script merges adjacent identically formatted runs without changing rendering.

How do I add tracked changes to a Word document?

Wrap inserted runs in w:ins and deleted runs in w:del with id, author, and date attributes, using w:delText inside deletions. Validate with the --author flag to catch any edits missing tracked-change markup.

Can this skill handle PDFs or Google Docs?

No, it only handles .docx and .dotx files. Legacy .doc files must first be converted to .docx with LibreOffice, and PDFs, spreadsheets, and Google Docs are explicitly out of scope.