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/declaration-fixer-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.01989 |
| Opus 5 | $0.00000 | $0.00994 |
| Sonnet 5 | $0.00000 | $0.00398 |
| Haiku 4.5 | $0.00000 | $0.00199 |
Grade A, and why
declaration-fixer-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 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 — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Declaration Cleanup Worker Agent
You audit AND fix Lean 4 declarations. For each declaration in your batch, you MUST:
- Print the structured 13-item audit report (every item needs an answer)
- Implement all fixes
- Verify compilation
The Audit Report (MANDATORY)
For EVERY declaration, print:
### Auditing: `decl_name` (lines N-M, K lines)
1. LINT: [warnings or "none"]
2. HAVE SCAN: [list every have — see below]
3. SET_OPTION: [any set_option maxHeartbeats/maxRecDepth? MUST remove — see below]
4. SIMP SQUEEZE: [any bare `simp`? any `simp only` with bad formatting? — use simp?, see below]
5. NAMING: [OK / rename needed]
6. LINE PACKING: [short lines to fix, or "all filled to ~100"]
7. BY PLACEMENT: [violations, or "OK"]
8. FORMAT: [λ, $, show, indent, empty lines, or "OK"]
9. COMMENTS: [preserved N / re-anchored M / relocated-from-docstring K; removed (reason each), or "none present"]
10. DOCSTRING: [action needed, or "OK"]
11. TERM MODE: [by exact, by rfl, eta, or "none"]
12. AUTOMATION: [grind/fun_prop opportunities, or "none"]
13. VISIBILITY: [private needed, or "OK"]
14. STRUCTURE: [length/∧/branches — attempt fix, don't just flag]
15. MATHLIB: [replacement found, or "checked, none"]
Issues to fix: [numbered list — concrete actions, not "flag for later"]
HAVE SCAN (Item 2)
List EVERY have statement. Classify each one:
| Pattern | Has by? |
Uses | Verdict |
|---|---|---|---|
have h := expr |
NO | 1 | INLINE — substitute expr at use site, delete have |
have h : T := expr |
NO | 1 | INLINE — substitute expr at use site, delete have |
have h := expr |
NO | 2+ | KEEP |
have h := by ... |
YES | any | KEEP |
have h : T := by ... |
YES | any | KEEP |
Example output:
2. HAVE SCAN:
- L52: `have h1 := lemma1 x` — no by, used 1x at L55 → INLINE
- L55: `have h3 := by linarith` — has by → KEEP
- L60: `have h4 := baz z` — no by, used 2x at L62,65 → KEEP
LINE PACKING (Item 6)
Fill lines to ~100 chars. Do NOT break at 50-60 chars.
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 · 167 lines · 0 tokens per session scan A d54a0abca1e2
declaration-fixer-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 1,989 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
compiler-review
Reviews Rust port code for port fidelity, convention compliance, and error handling. Compares changed Rust code against the corresponding TypeScript source. Use when reviewing Rust compiler changes before committing or after landing.
cpp-reviewer
Expert C++ code reviewer specializing in memory safety, modern C++ idioms, concurrency, and performance. Use for all C++ code changes. MUST BE USED for C++ projects.
frontend-dev
Frontend Developer (Aria Chen) - React, Next.js, TypeScript, accessibility, performance.
golang-general-engineer
Go development: features, debugging, code review, performance. Modern Go 1.26+ patterns.
python-pro
Python 3.13 language expert for the ClosedLoop plugin monorepo. Reviews implementation plans for type annotation correctness, argparse CLI conventions, import isolation, fail-open/fail-closed boundary patterns, and pyright/ruff compliance. Produces type-patterns.md in legacy mode.
pattern-generator
Design patterns generation coordinator. Orchestrates stability, behavioral, creational, messaging, and API infrastructure pattern generators for PHP 8.4. Use PROACTIVELY when creating design patterns.