law-review-docx
Use this skill to BUILD a formatted Word document from LAW REVIEW / legal MARKDOWN drafts — Bluebook footnotes, TOC, small caps, styled tables and vector…
от edwinhu★ 28 звёзд на GitHub
Установить law-review-docx в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Law Review DOCX Export
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)"
Convert markdown drafts into a properly formatted Word document using the law review template via pandoc.
This is the ONLY correct way to build a law-review .docx — never hand-roll
pandoc/soffice; the template, footnote handling, TOC, and table styling all
live in build_docx.py. Agents without the Skill tool (most workflow
subagents) can't invoke this skill — run the script below directly:
Usage
uv run python3 ${CLAUDE_SKILL_DIR}/scripts/build_docx.py PROJECT_DIR [--output PATH] [--fix-footnotes]
The script:
- Detects title/author from
.planning/ACTIVE_WORKFLOW.mdorPRECIS.md - Combines all
drafts/*Draft*.mdfiles in section order (Introduction → Parts → Conclusion → Appendix) - Strips YAML frontmatter and prefixes footnote labels to avoid cross-section collisions
- Resolves
<!-- include: PATH -->sentinels by inlining file contents (paths must be absolute or~-expanded) - Runs pandoc with
--reference-docpointing to the law review template - Optionally runs the docx-repair repair script (
--fix-footnotes)
Compile-Time Includes
To embed externally generated tables or fragments at build time, place a sentinel in the draft:
<!-- include: ~/projects/mirror/data/tables/paper/table2_body.md -->
The preprocessor expands ~, reads the file, and splices its contents inline before pandoc runs. Missing or non-absolute paths emit a visible <!-- MISSING: ... --> placeholder instead of failing silently. For images, use plain pandoc markdown () — no sentinel needed.
Detecting the Project Directory
If the user doesn't specify a path, detect it from context:
- Check if current working directory has
drafts/and.planning/ - Check if
.planning/ACTIVE_WORKFLOW.mdexists and readproject_dirfrom it - Follow symlinks (e.g.,
paper→ actual project directory)
Template
The reference template lives at:
${CLAUDE_PLUGIN_ROOT}/references/templates/law_review_template.docx
This template defines all styles that pandoc applies:
| Style | Use | Formatting |
|---|---|---|
| Title | Article title | Bold, small caps, centered |
| Heading 1 | Part titles (I., II., III.) | Bold, left-aligned |
| Heading 2 | Sections (A., B., C.) | Bold, left-aligned |
| Heading 3 | Subsections (1., 2., 3.) | Italic, left-aligned |
| Body Text | All body paragraphs | First-line indent |
| First Paragraph | After headings | No indent |
| Footnote Text | Footnotes | 10pt, single-spaced |
Figures: vector, via svgBlip
Reference the PNG in markdown —  — and keep a
same-stem .svg beside it. After pandoc, build_docx.py finds each embedded
raster, matches it to its SVG by content hash (pandoc rewrites media to
rIdN.png, so the filename is gone by then), and attaches the vector:
<a:blip r:embed="rIdPng">
<a:extLst>
<a:ext uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}">
<asvg:svgBlip xmlns:asvg="http://schemas.microsoft.com/office/drawing/2016/SVG/main"
r:embed="rIdSvg"/>
</a:ext>
</a:extLst>
</a:blip>
Word 2016+ draws the SVG with its own renderer; everything older falls back to
the PNG. No sibling .svg, no change — raster-only projects are unaffected.
Never reference a bare .svg from markdown. Pandoc embeds it as an image
part with no svgBlip, unzip -l shows the media happily, and Word renders
nothing — blank space under the caption, no error at any stage.
Never convert SVG→EMF with LibreOffice as a substitute. EMF is a real vector format and Word draws it, so the route looks correct. It is not: LibreOffice's SVG importer silently corrupts complex figures. A five-facet histogram came back missing an entire facet row, every row label, both axis labels, the tick numbers and the zero line — still a plausible-looking chart, so nothing downstream flagged it. Simple one-panel figures convert fine, which is what makes it dangerous: verifying one figure proves nothing about the rest.
Verification — count images in the RENDERED PDF, never in the DOCX:
pdfimages -list manuscript.pdf | tail -n +3 | wc -l # 0 == every figure is vector
A media part exists for formats Word cannot draw, so a word/media/ count is not
evidence the figure reached the page. Check the most structurally complex figure
against its source, not the first one.
After Export
Report the output path, section count, footnote count, and approximate
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- assets/bluebook-law-review-21e.csl
- references/title-page-spacing.md
- scripts/build_docx.py
- scripts/check_widows.py
- scripts/check_widows_test.py
- scripts/fix_widows.py
FAQ
Что делает скилл law-review-docx?
Use this skill to BUILD a formatted Word document from LAW REVIEW / legal MARKDOWN drafts — Bluebook footnotes, TOC, small caps, styled tables and vector figures. Triggers: 'build the law review document', 'make the Word version of my article', 'turn my markdown draft into Word', 'export the article to docx', 'compile/finalize the draft', 'make the submission docx for the law review', 'apply the law review template', 'the figure is blank in Word', 'fix the widows in the compiled PDF'. Use proactively once a legal markdown draft is finished and a Word file is implied but unnamed. NEGATIVE ROUTING: NOT 'law-econ-docx' (author-date citations plus a reference list, for JLE/JLS/JLEO/ALER — different citation model), NOT 'docx-typst' (source is Typst, not markdown), NOT the generic 'docx' skill (edits docx content), NOT 'docx-render' (renders an existing docx to PDF/PNG only), NOT 'docx-repair' (fixes a cloud-editor-damaged docx).
Как установить скилл law-review-docx?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл law-review-docx запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…