docx

Create, read, and edit .docx files using docx-js and XML manipulation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill empowers you to programmatically create, edit, and manipulate Microsoft Word (.docx) documents, automating complex document generation and modification tasks.

Core Features & Use Cases

  • Programmatic Document Creation: Generate new .docx files from scratch using JavaScript and the docx-js library, including complex formatting, tables, lists, and headers/footers.
  • Document Editing & Manipulation: Unpack existing .docx files, edit their XML structure, and repack them, enabling find-and-replace, tracked changes, and comment management.
  • Conversion & Formatting: Convert between document formats (e.g., .doc to .docx), accept tracked changes, and ensure consistent page sizing and styling.
  • Use Case: Automatically generate personalized offer letters for new hires, incorporating their name, role, and salary into a pre-defined template, and then save it as a .docx file.

Quick Start

Create a new Word document with a title "Project Proposal" and a heading "Introduction" using the docx skill.

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 with JavaScript?

Automate Word document generation with JavaScript by using the docx-js library to programmatically build .docx files. You can structure professional documents containing specific formatting, tables, lists, images, and headers from scratch.

How can I edit tracked changes and comments in an existing .docx file?

Edit tracked changes and comments in an existing .docx file by unpacking the document, manipulating its underlying XML structure, and repacking it. This approach also enables targeted find-and-replace actions within the file.

Can I convert .doc files to .docx format programmatically?

Yes, you can convert .doc files to .docx format programmatically. The process supports converting between document formats and ensures consistent page sizing and styling while accepting existing tracked changes.

Do I need python-docx to generate Word documents with this approach?

You do not strictly need python-docx to generate Word documents, as creation primarily uses the docx-js library. However, python-docx and pandoc are available dependencies for handling conversions, validation, and alternative document manipulation tasks.

What is the best way to insert tables and images into a Word document via code?

The best way to insert tables and images into a Word document via code is using the docx-js library. It handles complex formatting natively, allowing you to define structural elements like tables, lists, and images programmatically.

Are there limitations when manipulating XML directly to modify Word documents?

Manipulating XML directly to modify Word documents requires unpacking and repacking files, which can be complex. You must ensure proper XML structure to avoid file corruption, though the process supports validation of generated documents.