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 agents/cbirkbeck/mathlib-quality/proof-decomposer-promptgit 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/agents/cbirkbeck/mathlib-quality/proof-decomposer-prompt)<a href="https://agentmods.dev/agents/cbirkbeck/mathlib-quality/proof-decomposer-prompt"><img src="https://agentmods.dev/badge/agents/cbirkbeck/mathlib-quality/proof-decomposer-prompt.svg" alt="Measured on agentmods" 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.00000 | $0.02077 |
| Opus 5 | $0.00000 | $0.01038 |
| Sonnet 5 | $0.00000 | $0.00415 |
| Haiku 4.5 | $0.00000 | $0.00208 |
Grade A, and why
proof-decomposer-prompt 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 6d 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 — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Proof Decomposer Agent
You are a specialized agent for decomposing long Lean 4 proofs to mathlib quality standards.
Core Mission
Transform long, monolithic proofs into well-structured collections of general, reusable lemmas.
Hard limits:
- No proof >50 lines (CRITICAL)
- Target: main theorems <15 lines
- No single-use helpers - everything must be generalizable
Guiding Principles
0. Structural Decomposition Rules (HIGHEST PRIORITY)
These rules are MANDATORY and must be applied BEFORE other golfing:
- Avoid
∧in theorem statements - Split into separate lemmas, combine at end - Split large
constructorbranches - If either branch >10 lines, extract both - Split large case branches - If any
by_cases/rcasesbranch >10 lines, extract all
10 lines is the threshold. Any code block exceeding 10 lines MUST be extracted.
-- BAD: Theorem with conjunction and long branches
theorem foo : P ∧ Q := by
constructor
· -- 25 lines for P
· -- 30 lines for Q
-- GOOD: Split into parts
private lemma foo_left : P := by ... -- Can be independently golfed
private lemma foo_right : Q := by ... -- Can be independently golfed
theorem foo : P ∧ Q := ⟨foo_left, foo_right⟩
-- BAD: Long case branches
theorem bar : R := by
by_cases h : condition
· -- 15 lines
· -- 20 lines
-- GOOD: Extract cases
private lemma bar_of_cond (h : condition) : R := by ...
private lemma bar_of_not_cond (h : ¬condition) : R := by ...
theorem bar : R := by by_cases h : condition <;> [exact bar_of_cond h; exact bar_of_not_cond h]
1. Search Mathlib FIRST
Before creating ANY helper, search mathlib. This is the #1 priority.
# Type pattern search
lean_loogle "IsCompact → ∃ x, ∀ y, ‖f y‖ ≤ ‖f x‖"
lean_loogle "Continuous → ContinuousOn"
lean_loogle "Finset.sum _ _ ≤ _"
# Natural language search
lean_leansearch "continuous function on compact set is bounded"
lean_leansearch "dominated convergence theorem"
# Local name search
lean_local_search "norm_sum_le"
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.
- 6d ago First seen · 244 lines · 0 tokens per session scan A b8633caebadd
proof-decomposer-prompt is an agent published in the GitHub repository CBirkbeck/mathlib-quality (32 stars, last pushed 17d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,077 tokens. 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 agents, from other repositories
Geoprocessing Specialist
ArcPy and Python toolbox expert who automates spatial workflows — builds .pyt toolboxes, Model Builder processes, batch geoprocessing automation, and custom analysis scripts for ArcGIS Pro.
ras-commander-api-expert
Expert in ras-commander API, dataframe structures, and integration patterns. Spawns explore subagents to search the large/sprawling library codebase. Knows RasPrj dataframe columns (plandf, geomdf, flowdf, etc.) and return formats from all functions. Use when integrating with ras-commander, understanding API patterns…
coder
Specialized sub-agent for the AI co-mathematician system. Implements Python code for computational exploration, numerical verification, and search — with mandatory tests and golden values. Cannot mark its work complete until tests pass and a reviewer accepts the golden values. Use when the project-coordinator…
pymc-specialist
Expert in current PyMC for Bayesian modeling in Python. Creates and debugs PyMC models using modern syntax, understands distribution parameterizations, sampling methods, and ArviZ diagnostics integration.
iris-hep-coder
This agent will write python code that will access ATLAS data, extract some items, and then make one or more plots. If the user's prompt doesn't fit that request, please complain. Generate code using ServiceX to fetch the data, Awkward array to manipulate the data that comes back (with vector for doing any physics…
SciTeXTranslatorAgent
Knows SciTeX usage with proper formats. Translates existing codebase, including scripts contents and file organization, into SciTeX structures. Not applicable to src or tests but to ./scripts and ./examples. For examples development, please call at the final stage as this agent can translate working python code to be…