docx-repair
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
DOCX Repair (Google Docs / Word Online damage)
What this skill carries — grep references/ for any subject the names below miss:
!d=${CLAUDE_SKILL_DIR}; command -v skill-toc >/dev/null 2>&1 && exec skill-toc "$d"; s=$HOME/.claude/skills/plugin-utils/bin/skill-toc; [ -x "$s" ] && exec "$s" "$d"; echo "(skill-toc unavailable: references and scripts are NOT listed here — install the plugin-utils plugin, or start a new session so its bin/ reaches PATH)"
Cloud editors damage a .docx in independent ways. This skill is the front door for all of them; run only the track(s) you need.
| Damage class | Symptom | Fix |
|---|---|---|
| A. Package / OOXML wiring | Word pops "recover unreadable content?" or refuses to open; LibreOffice won't load; phantom blank page | ${CLAUDE_PLUGIN_ROOT}/scripts/docx_repair.py (plugin root) — references/package-repair.md |
| B. Footnote & cross-reference markup | Bios show 1,2,3 not *,†,‡; numbering starts wrong; "supra note N" points to the wrong footnote; missing separator line |
the footnote scripts — references/footnote-procedure.md |
| B1. Cross-references aimed at the wrong source | Lin, supra note 130 where note 130 is a different work; Rebuttal Report, supra note 22 where 22 defines the deposition; a short form surviving a renumber that moved its target |
check_crossrefs.py <file.docx> — read-only, exit 1 on any problem |
| C. Document content (boxes + headings + cruft) | Visible boxes around freshly-edited text; heading-looking lines not styled as headings; same-style headings rendering differently; blank heading lines; bloated XML full of all-zero rsids, no-op shading, explicit b=0/i=0/u=none, redundant black color & default fonts |
fix_footnotes.py's document.xml passes — references/content-cleanup.md |
| D. Presentation hygiene | A footnote renders blue/underlined in the PDF but looks normal in Word; a URL prints one address and navigates to another; heading gaps uneven page to page; tracking params (?utm_source=…) behind a clean-looking link |
docx_links.py, docx_spacers.py — references/presentation-hygiene.md |
They are decoupled: package repair fixes the part wiring (never touches content); footnote repair fixes the footnote markup; content cleanup strips Google-Docs leftover content controls and normalizes headings. A file can need any, all, or none. If you don't know which, run the package check first (it's a no-op on a clean package), then the footnote pass (it carries the content cleanup).
Heads-up:
docx-render's Word path already composesdocx_repair.pyas a preflight, so a Google export "just renders" without a manual Track A. Run Track A manually when you need the repaired file itself (to hand back, edit, or footnote-fix), not just a PDF.