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.
git clone --depth 1 https://github.com/CBirkbeck/mathlib-qualityWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/cbirkbeck/mathlib-quality/decompose-proof)<a href="https://agentmods.dev/commands/cbirkbeck/mathlib-quality/decompose-proof"><img src="https://agentmods.dev/badge/commands/cbirkbeck/mathlib-quality/decompose-proof/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/cbirkbeck/mathlib-quality/decompose-proof"><img src="https://agentmods.dev/badge/commands/cbirkbeck/mathlib-quality/decompose-proof.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What 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.1 | $0.00011 | $0.05527 |
| Opus 5.5 | $0.00004 | $0.02211 |
| Sonnet 5.5 | $0.00002 | $0.01105 |
| Haiku 4.5 | $0.00001 | $0.00553 |
Grade A, and why
decompose-proof 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 3mo 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 — 587 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/decompose-proof - Two-Pass Proof Decomposition
CRITICAL: No proof should exceed 50 lines. Target: main theorems <15 lines.
Break long proofs into helper lemmas by understanding the mathematical structure first, then implementing.
Usage
/decompose-proof [file_path]
/decompose-proof [theorem_name]
If no argument, operates on the currently open file.
Architecture
Problem: Agents rush into decomposition without fully understanding the proof. They miss mathlib lemmas, create single-use helpers with bad names, and forget to consolidate.
Solution: Separate analysis from implementation:
- Pass 1 (Analysis): Identify ALL proofs needing decomposition. For each, study the mathematics and write a detailed decomposition plan as a comment block above the proof.
- Pass 2 (Decompose): Dispatch parallel agents, each handling one proof. They study the proof, search mathlib, then implement the plan.
- Pass 3 (Consolidate): Review all new helpers for duplicates and shared patterns.
Pass 1: Analysis
Step 1: Identify Candidates
Read the entire file and build a table of ALL proofs by length:
## Proof Length Report
| Declaration | Lines | Action |
|-------------|-------|--------|
| `main_theorem` | 65 | CRITICAL (>50) — aggressive decomposition |
| `helper_result` | 38 | MUST decompose (>30) |
| `medium_proof` | 22 | CONSIDER decomposition (15-30) |
| `small_lemma` | 12 | OK |
Also flag structural issues regardless of length:
∧in theorem statement → MUST splitconstructorwith any branch >10 lines → MUST extract branchesby_cases/rcases/match/inductionwith any branch >10 lines → MUST extract branchesset_option maxHeartbeats→ MUST decompose (remove the set_option)
Step 2: Study Each Candidate
For EACH proof flagged for decomposition, read it carefully before writing any plan. Answer these questions (write answers in your reasoning, not in the file):
- What is the theorem proving? (plain language, 1-2 sentences)
- What are the key mathematical steps? (3-5 bullet points, using math language like "establish bound", "show convergence", NOT "apply lemma X")
- What independent facts are being established? (each is a candidate helper)
- What estimates/bounds appear? (
have h : ‖...‖ ≤ ...blocks are extraction candidates) - Are there cases/branches >10 lines? (mandatory extraction)
- Are there repeated patterns across proofs? (consolidation candidates)
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.
- 3mo ago First seen · 587 lines · 11 tokens per session scan A 60d3ff87a85c
decompose-proof is a command published in the GitHub repository CBirkbeck/mathlib-quality (38 stars, last pushed 7d ago), licensed MIT. It adds 11 tokens to every session and 5,527 once invoked, about $0.0000 per session on Opus 5.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.
decompose-proof compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| decompose-proofCBirkbeck/mathlib-quality | Command | 38 | 7d ago | MIT | A | 11 | Claude Code |
| difffa-mc/vibe-cading | Command | 8 | 1mo ago | AGPL-3.0 | A | 14 | Claude Code |
| arg-diagramMasqiller/ARG-RESEARCHER-V4.1 | Command | 6 | 6mo ago | MIT | A | 14 | Claude Code |
| plotzhouziyue233/great-econometrics | Command | 9 | 7mo ago | none | A | 44 | Claude Code |
| graphite-morphology-classifyDaxxSec/cognitropy-lab | Command | 2 | 5mo ago | none | A | 0 | Claude Code |
| checklistgithub/spec-kit | Command | 153k | today | MIT | A | 13 | Claude Code |
| clarifygithub/spec-kit | Command | 153k | today | MIT | A | 27 | Claude Code |