docx

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

1|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/ankur3-101106/dotfiles-hypr --skill docx-ankur3-101106
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/ankur3-101106/dotfiles-hypr/tree/main/Claude/local-agent-mode-sessions/skills-plugin/ab436dd0-752a-4b9b-8503-dc6695d483cb/cedd2988-3bab-48aa-884f-cc7b3bfb8e81/skills/docx
Command: npx skills add https://github.com/ankur3-101106/dotfiles-hypr --skill docx-ankur3-101106

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires docx, defusedxml, lxml, pandoc, libreoffice, poppler, 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 runs, tracked changes require precise XML markup, and comments span six cross-linked files. This Skill provides tested workflows and scripts to create, edit, redline, comment on, and validate .docx and .dotx files reliably. ## Core Features & Use Cases - Document Creation: Generate new Word documents with the docx npm library, with guidance on page size, tables, lists, images, TOC, and page breaks. - Editing & Redlining: Unzip, edit word/document.xml directly, merge fragmented runs for find-and-replace, and wrap edits in tracked-change markup with validation against the original. - Comments & Cleanup: Add threaded comments via a helper script that writes all satellite XML files, and accept all tracked changes through LibreOffice. - Use Case: A lawyer asks you to redline a contract: unpack the .docx, merge runs, edit the XML with w:ins/w:del wrappers, then validate with --author to confirm every change is tracked. ## Quick Start Use the docx skill to create a professional Word report with a table of contents, headings, and page numbers, then render it to PDF to verify the layout.

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 defines paragraphs, tables, and sections. Watch for gotchas: page size defaults to A4, tables need both columnWidths and per-cell widths in DXA, and lists require a numbering config rather than literal bullet characters.

How do I edit an existing .docx file?▼

Unzip the .docx, edit word/document.xml in place without reformatting, then rezip. Run merge_runs.py first because Word splits text across many runs, so target phrases often are not contiguous strings in the XML. Validate the result with validate.py against the original.

How do I add tracked changes to a Word document?▼

Wrap inserted runs in w:ins and deleted runs in w:del elements with w:id, w:author, and w:date attributes; deleted text uses w:delText instead of w:t. Validate with validate.py --original file.docx --author "Name" to catch any edit missing tracked-change markup.

Can docx-js open and modify existing Word files?▼

No, docx-js only creates new documents and cannot open existing files. To modify an existing .docx, unzip it, edit the XML directly, and rezip, or use pandoc to read content and LibreOffice for format conversions.

Why does find-and-replace fail in word/document.xml?▼

Word fragments visible text across many w:r runs due to revision IDs and spell-check markers, so a phrase rarely exists as one contiguous string. Run merge_runs.py to coalesce adjacent identically-formatted runs before searching; rendering is unchanged.

How do I add comments to a .docx file programmatically?▼

Use comment.py against an unpacked directory or a .docx directly; it writes comments.xml, commentsExtended.xml, commentsIds.xml, and commentsExtensible.xml plus relationships and content types. Then place the printed commentRangeStart/End markers in document.xml to anchor the comment to text.