Agent skill
docx
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/docx-mshafei721-turbocat
SKILL.md
DOCX Creation, Editing, and Analysis
Overview
Work with .docx files which are ZIP archives containing XML files. Different tools and workflows available for different tasks.
Workflow Decision Tree
Reading/Analyzing Content
Use text extraction or raw XML access
Creating New Document
Use docx-js workflow
Editing Existing Document
- Your own document + simple changes: Basic OOXML editing
- Someone else's document: Redlining workflow (recommended)
- Legal, academic, business docs: Redlining workflow (required)
Reading and Analyzing Content
Text Extraction
# Convert to markdown with tracked changes
pandoc --track-changes=all path-to-file.docx -o output.md
Raw XML Access
For comments, complex formatting, document structure, embedded media, and metadata:
# Unpack document
python ooxml/scripts/unpack.py <office_file> <output_directory>
Key file structures:
word/document.xml- Main document contentsword/comments.xml- Commentsword/media/- Embedded images and media
Creating New Documents
Use docx-js (JavaScript/TypeScript):
import { Document, Paragraph, TextRun, Packer } from 'docx';
const doc = new Document({
sections: [{
properties: {},
children: [
new Paragraph({
children: [new TextRun("Hello World!")],
}),
],
}],
});
// Export
const buffer = await Packer.toBuffer(doc);
Editing Existing Documents
Use the Document library (Python) for OOXML manipulation:
- Unpack:
python ooxml/scripts/unpack.py <file.docx> <dir> - Create Python script using Document library
- Pack:
python ooxml/scripts/pack.py <dir> <file.docx>
Redlining Workflow
For tracked changes:
- Convert to markdown:
pandoc --track-changes=all file.docx -o current.md - Identify and group changes
- Unpack document
- Implement changes in batches using Document library
- Pack the document
- Verify all changes applied correctly
Dependencies
- pandoc: For text extraction
- docx:
npm install -g docxfor creating new documents - LibreOffice: For PDF conversion
- defusedxml: For secure XML parsing
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?