DOCX Reviewer
Skill for programmatically enabling track changes (Review Mode) and inserting revisions in Microsoft Word DOCX files using Python.
Install
mkdir -p .claude/skills/docx-reviewer && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13727" && unzip -o skill.zip -d .claude/skills/docx-reviewer && rm skill.zipInstalls to .claude/skills/docx-reviewer
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Skill for programmatically enabling track changes (Review Mode) and inserting revisions in Microsoft Word DOCX files using Python.About this skill
📝 DOCX Reviewer (REVISION-01)
"What is changed must be seen. What is seen must be traceable." — Nachvollziehbarkeit
Purpose
The docx_reviewer skill enables the programmatic management of "Track Changes" (Review Mode) in Microsoft Word .docx documents. Since standard libraries like python-docx do not support this natively, this skill uses a combination of python-docx and deep XML manipulation of the WordprocessingML structure.
Capabilities
- Global Toggle: Enable or disable "Track Changes" for the entire document (any subsequent manual edits in Word will be tracked).
- Revision Injection (Advanced): Programmatically insert
<w:ins>(insertion) and<w:del>(deletion) tags to simulate a human reviewer's edits. - Audit Trail: Metadata injection for "Author" and "Timestamp" of revisions.
Prerequisites
- Python 3.x
python-docxlibrary (pip install python-docx)lxmllibrary (pip install lxml)
Implementation: Global Toggle (Track Changes)
To enable "Track Changes" in a document, the <w:trackRevisions /> element must be present in word/settings.xml.
Shared Command Line (Python)
import os
from docx import Document
from docx.oxml.shared import qn
from docx.oxml import OxmlElement
def enable_track_changes(doc_path, output_path=None):
"""
Enables 'Track Changes' in a DOCX file.
Note: This sets the global flag in settings.xml.
"""
doc = Document(doc_path)
# Access the settings XML
settings_root = doc.settings.element
# Find or create <w:trackRevisions />
track_revisions = settings_root.find(qn('w:trackRevisions'))
if track_revisions is None:
track_revisions = OxmlElement('w:trackRevisions')
settings_root.append(track_revisions)
if output_path:
doc.save(output_path)
else:
doc.save(doc_path)
return True
Implementation: Redlining (Tracked Edits)
To record a programmatic edit as a "Tracked Change" (redline), you cannot simply replace text. You must wrap the new text in a <w:ins> element and the removed text in a <w:del> element.
XML Structure for Insertion
<w:ins w:id="0" w:author="Antigravity" w:date="2026-03-26T14:45:00Z">
<w:r>
<w:t>New text content</w:t>
</w:r>
</w:ins>
Guidance for the Agent
- Enable Review Mode first by modifying
settings.xml. - Compare versions using
Python-Redlinesor by iterating through paragraphs and swappingw:tforw:ins/w:delblocks. - Always set the Author to
Antigravityor requested Persona for traceability.
Usage Scenarios
- LOI/Contract Review: Proposing changes while keeping the original visible.
- Patent Editing: Tracking claim updates for examiner review.
- Collaboration: Working with a USER who needs to see exactly WHAT was changed.
References
- ECMA-376 (Open XML Standard)
python-docxdocumentation- FEAT-307: LOI FANCCI Refinement workflow