docx

Create, edit, and analyze Microsoft Word DOCX files with OOXML workflows.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, PIL, lxml, soffice, poppler-utils, pandoc, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill solves the problem of creating and modifying Microsoft Word (.docx) documents reliably, including performing professional tracked changes, comments, and complex formatting-safe edits.

Core Features & Use Cases

  • Create DOCX from scratch using docx-js with consistent styling, list/table structures, and professional formatting patterns.
  • Edit existing DOCX (OOXML) safely by unpacking, editing the underlying XML, and repacking while preserving structure and formatting.
  • Perform compliant redlining workflows for single-author or third-party/legal/business documents using tracked changes with strong validation guidance.
  • Extract and analyze DOCX content via pandoc conversion to markdown (including tracked changes visibility) and raw OOXML/ZIP/XML inspection.
  • Add comments and images by manipulating Word OOXML comment parts, relationships, and media insertion steps.

Quick Start

Use the docx skill to redline edit the attached file 'contract.docx' by unpacking it, planning changes in batches, applying tracked insertions/deletions, and repacking the final document.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I add tracked changes to a Word docx file programmatically?

To add tracked changes to a docx file, you unpack the document, edit the underlying OOXML to insert w:ins and w:del elements, validate the construction patterns, and repack the file to avoid document corruption.

Can I extract text and raw XML structure from an existing docx file?

Yes, you can extract text and raw XML structure from a docx file by inspecting the raw OOXML/ZIP/XML parts directly or by using pandoc-based conversion to output readable markdown content.

What is the safest way to redline edit a Word document without breaking formatting?

The safest way to redline edit a Word document is to unpack the docx, modify the internal OOXML structure while preserving existing formatting, and repack it using strict tracked-change validation.

Does this approach support adding comments and images to existing docx files?

Yes, this approach supports adding comments and images to existing docx files by manipulating Word OOXML comment parts, managing relationships, and executing the required media insertion steps.

How do I create a new Word document from scratch with consistent styling?

You can create a new Word document from scratch with consistent styling, list and table structures, and professional formatting patterns by generating the docx file through OOXML-aware workflows.

What are the limitations of editing docx files through raw OOXML manipulation?

Editing docx files through raw OOXML manipulation risks document corruption if tracked changes are not constructed using strict w:ins/w:del validation patterns during the unpacking and repacking process.