docx

Create and edit .docx files using docx-js and pandoc.

2.6k|130|Updated Jun 6, 2025
One-click install
npx skills add https://github.com/UnicomAI/wanwu --skill docx-unicomai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/UnicomAI/wanwu/tree/main/configs/microservice/bff-service/configs/agent-skills/anthropics/docx
Command: npx skills add https://github.com/UnicomAI/wanwu --skill docx-unicomai

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the creation and modification of professional Word documents, eliminating the need for manual formatting and complex operations.

Core Features & Use Cases

  • Document Generation: Create new .docx files from scratch using JavaScript libraries, including complex layouts, tables, lists, and styles.
  • Document Editing: Modify existing .docx files by unpacking, editing XML, and repacking, including handling tracked changes and comments.
  • Use Case: Generate a client report with specific formatting, tables of contents, and tracked changes, or automatically accept all tracked changes in a document before sending it.

Quick Start

Use the docx skill to create a new Word document with a title and a paragraph.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I automatically generate Word documents with specific formatting and tables?

Automating Word document generation is handled by creating new .docx files from scratch using the docx-js library. This process supports building complex layouts, tables, lists, and custom styles programmatically without manual formatting.

Can I modify existing .docx files to accept tracked changes before sending?

Editing existing .docx files is achieved by unpacking the document, editing the underlying XML, and repacking it. This method allows you to manipulate document contents, including automatically accepting all tracked changes and managing comments.

Do I need pandoc and npm packages to convert and manipulate Word documents?

Pandoc and the npm package 'docx' are required dependencies for this Word document manipulation process. Pandoc handles format conversions, while the docx-js library drives the creation, styling, and structural XML editing of the files.

What is the best way to add headers, footers, and page layouts to a Word document programmatically?

The best way to add headers, footers, and page layouts programmatically is using the docx-js library within this document generation workflow. It directly manages structural document elements like styles, page layouts, and section formatting.

Does this Word document automation approach support conversions between different file formats?

Format conversions for Word documents are supported through the integrated pandoc dependency. This allows you to transform generated or edited .docx files into other required formats while preserving the applied formatting and structural layouts.

How does editing the XML inside a .docx file work for updating document styles?

Editing XML inside a .docx file works by unpacking the original document, directly modifying the structural XML code to apply new styles or tracked changes, and then repacking it into a valid Word document format.