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
Detected risks:
docx provides comprehensive creation, editing, and analysis of Microsoft Word (.docx) documents, including tracked changes, comments, formatting preservation, and text extraction. It solves the challenge that a .docx file is really a ZIP archive of XML files, giving Claude structured tools and workflows for each task type rather than treating documents as opaque. A workflow decision tree routes each request: reading/analyzing content, creating a new document, editing your own document with simple changes, or redlining someone else's document, with redlining recommended as the default and required for legal, academic, business, or government docs.
For reading, it converts documents to markdown with pandoc (including --track-changes=accept/reject/all), or for comments, complex formatting, structure, embedded media, and metadata it unpacks raw XML with python ooxml/scripts/unpack.py, working with key files like word/document.xml and word/comments.xml and tracked-change tags <w:ins> and <w:del>. For creating new documents it uses docx-js (JavaScript/TypeScript with Document, Paragraph, TextRun components, exported via Packer.toBuffer()), mandating a complete read of docx-js.md first. For editing existing documents it uses a Python Document library, requiring a full read of ooxml.md, then unpack, script, and pack (python ooxml/scripts/pack.py). The redlining workflow plans tracked changes in markdown, groups them into batches of 3-10, and stresses minimal, precise edits that mark only changed text while preserving original run RSIDs. The skill ships OOXML schema files, validation scripts, and comment templates.
Target users are people who need Claude to produce or revise professional Word documents at scale, especially reviewers marking up contracts or formal documents with tracked changes. Stated requirements include reading the referenced docs in full without range limits, using location methods other than markdown line numbers to find changes in XML, and re-grepping word/document.xml immediately before each script because line numbers change after every run.
Use basic OOXML editing for your own document with simple changes. Use the redlining (tracked changes) workflow as the recommended default when editing someone else's document, and it is required for legal, academic, business, or government documents.
Use docx-js, a JavaScript/TypeScript approach with Document, Paragraph, and TextRun components, exporting as .docx via Packer.toBuffer(). You must first read the entire docx-js.md file (about 500 lines) with no range limits before creating the document.
For reading text, convert the document to markdown with pandoc, e.g. pandoc --track-changes=all path-to-file.docx -o output.md, with options accept, reject, or all. For comments, complex formatting, structure, media, or metadata, unpack the raw XML instead using python ooxml/scripts/unpack.py.
Make minimal, precise edits: only mark text that actually changes, breaking replacements into unchanged text plus deletion plus insertion plus unchanged text, and preserve the original run's RSID by reusing the original <w:r> element for unchanged text. Group related changes into batches of 3-10 and test each batch.
Use location methods such as section/heading numbers, numbered paragraph identifiers, grep patterns with unique surrounding text, or document structure. Do NOT use markdown line numbers, and always grep word/document.xml immediately before writing a script because line numbers change after each script run.
Quick Setup:
.claude/skills/Repository
tfriedel/claude-office-skills