docx

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

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/SESELOVSKYDarian/Vase --skill docx-seselovskydarian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/SESELOVSKYDarian/Vase/tree/main/.agents/skills/docx
Command: npx skills add https://github.com/SESELOVSKYDarian/Vase --skill docx-seselovskydarian

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 files are ZIP archives of XML with strict schema rules, and common libraries have pitfalls like wrong default page sizes, broken tables, and invalid tracked changes. This Skill provides tested workflows and validation scripts to create, read, and edit .docx files correctly. ## Core Features & Use Cases - Document Creation: Generate professional .docx files with docx-js, including styles, tables, images, headers/footers, footnotes, hyperlinks, multi-column layouts, and tables of contents. - Document Editing: Unpack existing .docx files, edit the raw XML directly, and repack with schema validation and auto-repair, supporting tracked changes and threaded comments. - Content Extraction & Conversion: Extract text with pandoc, convert legacy .doc files, accept tracked changes via LibreOffice, and render pages to images. - Use Case: A user asks for a quarterly business report as a Word file with a table of contents, styled headings, and a data table; the Skill generates it with docx-js and validates the output before delivery. ## 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 paragraphs, tables, and images, then write 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 XML in the word/ directory directly, then repack with the pack script which validates against OOXML schemas and auto-repairs common issues.

How do I add tracked changes to a Word document?

Insert w:ins and w:del elements around the affected runs in document.xml, replacing entire w:r blocks rather than injecting tags inside runs. Preserve the original run's w:rPr formatting and use w:delText instead of w:t inside deletions.

Why do my docx-js tables render incorrectly?

Tables need dual widths: set columnWidths on the table and a matching width on each cell, both in DXA units, with the column widths summing to the table width. Avoid WidthType.PERCENTAGE because it breaks in Google Docs.

Can this skill handle PDFs or Google Docs?

No, it is scoped to .docx files only. Legacy .doc files must first be converted to .docx with LibreOffice before editing, and PDFs or spreadsheets require different tooling.

How do I convert a .docx to PDF or images?

Run LibreOffice headless via the soffice script with --convert-to pdf, then use pdftoppm from Poppler to render PDF pages as JPEG images at your chosen resolution.