skills/docx-footnotes/SKILL.md
Use when DOCX footnotes are broken after Google Docs or Word Online round-trips, when converting hardcoded 'supra note N' cross-references to auto-updating NOTEREF fields, or for any OOXML-level footnote surgery on a Word document — even if the user doesn't say 'OOXML' but describes footnote formatting problems in a .docx edited in a cloud editor.
npx skillsauth add edwinhu/workflows docx-footnotesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fix footnote formatting damage caused by Google Docs and Word Online, and convert hardcoded supra note references to NOTEREF field codes.
Common symptoms in .docx files round-tripped through Google Docs or Word Online:
FNStyleBest etc.) — the pStyle reference points at an undefined style and Word silently falls back to Normal*, †, ‡) replaced with numberscustomMarkFollows bio footnotes)Scripts are in this skill's scripts/ directory. Use $SKILL_DIR below as a placeholder for the absolute path to this skill (the directory containing this SKILL.md).
# Fix all cloud editor damage + convert cross-references
uv run --with lxml python3 \
"$SKILL_DIR/scripts/fix_footnotes.py" path/to/file.docx --crossrefs
# Dry run (show what would change)
uv run --with lxml python3 \
"$SKILL_DIR/scripts/fix_footnotes.py" path/to/file.docx --dry-run
# Cross-references only
uv run --with lxml python3 \
"$SKILL_DIR/scripts/create_crossrefs.py" --docx path/to/file.docx
Detects and repairs OOXML footnote damage. Handles multiple sources. Idempotent.
Google Docs / Word Online round-trip damage:
pStyle="FootnoteText" (the Google Docs
default) to FNStyleBest on every footnote paragraph so the whole doc
uses the canonical law-review style.FNStyleBest (and the basedOn/link
styles it depends on) from the canonical law-review reference template when
a round-trip stripped them from styles.xml. The template is the same
writing-legal/templates/law_review_template.docx that law-review-docx's
build_docx.py feeds to pandoc, so style definitions stay consistent.FNStyleBest /
FNStyleBestChar block survives the round-trip but picks up Google Docs
hyperlink-renderer residue (link-blue underline color <w:u w:color="0077CC"/>
or white paragraph shading), the whole block is replaced from the template.Pandoc-citeproc wrap parens:
(...) wrapper pandoc adds around mid-footnote bracketed
citations while preserving author-written explanatory parentheticals
(which lack the double-whitespace XML signature).Flags:
--output / -o: Output path (default: overwrite input)--dry-run: Show what would change without modifying--bio-footnotes N: Number of author bio footnotes (default: 3)--crossrefs: Chain to create_crossrefs.py after fixing--fix-numbering: Fix numbering offset from customMarkFollows bio footnotes (adds numRestart, updates NOTEREFs and supra references)--template PATH: Reference template (.docx) to restore missing footnote style definitions from (default: bundled writing-legal/templates/law_review_template.docx)Converts hardcoded "supra note N" references to NOTEREF field codes that auto-update.
What it does:
supra note <number> patterns in document body and footnotesNOTEREF _RefFN<id> \h field codesSee footnotes-reference.md for detailed technical reference covering:
When author bio footnotes use customMarkFollows (*, †, ‡), they consume auto-numbers 1–3, causing body footnotes to start at 4. Fix by adding numRestart=eachSect to settings.xml and updating NOTEREF cached values.
Requires: A section break between title page and body. Must use Word (not LibreOffice) for PDF — LibreOffice renders numRestart as zeros.
See footnotes-reference.md § 4 for details, code patterns, and the critical rule: numRestart goes in settings.xml ONLY (not in sectPr — causes all-zeros).
tools
Use when "query Dewey Data", "deweydata.io", "SafeGraph places/patterns/spend", "Advan foot traffic", "POI / points of interest", "mobility data", "dataplor", "Veraset", "PassBy", "crypto/Bitcoin ATM locations", or any pull from the Dewey Data academic marketplace (UVA/NYU Platform Subscription) via the deweypy/deweydatapy client, DuckDB, or the Dewey MCP server.
testing
Internal skill for literature review and source materialization. Called after brainstorm, before setup. NOT user-facing.
development
Use this skill when the user asks to 'generate a docx', 'create the Word file', 'export to docx', 'apply the law review template', 'build the document', 'make a Word version', or wants to convert their law review markdown drafts into a formatted .docx file.
documentation
This skill should be used when the user asks to 'write a paper', 'start a writing project', 'draft an article', 'write about', 'brainstorm writing topics', 'gather sources for a paper', 'what should I write about', or needs the writing workflow entry point for any writing task.