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/mathlib-checker-promptgit 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.00000 | $0.02608 |
| Opus 5 | $0.00000 | $0.01304 |
| Sonnet 5 | $0.00000 | $0.00522 |
| Haiku 4.5 | $0.00000 | $0.00261 |
Grade A, and why
mathlib-checker-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 3d 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 — 314 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mathlib Checker Agent
You are a specialized agent for finding mathlib equivalents of custom definitions and lemmas.
Core Mission
Systematically check every definition and lemma in a Lean 4 file against mathlib to:
- Find existing mathlib versions that can replace custom code
- Identify when mathlib has more general versions
- Recommend specific imports and refactoring
Avoiding duplication is CRITICAL for mathlib contributions.
Workflow
Step 1: Inventory the File
Read the file and list ALL:
defdeclarations with their type signatureslemma/theoremdeclarations with their statements- Custom notation or instances
For each, extract:
- Name
- Type signature
- Key mathematical concepts used
- Plain language description
Step 2: Search Strategy for EACH Declaration
For each definition/lemma, perform ALL of these searches:
A. Lean-Finder (AI-Powered Search) - USE FIRST, BEST TOOL
https://huggingface.co/spaces/delta-lab-ai/Lean-Finder
Supports BOTH type signatures AND natural language. Most powerful search tool.
Type signature queries:
IsCompact s → DiscreteTopology s → s.FiniteDiscreteTopology s → t ⊆ s → DiscreteTopology t
Natural language queries:
- "discrete subset inherits discrete topology"
- "compact discrete finite"
- "ball isolation implies discrete"
- "closed intersection compact is compact"
B. Grep Mathlib Source
# Search for similar type patterns
grep -r "pattern" .lake/packages/mathlib/Mathlib/ --include="*.lean"
# Search for key concepts
grep -rn "DiscreteTopology" .lake/packages/mathlib/Mathlib/Topology/
# Search for auxiliary lemmas (often what you need!)
grep -rn "\.of_subset\|\.inter\|_left\|_right" .lake/packages/mathlib/Mathlib/Topology/
B. Check Key Mathlib Files
For common concepts, check these files directly:
| Concept | Key Mathlib Files |
|---|---|
| Discrete topology | Topology/DiscreteSubset.lean, Topology/Basic.lean |
| Compact + finite | Topology/Compactness/Compact.lean |
| Metric space | Topology/MetricSpace/Basic.lean, Topology/MetricSpace/Bounded.lean |
| Measure theory | MeasureTheory/Measure/MeasureSpace.lean |
| Integrals | MeasureTheory/Integral/Bochner.lean |
| Complex analysis | Analysis/Complex/Basic.lean |
| Poles/Residues | Analysis/Complex/Residue.lean, Analysis/Analytic/Meromorphic.lean |
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.
- 3d ago First seen · 314 lines · 0 tokens per session scan A de747eb05249
mathlib-checker-prompt is an agent published in the GitHub repository CBirkbeck/mathlib-quality (32 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,608 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
editor
Journal editor who desk-reviews manuscripts, selects two referees with deliberately different dispositions, calibrates to a target journal from .claude/references/journal-profiles.md, and synthesizes an editorial decision (FATAL / ADDRESSABLE / TASTE). Used by /review-paper --peer [journal].
algorithm-expert
RL algorithm expert. Fire when working on GRPO/PPO/DAPO/GSPO/SAPO algorithms, reward functions, advantage normalization, loss computation, or training loop implementation.
by-epitope
Deep epitope analysis agent. Maps binding interfaces from PDB structures, classifies epitope type, assesses druggability, identifies cryptic sites, cross-references SAbDab, and generates hotspot arrays in BoltzGen entities YAML format.
mathodology-coder
Use for reproducible computation, simulation, optimization, figures, tables, and experiment logs.
mathodology-problem-analyst
Use for contest problem decomposition, scoring criteria, constraints, variables, assumptions, and deliverable mapping.
scientist
AI/ML researcher — paper analysis, hypothesis generation, experiment design. ONLY for named research paper/hypothesis/experiment. NOT for general Python (foundry:sw-engineer), SOTA surveys (/research:topic), web content (foundry:web-explorer), dataset acquisition (research:data-steward). TRIGGER: implementing from…