docx

Create, edit, and analyze Word .docx documents via OOXML manipulation.

6|3|Updated Dec 20, 2025
One-click install
npx skills add https://github.com/wanrengang/langchain-agent-framework --skill docx-wanrengang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/wanrengang/langchain-agent-framework/tree/main/src/skills/docx
Command: npx skills add https://github.com/wanrengang/langchain-agent-framework --skill docx-wanrengang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, and includes scripts (resource) components.

What problem does it solve?

This Skill eliminates the complexity of working with .docx files by providing structured workflows for creating new documents, editing existing ones, and managing tracked changes and comments—tasks that are otherwise difficult to perform reliably without deep knowledge of OOXML internals.

Core Features & Use Cases

  • Document Creation: Generate professional Word documents from scratch using JavaScript/TypeScript with precise formatting, styles, tables, and images.
  • Document Editing & Redlining: Modify existing documents with tracked changes (insertions and deletions) using a Python library that handles OOXML manipulation, RSIDs, and validation automatically.
  • Text Extraction & Analysis: Extract text content from .docx files using pandoc, or access raw XML for comments, complex formatting, and embedded media.
  • Use Case: A legal team needs to review a contract, make precise amendments with tracked changes, add comments, and produce a clean final version—all while preserving formatting and meeting compliance standards.

Quick Start

Use the docx skill to create a new Word document with a centered title, two headings, and a bulleted list, then save it as output.docx.

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 and redlining to a Word docx file programmatically?

You can add tracked changes and redlining to a Word docx file by manipulating its OOXML structure directly. This approach automatically handles insertions, deletions, RSIDs, and validation to preserve formatting for legal and business documents.

Can I generate a Word document from scratch using JavaScript?

Yes, you can generate Word documents from scratch using JavaScript. This enables the creation of professional .docx files with precise formatting, styles, tables, and images without needing to interact with a word processor interface.

What is the best way to extract text and comments from a docx file?

The best way to extract text and comments from a docx file is using pandoc for content extraction or accessing the raw XML directly. This allows you to capture complex formatting, embedded media, and comments reliably.

Do I need LibreOffice and pandoc to automate Word document editing?

Yes, you need LibreOffice and pandoc to automate Word document editing. These dependencies handle document conversion, text extraction, and validation, while defusedxml ensures secure XML processing of the OOXML files.

How does OOXML manipulation help with reviewing legal contracts?

OOXML manipulation helps with reviewing legal contracts by allowing precise amendments with tracked changes and comments. It ensures formatting is preserved and compliance standards are met when producing final versions.

Why use defusedxml for processing Word documents?

You should use defusedxml for processing Word documents to ensure secure XML parsing. It protects against malicious XML inputs when accessing raw document structures for complex formatting and comments.