docx

Automates .docx generation, XML editing, validation, and repacking workflows using docx-js, pandoc and LibreOffice scripts.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, lxml, and includes scripts (resource) components.

What problem does it solve?

It eliminates the need to manually unzip, edit, and repackage Word documents by providing a complete workflow for generating, editing, validating, and repacking .docx files with professional formatting and tracked changes.

Core Features & Use Cases

  • Programmatic Creation: Build new .docx documents with docx-js, explicit page size, styles, numbered lists, tables, images, headers/footers, and TOC entries so every deliverable looks like it came from a professional template.
  • Instance Editing & Validation: Unpack existing archives, edit XML with enforced tracked change rules, accept changes via LibreOffice macros, add comments, and rerun schema + relationship validators to keep files compliant.
  • Use Case: Turn messy meeting notes plus a spreadsheet of metrics into a US Letter report with headings, tables, hyperlinks, and tracked comments to send back to stakeholders.

Quick Start

Ask the docx skill to convert the provided notes and numbers into a polished Word report with headings, TOC, tables, and tracked comments.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I automate Word document creation with styled templates and tracked changes?

You can automate Word document creation by using docx-js to build files with explicit page sizes, styles, numbered lists, tables, and tracked changes. This workflow handles professional formatting and XML-level adjustments without manual unzipping.

What's the best way to edit an existing docx file and apply tracked changes programmatically?

To edit an existing docx file programmatically, you can unpack the archive, modify the XML with enforced tracked change rules, add comments, and repack it. LibreOffice macros can then accept changes while schema validators ensure the file remains compliant.

Does LibreOffice work with docx files for validation and accepting tracked changes?

Yes, LibreOffice works with docx files by running helper scripts and macros to validate the archive and accept tracked changes. It integrates into the workflow alongside pandoc for extraction and docx-js for document generation.

Can I convert meeting notes and spreadsheet metrics into a formatted Word report?

Yes, you can convert meeting notes and spreadsheet metrics into a formatted Word report. The process programmatically generates a document with headings, tables, hyperlinks, TOC entries, and tracked comments to send back to stakeholders.

Why do I need XML tooling like lxml and defusedxml to edit Word documents?

You need XML tooling like lxml and defusedxml to safely unpack, edit, and repack the Word document archive. These dependencies allow precise XML-level adjustments for tables or images while enforcing schema and relationship validation.

What are the limitations of using docx-js for Word document automation?

While docx-js handles programmatic document generation with styled templates, it requires additional tools like pandoc and LibreOffice for extraction, conversion, and validation. Complex XML-level adjustments for tables or images also require separate XML tooling to maintain compliance.