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/contributegit 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.00017 | $0.01638 |
| Opus 5 | $0.00009 | $0.00819 |
| Sonnet 5 | $0.00003 | $0.00328 |
| Haiku 4.5 | $0.00002 | $0.00164 |
Grade A, and why
contribute 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 — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/contribute - Contribute Learnings Back
Review local learnings and create a PR to contribute them to the mathlib-quality repository, so all users benefit.
Usage
/contribute
/contribute --dry-run (preview without creating PR)
Prerequisites
.mathlib-quality/learnings.jsonlexists with at least one entryghCLI is authenticated (for creating PRs)- Network access to GitHub
Workflow
Step 1: Read Local Learnings
Read .mathlib-quality/learnings.jsonl and parse all entries.
If the file doesn't exist or is empty:
No learnings found in `.mathlib-quality/learnings.jsonl`.
Run some commands (/cleanup, /teach) first to accumulate learnings,
then come back to contribute them.
Step 2: Deduplicate
Remove duplicate entries:
- Same
before_codeANDafter_code= duplicate (keep the more recent one) - Same
descriptionwith sametype= likely duplicate - Entries with
"accepted": falseare kept separately (valuable negative data)
Step 3: Present Summary
Show the user what was found, grouped by type:
## Learnings Summary
Found N learnings in `.mathlib-quality/learnings.jsonl`:
### Golf Patterns (X entries)
1. [theorem_name] Inlined have + term mode: 3 lines → 1 line
2. [theorem_name] grind closed Finset.card goal
3. ...
### Style Corrections (Y entries)
1. Fixed by-placement pattern in 5 proofs
2. ...
### Mathlib Discoveries (Z entries)
1. Replaced custom `finite_of_discrete` with `IsCompact.finite`
2. ...
### User Teachings (W entries)
1. "Always try grind before omega for Fin goals"
2. ...
### Failed Patterns (V entries)
1. grind timed out on algebraic goals with ring structure
2. ...
---
Select which to contribute:
- [a] All accepted learnings (N entries) (Recommended)
- [s] Select individually
- [n] None (cancel)
Step 4: User Selection
Let the user choose which learnings to include. By default, include all entries where "accepted": true. Entries with "accepted": false are included only if the user explicitly selects them (they're valuable as negative examples).
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 · 246 lines · 17 tokens per session scan A f97b72eca1ff
contribute is a command published in the GitHub repository CBirkbeck/mathlib-quality (32 stars, last pushed 14d ago), licensed MIT. It adds 17 tokens to every session and 1,638 once invoked, about $0.0001 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
git
Git operations with intelligent commit messages and workflow optimization.
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.