Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/cbirkbeck/mathlib-quality/mathlibablegit clone --depth 1 https://github.com/CBirkbeck/mathlib-qualityWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00190 | $0.16696 |
| Opus 5 | $0.00095 | $0.08348 |
| Sonnet 5 | $0.00038 | $0.03339 |
| Haiku 4.5 | $0.00019 | $0.01670 |
Grade A, and why
mathlibable scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 1,360 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/mathlibable — Should this declaration be in mathlib?
Take one Lean declaration and answer the question: should mathlib have this? The answer is rarely obvious. The skill exists to do the search work that makes the answer well-founded — and to refuse to produce a verdict without the evidence.
This is a hard, slow workflow. Mathlib's bar isn't "is this true and useful"; it is "is this the right statement at the right level of generality, and not already there in some form we should be reusing?" Getting that right takes thorough literature + mathlib search. Skipping the search produces wrong verdicts.
Usage
/mathlibable <Foo.bar> # Mode A: one declaration; full 10-phase workflow
/mathlibable <file.lean> # Mode B: every public decl in this file; orchestrator-worker
/mathlibable <file1.lean> <file2.lean> ... # Mode B: same, across multiple files
There is no --quick flag and no --exhaustive flag. Every invocation runs
the full exhaustive literature search. Mathlib is Bourbaki 2.0 — adding the
right declaration in the right form requires doing the thorough work every
time. Producing a verdict in five minutes by skipping channels is exactly the
failure mode this skill exists to prevent.
Mode B is slow by design. Each public declaration in the file(s) gets its
own full 10-phase workflow (one Agent per decl). On a 30-decl file with the
exhaustive lit search, plan on hours. The orchestrator narrates a one-line
scoreboard between dispatches so you can leave it running. If you only want
to know which declarations are worth investing this kind of work in, run
/overview first — its Step 9 mathlibable triage assigns each decl to
SKIP / LIKELY-NO / LIKELY-YES / WORTH-FULL-CHECK based on cheap
signals only.
Prerequisites
lake buildclean (the declaration must elaborate; we read its full elaborated type, not a sorry-placeholder).- The declaration exists in the current Lean project. Mathlib-tree decls aren't in
scope — if you want to ask "should this mathlib decl be more general?", use
/generaliseinstead. - Optional but highly valuable: a
.mathlib-quality/references/directory of source-paper PDFs / notes. The literature search reads these first; with them, the standard-form question is often answered in seconds. Without them, the skill falls back to WebSearch + ChatGPT MCP + nLab/Stacks; still works, takes longer.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 1,360 lines · 0 tokens per session scan A 4beeb5d910a7
mathlibable is a command published in the GitHub repository CBirkbeck/mathlib-quality (32 stars, last pushed 13d ago), licensed MIT. It adds 190 tokens to every session and 16,696 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.