docx

Generate, edit, and validate .docx documents via OOXML XML conversions.

4|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/shushuzn/Rairos --skill docx-shushuzn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/shushuzn/Rairos/tree/main/skills/docx
Command: npx skills add https://github.com/shushuzn/Rairos --skill docx-shushuzn

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill solves the problem of producing and modifying professional .docx (Word) documents reliably, including correct layout elements and accurate formatting, without manual, error-prone Office UI work.

Core Features & Use Cases

  • Generate .docx documents: Build new Word documents with consistent page setup (US Letter/A4), styles, lists, tables, page breaks, headers/footers, hyperlinks, footnotes, and multi-column layouts using docx-js.
  • Edit existing .docx documents: Unpack DOCX to XML, perform targeted XML edits (including tracked changes and comments), then repack into a valid, Word-compatible file.
  • Validate and repair: Validate unpacked Word XML against Office schema/XSD rules and apply common repairs (e.g., whitespace preservation and durableId constraints) to reduce corruption risk.
  • Use case: Turn a research report draft into a publication-ready Word memo with a styled table of contents, correctly sized tables, embedded images, and footnotes for citations.

Quick Start

Use the docx skill to create a new Word memo from your provided outline, including headings, a table of contents, and page numbers, then return the generated .docx file.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I generate a Word document with a table of contents and page numbers programmatically?

Generate a Word document with a table of contents and page numbers using docx-js to build consistent page setups, lists, tables, headers, footers, and multi-column layouts for professional deliverables.

Can I edit existing Word documents to add tracked changes and comments?

Edit existing Word documents by unpacking DOCX to XML, performing targeted XML edits to add tracked changes and comments, then repacking into a valid, Word-compatible file.

What is the best way to validate OOXML structure and repair corrupted Word files?

Validate OOXML structure and repair Word files by validating unpacked XML against Office schema/XSD rules, applying common repairs like whitespace preservation and durableId constraints to reduce corruption risk.

How does converting between file-level and OOXML XML representations work for document formatting?

Converting between file-level and OOXML XML representations works by unpacking the DOCX structure, applying targeted XML edits for tables and lists, and repacking with deterministic generation and schema validation.

Do I need pandoc and soffice installed to create and edit Word documents?

You need pandoc, soffice, and related libraries like lxml and defusedxml installed to enable document conversion, XML parsing, and schema validation for reliable Word document generation and editing.

Why does my generated Word file have incorrect page sizing or formatting issues?

Incorrect page sizing or formatting in generated Word files often occurs due to missing explicit page setup constraints during docx-js generation, requiring schema validation and auto-repair for OOXML constraints.