From mqslim
Slim shadow of mathlib-quality's /develop. Plan a mathematical development — search mathlib, design the API, decompose the proof from the source, write a ticket board. Planning-only; workers run via /bstmode. Source-faithful: every leaf must be discharged from a verbatim source quote OR an explicit API gap. Trusts the model to do the literature work without per-step prescriptions.
How this command is triggered — by the user, by Claude, or both
Slash command
/mqslim:develThe summary Claude sees in its command listing — used to decide when to auto-load this command
# /devel — plan a mathematical development Plan a development. Workers don't run here; once the ticket board is approved, `/bstmode` (or `/beastmode` for the verbose version) picks up the next available ticket and works it. ## Usage ## Source-faithfulness (binding) The single most expensive failure this command exists to prevent is a decomposition that drifts from the source's actual proof. When the plan's leaves are *invented* (chosen because they "look provable in Lean") rather than *transcribed* from the reference's own argument, the tree reliably bottoms out at a lemma the source ...
Plan a development. Workers don't run here; once the ticket board is
approved, /bstmode (or /beastmode for the verbose version) picks up the
next available ticket and works it.
/devel # auto-detect: new, resume, or takeover
/devel --continue # audit existing tickets against the code; propose updates
/devel --status # show the current ticket board
/devel --decompose # run only the methodical decomposition pre-work; no tickets yet
The single most expensive failure this command exists to prevent is a decomposition that drifts from the source's actual proof. When the plan's leaves are invented (chosen because they "look provable in Lean") rather than transcribed from the reference's own argument, the tree reliably bottoms out at a lemma the source never proves — and that lemma is then substantial mathlib-lacking infrastructure or outright false. Every recurrence has the same root cause: leaving the source.
The discipline:
Gather context — what does the user want proved? What's the source (paper, book, blueprint)? What's the scope?
Read the references in full. The user-provided sources are the authoritative target; everything in the plan grounds back to them. If the source isn't on disk, ask for it before planning.
Search mathlib exhaustively for existing definitions and lemmas
you'd want to reuse. Use Lean-Finder, Loogle, LeanSearch, grep, and
lean_local_search. Note both exact matches and more-general
versions.
Design the API. What new definitions? What typeclasses? What namespace conventions? Lean toward Bourbaki 2.0 — abstract typeclass hierarchies, bundled structures, modern formulations. Mathlib doesn't want a vector-space wrapper around module API; don't plan one.
Decomposition pre-work (binding when --decompose is set; mandatory
for any planning that produces tickets).
For each top-level result:
:= by sorry. The
resulting skeleton must lake build clean — if it doesn't, the
statements are wrong, not the proofs.Adversarial attack (mandatory for --decompose). For every leaf,
try ≥3 distinct attacks across these categories:
For every internal node, attack on composition.
Confidence gate before writing tickets. Each leaf must have:
(a) a Lean declaration with := by sorry,
(b) a verbatim source quote,
(c) a citation verified against mathlib / project code / API-gap
sub-decomposition,
(d) survived ≥3 attacks,
(e) the source's structure mirrored (not invented), and
(f) a LOC estimate citing the source's line count.
Gate fails on any miss. Re-do the leaf.
Source-gap fallback. If the source is opaque on a sub-result,
cross-reference other references, then search the literature; as a
last resort, file a numbered question via /exprvw. Affected leaves
enter REVIEW-PENDING and the confidence gate does not pass for them
until the reviewer's answer is integrated.
Save decomposition.md with the full pre-work artifact.
Write the ticket board — .mathlib-quality/tickets.md. Each ticket
self-contained: exact Lean statement, numbered proof sketch citing
sources, the mathlib lemmas needed at each step, the source page +
line for each step, generality decision.
(Optional) Validate with ChatGPT MCP — ask for soundness check on the plan + the API design.
User approval. Print the ticket board summary; wait.
/bstmode./clnup./mthlbl.If a sub-result needs external review (the source is opaque, you're not
sure the leaf is provable), surface via /exprvw and pause that leaf's
ticket — don't speculate.
npx claudepluginhub cbirkbeck/mqslim --plugin mqslim