/workflows:expert-report-docxfrom workflows
Builds a served Word file of an expert report for litigation from markdown drafts, with court caption, numbered paragraphs, and Bluebook footnotes.
Ships in workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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)"
Builds the served form of an expert report from drafts/*Draft*.md: caption on page 1, text
starting under it, no running header, numbered paragraphs, real Word footnotes with Bluebook short
forms. The layout values are measured from a served reference report
(docs/investigations/2026-11-10_expert-report-template.md).
This is the only correct way to build the report's .docx — never hand-roll pandoc. Agents
without the Skill tool run the script directly:
uv run python3 ${CLAUDE_SKILL_DIR}/scripts/build_docx.py PROJECT_DIR [--output PATH] \
[--caption FILE] [--bib FILE] [--draft-header] [--exhibits DIR] [--pdf] \
[--typography smallcaps|plain]
| Flag | Default |
|---|---|
--output | PROJECT_DIR/output/expert-report.docx |
--caption | PROJECT_DIR/caption.yaml, then caption: in the frontmatter of the writing plan (.planning/*.md with workflow: writing); none → warning, no caption |
--bib | PROJECT_DIR/references/sources.bib, else the only references/*.bib |
--draft-header | off: no header, as served. On (or draft_header: true in the caption) adds "DRAFT, PRIVILEGED AND CONFIDENTIAL" |
--exhibits | none. A directory, lettered in filename order (or caption exhibits: list); .md rendered (lists as Ordinal Point paragraphs), .pdf/.docx listed by name, each after an EXHIBIT A slip page |
--pdf | off. Renders through real Word in the Windows guest (docx-render word-remote), never another engine; exits non-zero unless the Producer is Microsoft Word, every text font is Times New Roman, and the PDF holds this document's text (the guest has one job slot, no lock). Reports producer, fonts, page count, [@ left, placeholders |
--typography | caption typography:, else smallcaps (as served: journals, books, firm memos in small caps). plain = court-document style: those roman, book and memo titles italic |
The pipeline: law-review-docx's combining (section order, frontmatter strip, footnote-label
prefixes, <!-- include: PATH -->) → bib to CSL JSON, normalised → pandoc --citeproc with
assets/bluebook-expert-report.csl to the JSON AST → AST pass → pandoc to docx with
references/templates/expert_report_template.docx → OOXML pass → checks.
| In the draft | Becomes |
|---|---|
# I. TITLE. / ## A. TITLE. | Part / lettered heading, numeral + tab |
1\. Text | numbered paragraph: number at 0.5", tab to 1.0" |
*First*, … (unnumbered) | ordinal point: bullet, single-spaced |
> quote | Block Text |
:::: {.continuation} … :::: after a block quote | the paragraph continues: Body Text, flush left (w:firstLine="0"), never numbered even if it opens with digits |
\* \* \* \* | centred four-asterisk break |
[TO SUPPLY: …] | yellow highlight, body and footnotes, counted |
[@key, at 4 ¶ 4], [@key, at *3] | citation with its pin printed once |
| short lines after the last numbered paragraph | signature block: lines naming the expert or "signature" at 4", the rest (date) flush left. No such lines → generated from caption expert and date |
court: | # centred, bold
UNITED STATES DISTRICT COURT
DISTRICT OF DELAWARE
plaintiffs: [ACME WIDGET CO., ET AL.,] # or `matter:` lines for an In re caption
defendants: [GLOBEX INDUSTRIAL CORP., ET AL.,]
plaintiffs_label: "Plaintiffs," # optional; default shown
defendants_label: "Defendants."
case_number: "CASE NO. 1:24-cv-00999-UNA"
report_title: | # bold, right column
REBUTTAL REPORT OF
PROFESSOR JANE Q. PUBLIC
expert: "Jane Q. Public" # typed signature name
date: "November 10, 2026"
draft_header: false
typography: smallcaps # or plain; --typography overrides
exhibits: [exhibits/a.md] # relative to this file
scripts/make_template.py builds the template from pandoc --print-default-data-file reference.docx; rerun it after changing a value. build_docx_test.py fails when the shipped
template is stale.
| Style / part | Value (served measurement) |
|---|---|
| Page | Letter, 1" margins, footer 0.5", page 1 numbered, no header |
| Normal | Times New Roman 12, single, 0 after |
| Body Text / First Paragraph | double (27.6 pt), justified, first line 0.5" |
| Heading 1 | bold caps, flush left, numeral at 0", text and wraps at 0.5", one blank line above and below |
| Heading 2 | bold caps, letter at 0.5", text and wraps at 1.0" |
| Block Text | single (13.8 pt), 0.5" each side, blank line after |
| Footnote Text | 10 pt, exact 11.5 pt, 0 before/after, first line 0.5", wraps at margin, justified |
| Footnote Reference | superscript (Word: 8 pt in body, 6.5 pt in notes) |
| Separators | 2" separator, full-width continuation separator, 11 pt single paragraphs; Calibri runs (Word draws the served 0.72 pt rule) |
| Footer | centred 11 pt PAGE, then an empty 11 pt paragraph |
| Caption | 2 × 4788-twip table at tblInd 0: bottom rule under the left cell + inside rule = bracket at x 66–306 |
| Compat | Word 2010 mode (14), as served: full-width continuation separator, border hung 0.075" left of the caption text |
| Placeholder, Asterisk Break, Ordinal Point, Signature (4"), Signature Date, Exhibit Title | custom styles |
Bluebook notes from the CSL — never a hand formatter. Titles print as written; note and
annote never print; shorttitle drives [hereinafter X] (after the pin) and
X, supra note N, at P; Id. is capitalised at a sentence start. A firm memo prints firm,
title and date — a bare type genre label never prints. A § pin on a statute title that ends
in a section replaces that section. Hyphens in docket numbers become non-breaking
(w:noBreakHyphen) in body and notes, and so does the space after §/§§ (U+00A0). The field each source type needs is in
references/bib-conventions.md — read it before building against a new bib. A legacy-shaped
bib (@misc types, reporter, howpublished, author on releases, captioned statute titles)
is accepted as it stands: normalize_csl maps it in memory, additive fields winning
("Legacy-shaped entries" there). A WL cite kept only in note still never prints, and nothing
looks a reporter up: a cite added to an entry is checked against the opinion's date and court. The build strips pandoc's
paren-wrap of non-initial citations in a footnote (law-review-docx: "Pandoc-Citeproc Paren-Wrap
Inside Footnotes").
Every build strips metadata, always (no flag; scripts/strip_metadata.py): empty core.xml, no app.xml statistics/Template/Application, no custom.xml, no rsids, no zip dates; --pdf then keeps only Creator and Producer in the Word PDF, before the Producer check. Read the printed Metadata stripped: and PDF metadata stripped: lines.
The build exits non-zero, naming the strings, when a citation key is missing from the bib, when
any [@ survives in document.xml or footnotes.xml, or when the Word footnote count differs
from the drafts' [^id]: definitions (a citation outside a footnote becomes an extra note).
Then:
Footnotes: N (definitions: N), Placeholders: K.--pdf; check PDF [@ left: 0, PDF producer: Microsoft® Word for Microsoft 365
and PDF fonts: all TimesNewRomanPS*. Word unreachable → the build fails naming the fix:
docker start omarchy-windows, then wait for ssh word@winvm (a cold boot takes minutes).look_at.sh --backend claude).Tests: uv run --with pytest --with pytest-xdist --with pyyaml python3 -m pytest -q -n 2 ${CLAUDE_SKILL_DIR}/scripts/build_docx_test.py. The Word integration test skips, saying so, when ssh word@winvm is unreachable.
| About to | Why wrong | Do instead |
|---|---|---|
Run pandoc without the template, or hand-roll the docx | Default Calibri styles, no caption, no number+tab, footnote marks and separators wrong | Run build_docx.py |
| Hand-format citations or post-edit footnote text | Loses supra/Id. positions; every edit desyncs on the next build | Fix the bib fields per bib-conventions.md and rebuild |
| Edit the bib note to make a WL cite print | note never prints | Put it in volume/journaltitle/pages |
| Attach a reporter cite matched by case name | An affirmance or reversal shares the caption | Match the opinion's date and court first |
Serve a build with --draft-header on, or draft_header: true in the caption | The served report has no header | Build without it; check the printed Header: none |
Serve with Placeholders: above 0 | Yellow [TO SUPPLY] text goes to opposing counsel | Resolve every placeholder first |
Copy case text, party names or facts into fixtures/ or this repo | Protective-order and case material in a shared plugin repo | Synthetic parties only (ACME WIDGET CO.) |
| Render the PDF with any engine but Word, or trust a PDF whose Producer is not Microsoft Word | Layout, footnote marks, separators and fonts differ from the served Word output; a non-Word PDF is never evidence | --pdf (word-remote) only; fix the guest when it is down |
| Send pages of a real report to a non-Claude vision model | Protective-order material | look_at.sh --backend claude only |
Edit expert_report_template.docx in Word | The next make_template.py run silently reverts it | Change make_template.py and regenerate |
assets/bluebook-expert-report.csl (opens in a new tab)fixtures/sample/caption.yaml (opens in a new tab)fixtures/sample/drafts/Part I. Introduction (Draft).md (opens in a new tab)fixtures/sample/drafts/Part II. Analysis (Draft).md (opens in a new tab)fixtures/sample/exhibits/Exhibit_A.md (opens in a new tab)fixtures/sample/extra/Part III. Review Fixes (Draft).md (opens in a new tab)fixtures/sample/references/sources.bib (opens in a new tab)references/bib-conventions.md (opens in a new tab)references/templates/expert_report_template.docx (opens in a new tab)scripts/build_docx.py (opens in a new tab)scripts/build_docx_test.py (opens in a new tab)scripts/make_template.py (opens in a new tab)scripts/strip_metadata.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code refuses to install this plugin
As a github or url source: Failed to clone repository: fatal: clone of '[email protected]:edwinhu/bmll-skill.git' into submodule path 'skills/bmll' failed
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
86 skills in this plugin
/afkUse when the user says '/afk', 'afk', 'going to bed', 'I'm going to sleep', 'work autonomously', 'work on this overnight', 'don't ask me questions', 'while I'm away', or 'do whatever you think is best'. NOT for questions about overnight returns, rates or anything financial; NOT for asking how the mode works./ai-anti-patternsALWAYS load before finalizing ANY written prose, and whenever text is suspected of being machine-written - "does this sound like AI", "make this sound human", "clean up the AI-isms", "did a bot write this", "check this draft before I send it", "review this for AI tells", "this reads like ChatGPT", "review this for mannered prose", "is this too writerly", "is this student paper AI-generated", or before handing back any draft, memo, email, or article you wrote. Use proactively even if the user never mentions AI writing./Other plugins' skills for the same job