docx

Generate and edit .docx files with tracked changes using Python OOXML.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the creation, editing, and analysis of Word documents (.docx) by providing structured workflows for drafting, redlining, commenting, and tracking changes, reducing manual overhead and errors.

Core Features & Use Cases

  • Document creation: Generate new .docx files with consistent styles and formatting.
  • Editing & redlining: Make precise edits and track changes while preserving original formatting.
  • Comments & collaboration: Attach comments and manage review feedback within the document lifecycle.
  • Use Case: A legal draft with multiple reviewers can be processed to produce a clean, tracked-changes document ready for client review.

Quick Start

Create a new Word document using the skill, apply a simple template, and verify basic formatting.

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 tracked changes and comments?

Automating Word document generation with tracked changes and comments is achieved by manipulating OOXML data using Python libraries like lxml and defusedxml. This approach parses WordprocessingML to apply precise edits, redlining, and review feedback while preserving original formatting.

What is the best way to programmatically redline a .docx file for multiple reviewers?

Programmatically redlining a .docx file for multiple reviewers involves structured workflows that parse and edit WordprocessingML data. By manipulating the underlying OOXML structure, you can insert tracked changes and attach comments to produce a clean, collaborative document ready for final review.

Can I modify Word documents with Python without losing existing formatting?

Modifying Word documents with Python without losing existing formatting is possible by directly manipulating the OOXML structure. Using lxml to parse and edit WordprocessingML data ensures that text modifications, style adjustments, and tracked changes are applied while maintaining the document's original layout.

Does Python OOXML manipulation work for adding comments to legal drafts in Word?

Python OOXML manipulation works effectively for adding comments to legal drafts in Word. By parsing WordprocessingML data with libraries like defusedxml and lxml, you can attach review feedback and manage collaboration workflows, ensuring all comments are accurately embedded within the document lifecycle.

How do I create new .docx files with consistent styles using document automation?

Creating new .docx files with consistent styles using document automation requires generating and structuring OOXML data via Python. By programmatically defining WordprocessingML elements and applying templates, you ensure uniform formatting and styling across newly generated Word documents.

What are the limitations of using defusedxml and lxml for Word document editing?

Limitations of using defusedxml and lxml for Word document editing stem from the complexity of raw OOXML manipulation. Because you interact directly with WordprocessingML data, handling highly complex formatting or advanced Word features programmatically can require extensive XML structuring and lacks native application-level abstractions.