Skip to content
Skills Library
Documents & office · Building & coding

docx

/docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'lette

Repository
prompts ↗
Licence
MIT
Last repository change
02.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
65
Scripts
17
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 17 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/__init__.py, scripts/accept_changes.py, scripts/comment.py, scripts/document.py, scripts/helpers/__init__.py, scripts/helpers/merge_runs.py, scripts/helpers/simplify_redlines.py, scripts/pack.py, scripts/soffice.py, scripts/unpack.py, scripts/utilities.py, scripts/validate.py, scripts/validators/__init__.py, scripts/validators/base.py, scripts/validators/docx.py, scripts/validators/pptx.py

What it does and when to use it

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'lette

Triggers from the description

Word docword document.docxreportmemo
Original author description

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'lette

How it works

  1. Overview
  2. Quick Reference
  3. Creating New Documents
  4. Editing Existing Documents
  5. Redlining Workflow for Document Review
  6. Dependencies
Original SKILL.md headings · 163 lines, 686 words
SKILL.md preview
---
name: docx
description: "Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation."
license: Proprietary. LICENSE.txt has complete terms
---

# DOCX creation, editing, and analysis

## Overview

A .docx file is a ZIP archive containing XML files.

## Quick Reference

| Task | Approach |
|------|----------|
| Read/analyze content | `pandoc` or unpack for raw XML |
| Create new document | Use docx-js — see references/docx-js.md |
| Edit existing document | Unpack → edit XML → repack |
| Redlining (tracked changes) | Use Document library — see references/ooxml.md |

### Converting .doc to .docx

Legacy `.doc` files must be converted before editing:

```bash
python scripts/soffice.py --headless --convert-to docx document.doc
```

### Reading Content

```bash
# Text extraction with tracked changes
pandoc --track-changes=all document.docx -o output.md

# Raw XML access
python scripts/unpack.py document.docx unpacked/
```

### Converting to Images

```bash
python scripts/soffice.py --headless --convert-to pdf document.docx
pdftoppm -jpeg -r 150 document.pdf page
```

### Accepting Tracked Changes

To produce a clean document with all tracked changes accepted (requires LibreOffice):

```bash
python scripts/accept_changes.py input.docx output.docx
```

______________________________________________________________________

## Creating New Documents

Generate .docx files with JavaScript. See **references/docx-js.md** for the complete API reference.

### Workflow

1. **MANDATORY — READ ENTIRE FILE**: Read [`references/docx-js.md`](references/docx-js.md) completely before proceeding.
2. Create a JavaScript/TypeScript file using Document, Paragraph, TextRun components.
3. Validate: `python scripts/validate.py --original <any_existing.docx> unpacked/` or after packing.

______________________________________________________________________

## Editing Existing Documents

**Follow all 3 steps in order.**

### Step 1: Unpack

```bash
python scripts/unpack.py document.docx unpacked/
```

Extracts XML, pretty-prints, merges adjacent runs, simplifies tracked changes, and converts smart quotes to XML entities (`&#x201C;` etc.) so they survive editing. Use `--merge-runs false` to skip run merging.

**Note the suggested RSID** printed by the unpack script — use it for tracked changes.

### Step 2: Edit XML

Edit files in `unpacked/word/`. See **references/ooxml.md** for XML patterns and the Document Library API.

**Two approaches:**

1. **Direct XML editing** — Use the agent's native edit tool for string replacements. Best for simple tracked changes and straightforward edits.
2. **Document Library (Python)** — Use for complex batched operations, programmatic node finding, and redlining workflows. See "Document Library" section in references/ooxml.md.

#### Using the Document Library

```bash
# Set PYTHONPATH to the skill root, then run your script
PYTHONPATH=/path/to/docx-skill uv run your_script.py
```

```python
from scripts.document import Document, DocxXMLEditor

doc = Document("unpacked", author="Claude", initials="C")
node = doc["word/document.xml"].get_node(tag="w:r", contains="old text")
doc["word/document.xml"].replace_node(node, "<w:del>...<w:ins>...")
doc.save()
```

#### Adding Comments

Use `comment.py` to handle boilerplate across multiple XML files:

```bash
python scripts/comment.py unpacked/ 0 "Comment text with &amp; and &#x2019;"
python scripts/comment.py unpacked/ 1 "Reply text" --parent 0  # reply to comment 0
```

Then add markers to document.xml (see Comments in references/ooxml.md).

### Step 3: Pack

```bash
python scripts/pack.py unpacked/ output.docx --original document.docx
```

Validates with auto-repair, condenses XML, and creates DOCX. Use `--validate false` to skip.

**Auto-repair will fix:**

- `durableId` >= 0x7FFFFFFF (regenerates valid ID)
- Missing `xml:space="preserve"` on `<w:t>` with whitespace

**Auto-repair won't fix:**

- Malformed XML, invalid element nesting, missing relationships, schema violations

______________________________________________________________________

## Redlining Workflow for Document Review

This workflow is for comprehensive tracked changes on someone else's document. **See references/ooxml.md** for the complete Document Library API and XML patterns.

**Batching Strategy**: Group related changes into batches of 3-10 changes. This makes debugging manageable while maintaining efficiency.

**Principle: Minimal, Precise Edits**
Only mark text that actually changes. Repeating unchanged text makes edits harder to review and appears unprofessional. Break replacements into: [unchanged text] + [deletion] + [insertion] + [unchanged text].

### Tracked changes workflow

1. **Get markdown representation**: `pandoc --track-changes=all path-to-file.docx -o current.md`
2. **Identify and group changes**: Organize into logical batches (by section, type, or proximity)
3. **Read documentation and unpack**:
   - **MANDATORY**: Read [`references/ooxml.md`](references/ooxml.md) completely
   - Unpack: `python scripts/unpack.py file.docx dir`
   - Note the suggested RSID
4. **Implement changes in batches**: Use the Document Library for complex operations, or edit XML directly for simple ones
5. **Pack**: `python scripts/pack.py dir reviewed.docx --original file.docx`
6. **Final verification**: `pandoc --track-changes=all reviewed.docx -o verification.md`

______________________________________________________________________

## Dependencies

- **pandoc**: Text extraction (`apt-get install pandoc`)
- **docx**: `npm install -g docx` (new documents)
- **LibreOffice**: PDF conversion, tracked change acceptance (via `scripts/soffice.py`)
- **Poppler**: `pdftoppm` for images (`apt-get install poppler-utils`)
- **defusedxml**: Secure XML parsing (`pip install defusedxml`)
Files in this package (65)
  • LICENSE.txt 1 KB
  • SKILL.md 6 KB
  • assets/schemas/ISO-IEC29500-4_2016/dml-chart.xsd 73 KB
  • assets/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd 7 KB
  • assets/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd 50 KB
  • assets/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd 1 KB
  • assets/schemas/ISO-IEC29500-4_2016/dml-main.xsd 148 KB
  • assets/schemas/ISO-IEC29500-4_2016/dml-picture.xsd 1 KB
  • assets/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd 9 KB
  • assets/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd 14 KB
  • assets/schemas/ISO-IEC29500-4_2016/pml.xsd 82 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd 1 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd 7 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd 6 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd 1 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd 1 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd 3 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd 3 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd 7 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-math.xsd 23 KB
  • assets/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd 1 KB
  • assets/schemas/ISO-IEC29500-4_2016/sml.xsd 237 KB
  • assets/schemas/ISO-IEC29500-4_2016/vml-main.xsd 26 KB
  • assets/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd 25 KB
  • assets/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd 1 KB
  • assets/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd 6 KB
  • assets/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd 4 KB
  • assets/schemas/ISO-IEC29500-4_2016/wml.xsd 167 KB
  • assets/schemas/ISO-IEC29500-4_2016/xml.xsd 5 KB
  • assets/schemas/ecma/fouth-edition/opc-contentTypes.xsd 2 KB
  • assets/schemas/ecma/fouth-edition/opc-coreProperties.xsd 2 KB
  • assets/schemas/ecma/fouth-edition/opc-digSig.xsd 3 KB
  • assets/schemas/ecma/fouth-edition/opc-relationships.xsd 1 KB
  • assets/schemas/mce/mc.xsd 3 KB
  • assets/schemas/microsoft/wml-2010.xsd 26 KB
  • assets/schemas/microsoft/wml-2012.xsd 4 KB
  • assets/schemas/microsoft/wml-2018.xsd 1 KB
  • assets/schemas/microsoft/wml-cex-2018.xsd 2 KB
  • assets/schemas/microsoft/wml-cid-2016.xsd 1 KB
  • assets/schemas/microsoft/wml-sdtdatahash-2020.xsd 1 KB
  • assets/schemas/microsoft/wml-symex-2015.xsd 1 KB
  • references/docx-js.md 19 KB
  • references/ooxml.md 24 KB
  • scripts/__init__.py 1 KB
  • scripts/accept_changes.py 4 KB
  • scripts/comment.py 10 KB
  • scripts/document.py 49 KB
  • scripts/pack.py 6 KB
  • scripts/soffice.py 5 KB
  • scripts/unpack.py 4 KB
  • scripts/utilities.py 13 KB
  • scripts/validate.py 3 KB
  • scripts/helpers/__init__.py 1 KB
  • scripts/helpers/merge_runs.py 5 KB
  • scripts/helpers/simplify_redlines.py 6 KB
  • scripts/templates/comments.xml 3 KB
  • scripts/templates/commentsExtended.xml 3 KB
  • scripts/templates/commentsExtensible.xml 3 KB
  • scripts/templates/commentsIds.xml 3 KB
  • scripts/templates/people.xml 1 KB
  • scripts/validators/__init__.py 1 KB
  • scripts/validators/base.py 40 KB
  • scripts/validators/docx.py 12 KB
  • scripts/validators/pptx.py 12 KB
  • scripts/validators/redlining.py 11 KB

Versions

RepositoryScoreLicence
This page · jr2804/prompts100MIT
rongxinzy/rongxinai100AGPL-3.0
mateaix/mateclaw100Apache-2.0
neromtoobad/creator-skills100MIT
TerminalSkills/skills100Apache-2.0
okou-ai/okou-skills100MIT
openbmb/pilotdeck100AGPL-3.0
wrongstack/wrongstack100MIT
asgeirtj/system_prompts_leaks100CC0-1.0

Database snapshot: 13.11.2026 · package version 778040271c4e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100word-documents
    Use when creating, reading, or editing Word documents (.docx). Covers document generation with styles and structure, extracting content, find-and-replace, tracked changes, and templates. Trigger on "generate a word document", "find and replace in this docx", "fill this word…
  • 90word-docx
    Create, inspect, and edit Microsoft Word documents and DOCX files with reliable styles, numbering, tracked changes, tables, sections, and compatibility checks. Use when (1) the task is about Word or `.docx`; (2) the file includes tracked changes, comments, fields, tables,…
  • 85word-docx
    Create, inspect, and edit Microsoft Word documents and DOCX files with reliable styles, numbering, tracked changes, tables, sections, and compatibility checks. Use when (1) the task is about Word or `.docx`; (2) the file includes tracked changes, comments, fields, tables,…
  • 100docx-generator
    Create, read, and edit Word (.docx) files - styles, tables, images, headers, and templates - using python-docx. Use whenever a deliverable must be a Word document.
  • 100word-read-write
    Create and read Microsoft Word (.docx) documents. Use this skill when you need to generate reports/letters/templates as .docx or extract readable text from existing .docx files.
  • 100microsoft-word
    Create, edit, and manipulate Word documents (.docx) programmatically. Use when someone asks to "generate a Word document", "create a report in docx", "mail merge", "fill Word template", "extract text from Word", "convert markdown to Word", "add tables to Word", or "automate…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.