docx

Generate and edit .docx files using JavaScript and XML-based manipulation.

15|3|Updated Aug 28, 2025
One-click install
npx skills add https://github.com/cheatcode-ai/cheatcode --skill docx-cheatcode-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/cheatcode-ai/cheatcode/tree/main/skills/docx
Command: npx skills add https://github.com/cheatcode-ai/cheatcode --skill docx-cheatcode-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandoc, docx, LibreOffice, Poppler, and includes scripts (resource) components.

What problem does it solve?

This skill solves the complexity of programmatically generating, editing, and analyzing Word documents, ensuring consistent formatting and structure without manual intervention.

Core Features & Use Cases

  • Document Generation: Create complex .docx files with tables, headers, footers, and custom styles using JavaScript.
  • Content Manipulation: Perform find-and-replace, extract text, and manage tracked changes or comments within existing documents.
  • Use Case: Automatically generate a polished, branded report from raw data, including a table of contents and specific page layouts, or programmatically update a legal contract with new terms while preserving existing tracked changes.

Quick Start

Use the docx skill to create a new professional report document with a table of contents and custom heading styles based on the provided data.

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 generation from raw data?

You can automate Word document generation by using JavaScript to create .docx files with custom styles, headers, footers, and tables. This approach programmatically builds complex layouts and structured reports without manual formatting.

What is the best way to update a legal contract in a .docx file while preserving tracked changes?

The best way to update a legal contract while preserving tracked changes is through XML-based editing. This method manipulates the document schema directly, allowing you to manage existing comments and revisions without breaking the tracked change history.

Does automated .docx manipulation require Pandoc and LibreOffice to maintain formatting?

Yes, automated .docx manipulation requires Pandoc, LibreOffice, and the docx library. These dependencies ensure schema compliance, cross-platform compatibility, and accurate rendering of complex layouts, tables, and custom heading styles.

Can I extract text and perform find-and-replace across existing Word documents programmatically?

You can extract text and perform find-and-replace across existing Word documents programmatically. This skill handles content manipulation directly through XML editing, allowing automated updates to text while maintaining the original document structure.

How do I build a Word report with a table of contents and specific page layouts via code?

Building a Word report with a table of contents and specific page layouts involves JavaScript-driven generation. You define custom heading styles and structural elements programmatically to automatically output a polished, branded document from your provided data.

Why use XML-based editing instead of standard libraries for complex table formatting in Word documents?

XML-based editing is used for complex table formatting because it directly manipulates the underlying document schema. This ensures precise structural control and schema compliance for automated document workflows, avoiding the formatting limitations of standard libraries.