docx

Create and edit .docx files using Python and JavaScript libraries.

Updated Mar 15, 2025
One-click install
npx skills add https://github.com/mrdonlee/dotfiles --skill docx-mrdonlee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/mrdonlee/dotfiles/tree/main/.agents/skills/docx
Command: npx skills add https://github.com/mrdonlee/dotfiles --skill docx-mrdonlee

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the creation, editing, and manipulation of Microsoft Word documents (.docx files), streamlining the process of generating professional reports, letters, and other formatted documents.

Core Features & Use Cases

  • Document Generation: Create new .docx files from scratch using JavaScript with the docx-js library, including complex formatting like tables, lists, headers, and footers.
  • Document Editing: Modify existing .docx files by unpacking, editing XML content, and repacking, including accepting tracked changes and adding comments.
  • Conversion: Convert between document formats (e.g., .doc to .docx) and extract content using tools like pandoc.

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 automate Word document generation with tables of contents and formatting?

Automating Word document generation involves using the docx-js library to programmatically create .docx files with complex formatting, including tables of contents, headings, and letterheads.

Can I extract and reorganize content or insert images into existing .docx files?

Yes, you can extract and reorganize content or insert images into existing .docx files by unpacking the document, directly editing the XML content, and repacking it.

What is the best way to convert .doc files to .docx format?

The best way to convert .doc files to .docx format is by using pandoc, which efficiently handles document format conversion and extracts content for further manipulation.

Does this approach support working with tracked changes and comments in Word documents?

Yes, this approach supports working with tracked changes and comments in Word documents, allowing you to programmatically accept tracked changes and add comments to the file.

Do I need pandoc and LibreOffice installed to manipulate Word documents with code?

Yes, you need pandoc, LibreOffice, and Poppler installed in your environment, as these dependencies provide the core conversion, rendering, and image extraction capabilities for Word documents.

How does find-and-replace work when editing .docx files programmatically?

Find-and-replace works by unpacking the .docx file, locating the target text strings within the underlying XML structure, replacing them with new content, and repacking the document.