# DOCX Official

Use this skill whenever a Microsoft Word (.docx) file is being produced, opened...

- Repository: https://github.com/XiaomiMiMo/MiMo-Code (13741 stars)
- Category: Documents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add XiaomiMiMo/MiMo-Code --skill docx-official -g -a claude-code -y`
Codex: `npx skills add XiaomiMiMo/MiMo-Code --skill docx-official -g -a codex -y`
Cursor: `npx skills add XiaomiMiMo/MiMo-Code --skill docx-official -g -a cursor -y`
Gemini CLI: `npx skills add XiaomiMiMo/MiMo-Code --skill docx-official -g -a gemini-cli -y`

## Description

Use this skill whenever a Microsoft Word (.docx) file is being produced, opened, transformed, or read. That includes: drafting reports, letters, contracts, RFPs, technical documents, or any long-form written deliverable; extracting text or structure from an existing Word file; filling a Word template with values; converting Word to PDF or plain text; splitting or merging documents; inspecting styles, headings, sections, tables, images, comments, or tracked changes. Trigger on mentions of 'Word doc', 'DOCX', 'Office document', a filename ending in .docx, or requests like 'turn this into a Word report'.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# DOCX Skill

An Apache-2.0 toolkit for producing, editing, and reading Microsoft Word (`.docx`) files. Written from scratch against the public [ECMA-376 / ISO/IEC 29500](https://www.ecma-international.org/publications-and-standards/standards/ecma-376/) specification and built on permissively-licensed tooling (`python-docx` MIT, `lxml` BSD-3-Clause, optional external binaries `pandoc` and `soffice`) so it can be reused in commercial projects without restriction.

## Decision matrix

| Situation | Path | Read first |
|-----------|------|------------|
| No source file, build a document from a prompt / data | Author from scratch with `python-docx` | [`create.md`](create.md) |
| You have a `.docx` template to fill in or lightly modify | Placeholder replacement via `python-docx`, keeps styles | [`edit.md`](edit.md) → *Workflow A, `python-docx` in-place edit* |
| Deep structural edits, new sections, custom XML, unusual layouts | Explode → edit XML → assemble | [`edit.md`](edit.md) → *Workflow B, Explode → edit XML → assemble* |
| You only need the text / structure / metadata out of a `.docx` | Extraction pipeline | [`read.md`](read.md) |
| Need a PDF preview for QA | `scripts/render_pdf.py` via LibreOffice | see *QA* below |

If the task mixes several of these, do them in this order: **read → plan → edit/create → validate**.

## One-time environment setup

> **Bundled runtime:** when the `MIMO_PYTHON` environment variable is set, skip `uv`/`python3` and pip installs entirely, run every command below with `uv run` replaced by `"$MIMO_PYTHON"` (e.g. `"$MIMO_PYTHON" scripts/extract_text.py input.docx`). This skill's Python dependencies are preinstalled in that interpreter; pip console scripts are unavailable, so always go through `"$MIMO_PYTHON" -m <module>`. A bundled LibreOffice is exposed as `MIMO_SOFFICE` and picked up automatically by the scripts here.

The rest: https://github.com/XiaomiMiMo/MiMo-Code/blob/HEAD/packages/cli/src/skill/builtin/.bundle/docx-official/SKILL.md
