docx

Create and edit DOCX documents with tracked changes and comments via Python.

1|Updated Jan 5, 2026
One-click install
npx skills add https://github.com/wedsamuel1230/electronic-mcp-server --skill docx-wedsamuel1230
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/wedsamuel1230/electronic-mcp-server/tree/main/.github/skills/docx
Command: npx skills add https://github.com/wedsamuel1230/electronic-mcp-server --skill docx-wedsamuel1230

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides programmable automation for creating, editing, and reviewing Word documents (.docx) without manual drafting, enabling repeatable formatting, tracked changes, and inline comments.

Core Features & Use Cases

  • DOCX creation & editing: Generate new documents and modify existing ones while preserving formatting.
  • Tracked changes & comments: Apply redlining, insertions, deletions, and attach author notes to document blocks.
  • Automation for professional workflows: Integrates with Python scripts to batch-process documents, extract text, and prepare templates for reports or proposals.

Quick Start

Create a new Word document named Report.docx with a title and a paragraph, then apply a tracked change to replace "draft" with "final" and add a comment on the 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 editing with tracked changes and comments?

You can automate Word document editing by using Python scripts to apply tracked changes and insert inline comments directly into DOCX files. This approach leverages lxml and defusedxml libraries to safely modify WordprocessingML while preserving document formatting.

What is the best way to batch edit DOCX files for professional workflows?

The best way to batch edit DOCX files is by integrating Python scripts to programmatically process multiple documents, apply repeatable formatting, and prepare templates for reports or proposals without manual drafting.

Can I modify WordprocessingML safely without breaking document formatting?

Yes, you can modify WordprocessingML safely by relying on the defusedxml library to prevent XML vulnerabilities and lxml to accurately parse and update the DOCX structure, ensuring professional formatting is preserved during edits.

Does this DOCX automation approach support adding inline comments to document blocks?

Yes, this DOCX automation approach supports attaching author notes and inline comments to specific document blocks. It enables professional review workflows by programmatically applying redlining, insertions, and deletions.

Do I need Python and lxml to generate new Word documents programmatically?

Yes, you need Python to run the automation scripts, along with the lxml and defusedxml dependencies installed. These libraries handle the secure XML parsing and manipulation required to generate new DOCX documents and modify existing ones.

What are the limitations of using Python scripts for DOCX creation and redlining?

The primary limitation of using Python scripts for DOCX redlining is that it requires familiarity with WordprocessingML structure. Complex formatting may require careful XML manipulation to ensure defusedxml and lxml modifications do not disrupt the native document layout.