docx

Create, edit, and analyze Word .docx documents using docx-js and OOXML manipulation.

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/Syedyasir001/RVULibPass --skill docx-syedyasir001
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/Syedyasir001/RVULibPass/tree/main/.agent/skills/library/docx
Command: npx skills add https://github.com/Syedyasir001/RVULibPass --skill docx-syedyasir001

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Working with Word documents programmatically is error-prone: .docx files are ZIP archives of XML with strict schema rules, and common libraries have pitfalls like broken tables, invalid page breaks, and lost tracked changes. This Skill provides tested workflows and scripts to create, read, and edit .docx files correctly. ## Core Features & Use Cases - Document Creation: Generate professional .docx files with docx-js, including tables, images, TOC, headers/footers, footnotes, hyperlinks, and multi-column layouts, with validation after generation. - Document Editing: Unpack existing .docx files, edit the raw XML directly, and repack with automatic validation and repair of common issues. - Tracked Changes & Comments: Add redlining (insertions/deletions), comments, and replies with proper OOXML structure, plus accept all tracked changes via LibreOffice. - Use Case: A user asks for a quarterly report as a Word file with a table of contents, styled headings, and a data table; the Skill generates it with docx-js, validates the output, and delivers a polished .docx. ## Quick Start Ask the assistant to create a Word document report with headings, a table of contents, and a formatted data table saved as a .docx 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 with JavaScript?▼

Use the docx npm library (docx-js) to build a Document object with Paragraph, Table, and ImageRun elements, then save it with Packer.toBuffer. Always set the page size explicitly since docx-js defaults to A4, and validate the output file afterward.

How do I edit an existing .docx file programmatically?▼

Unpack the .docx into its XML parts with the unpack script, edit the files under word/ directly, then repack with validation. A .docx is a ZIP archive of XML, so direct XML editing gives full control over content and formatting.

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

Wrap inserted text in w:ins elements and deleted text in w:del elements containing w:delText, with author and date attributes. Place these tags as siblings of w:r elements at paragraph level, never inside a run, or the XML becomes invalid.

Why does my docx table render with a black background or wrong width?▼

Black backgrounds come from using ShadingType.SOLID instead of ShadingType.CLEAR. Width issues occur when columnWidths and per-cell widths are missing or mismatched; always set both in DXA units and make them sum to the table width.

Can this skill handle PDFs or Google Docs?▼

No, it is scoped to .docx files only. It can convert .docx to PDF via LibreOffice for previewing, and legacy .doc files must first be converted to .docx before editing.

Why is my table of contents empty in the generated docx?▼

TableOfContents only picks up paragraphs using HeadingLevel constants with built-in heading style IDs like Heading1. Custom styles on heading paragraphs break TOC detection, and each heading style needs an outlineLevel value.