/workflows:docx-typstfrom workflows
Bridges Typst source and Word .docx bidirectionally: builds docx from typ, converts docx to typ, and reconciles coauthor edits back into canonical Typst via git merge-file.
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)"
Typst source is the thing the repo keeps. Word is the thing coauthors edit. This skill moves a document across that boundary in both directions and reconciles what comes back.
The load-bearing fact: typ → docx → typ reaches a fixed point after one pass. So
the pipe's output is itself valid Typst, the canonical form can be committed, and
reconciling a coauthor's returned file collapses from "read two documents side by side"
to git merge-file.
existing.docx ──canonicalize.py --from-docx──> body.typ + media/ (bootstrap, once)
│
main.typ ──typst compile──> PDF │
│ │
│ #include ▼
▼
body.typ ──build.py──> paper.docx ──email──> coauthor edits in Word
▲ │
│ │ sends back
└──── reconcile.py <── merged body.typ <── returned.docx
│
└──comments.py──> comments.json
All under ${CLAUDE_SKILL_DIR}/scripts/. Each is self-contained and prints --help.
Run them with uv run --script, not uv run python3. Four of the five declare
lxml in a PEP 723 header, and uv run python3 <path> ignores that header and fails
with ModuleNotFoundError: No module named 'lxml'. --script (or executing the file
directly, since the shebang is uv run) reads the header and provisions the dependency.
| Script | Direction | Does |
|---|---|---|
build.py | typ → docx | Convert with --reference-doc styles and stamp provenance, in one step |
canonicalize.py | docx → typ | Bootstrap an existing Word manuscript (--from-docx); put a body file on its fixed point; --check gates it; --lint guards the body/main split |
reconcile.py | docx → typ | Resolve the ancestor, three-way merge a returned file against the repo source |
comments.py | docx or Drive → JSON | Extract comments with their anchor text, resolved state, and threading |
provenance.py | — | Read/write the stamp directly (build.py already applies it) |
expand_citations.py | typ → typ | Freeze every computed reference — #cite(...) and @label — into the literal body the docx path needs |
make_redline.py | docx × docx → docx | Rebuild a coauthor's untracked edits as real tracked changes, against a baseline (stdlib + LibreOffice; no PEP 723 header) |
main.typ / body.typ splitmain.typ #import / #let / #show / #set, then #include "body.typ" ← typst compiles this
body.typ pure markup: = headings, prose, #emph, #footnote ← pandoc reads this
Both paths see the same prose and neither degrades the other. The split is not stylistic
tidiness — see the first fact row in
${CLAUDE_PLUGIN_ROOT}/skills/docx-typst/references/facts.md.
| Read | When |
|---|---|
${CLAUDE_PLUGIN_ROOT}/skills/docx-typst/references/conversion.md | Any actual conversion: bootstrapping a Word manuscript into body.typ, building the .docx, reconciling a returned file, rebuilding untracked edits as a redline, extracting comments |
${CLAUDE_PLUGIN_ROOT}/skills/docx-typst/references/citations.md | A manuscript whose numbers must maintain themselves — supra note N, Section IV.B, Id.; the bluebook.typ renderer, bib_to_entries.py, hand-authored short forms, the entries schema, the two-body-file split |
${CLAUDE_PLUGIN_ROOT}/skills/docx-typst/references/facts.md | Before changing the conversion path, or when a build/round trip behaves in a way the commands do not explain — the pandoc and typst defects this skill normalizes around, and why each rule exists |
${CLAUDE_PLUGIN_ROOT}/skills/docx-typst/references/maintenance.md | Changing this skill or its scripts: the test suite, the two tests that pin bugs, and what "verified" requires |
| Action | Why wrong | Do instead |
|---|---|---|
About to point pandoc at main.typ | Its #show rules destroy heading semantics in the docx | Point it at body.typ |
About to pass --allow-styling to clear a lint error | Ships a headingless Word file | Move the directives into main.typ |
About to hand-edit the returned .docx and call it reconciled | The repo source still diverges; the next build overwrites the edits | Run reconcile.py and merge into the source |
About to resolve <<<<<<< markers by deleting one side wholesale | Discards a coauthor's edit unreviewed | Read both sides; ask the user when the prose choice is theirs |
About to commit a merge without reading .merged.typ.diff | The merge is a claim about someone else's edits, unverified | Read the diff, then commit |
About to send a .docx built from an uncommitted source | Fallback 3 needs a committed blob; the ancestor is unrecoverable | Canonicalize, commit, then build |
About to run --from-docx without --media-dir because the error is in the way | Every figure is dropped and the output still looks complete | Name the sidecar directory; it is one argument |
About to invoke a script with uv run python3 <path> | The PEP 723 header is ignored and the lxml scripts die on import | uv run --script <path> |
About to hand-fix Officers" in a recovered file | The converter did it, not the source; hand-fixes are re-corrupted next pass | Re-recover with current canonicalize.py, which restores ’ |
| About to name a custom citation function in the body file | pandoc dies with Identifier not found and no docx is produced | #show cite: over the built-in #cite(<Key>) |
About to put live #cite in the file reconcile.py merges into | It can never be canonical; the merge churns on every citation | Keep the symbolic form in body-src.typ, generate the literal one |
About to write #cite(<a>); #cite(<b>) in a stacked footnote | typst groups them and the ; vanishes from the PDF | #cite(<a>)#[;] #cite(<b>) |
About to hand-edit the generated cite-data.typ to fix a short form | It is regenerated, and --diff will report your fix as a delta forever | Fix the .bib or the CSL, then regenerate and diff |
About to patch hayagriva to get supra note N | It is statically linked into typst, and note numbers are a layout property a patch cannot reach | Render citations in typst with a #show cite: rule |
About to typst compile a freshly recovered body and conclude the conversion failed | Word's TOC arrives as links to bookmarks that are not labels | Delete the recovered TOC block; #outline() in main.typ replaces it |
Owns typst → docx, and Bluebook citation rendering in typst — the renderer lives
here rather than in bluebook because it is co-designed with expand_citations.py, which
reads the <bb-out> tag it emits, and that two-file split exists only because of the docx
round trip. bluebook owns the RULES; this skill owns making typst emit them.
law-review-docx and law-econ-docx own markdown → docx; different input format, no
overlap — a markdown manuscript gets Bluebook from pandoc-citeproc and the bundled CSL, and
needs nothing here. docx-repair fixes OOXML damage from a cloud round trip and composes
cleanly before reconcile.py when a returned file is also damaged.
assets/bluebook.typ (opens in a new tab)references/citations.md (opens in a new tab)references/conversion.md (opens in a new tab)references/facts.md (opens in a new tab)references/maintenance.md (opens in a new tab)scripts/bib_to_entries.py (opens in a new tab)scripts/bib_to_entries_test.py (opens in a new tab)scripts/build.py (opens in a new tab)scripts/canonicalize.py (opens in a new tab)scripts/canonicalize_test.py (opens in a new tab)scripts/comments.py (opens in a new tab)scripts/expand_citations.py (opens in a new tab)scripts/expand_citations_test.py (opens in a new tab)scripts/make_redline.py (opens in a new tab)scripts/provenance.py (opens in a new tab)scripts/provenance_test.py (opens in a new tab)scripts/reconcile.py (opens in a new tab)scripts/reconcile_test.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