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 skills add cboone/agent-harness-plugins --skill write-lean-codegit clone --depth 1 https://github.com/cboone/agent-harness-pluginsWrote 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/skills/cboone/agent-harness-plugins/write-lean-code)<a href="https://agentmods.dev/skills/cboone/agent-harness-plugins/write-lean-code"><img src="https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/write-lean-code/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/skills/cboone/agent-harness-plugins/write-lean-code"><img src="https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/write-lean-code.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.00051 | $0.01310 |
| Opus 5.5 | $0.00020 | $0.00524 |
| Sonnet 5.5 | $0.00010 | $0.00262 |
| Haiku 4.5 | $0.00005 | $0.00131 |
Grade A, and why
write-lean-code 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 1mo 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 — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Write Lean Code
Core Principles
- Type-driven development: let the type system guide implementation; express invariants in types
- Leverage Mathlib: use existing theorems, definitions, and tactics before building from scratch
- Tactic proofs for incremental feedback: prefer tactic mode for complex proofs; use the VS Code infoview for step-by-step development
- Clarity and composability: write small, focused lemmas; name them to be discoverable via
exact?andapply?
Workflow
- In a fresh clone or worktree, run the project's documented bootstrap script before any direct
lake build. Mathlib must come fromlake exe cache get(prebuilt artifacts), not a local source compilation. - After bootstrap has succeeded in the current worktree, run
lake build <Module.Name>to check compilation; run project linters if available. - Update the tests in the same change as the proof code if the project has a test suite that mirrors the proof code. Whenever a module's public surface changes, update the matching test file. Read
./references/tests/workflow.mdfor compile-time,example-based regression conventions, including import discipline, mirrored paths and composition per milestone.references/comprehensive/build-infrastructure.mdcoverstestDriver/defaultTargetswiring. - Before declaring a proof change finished, run the project's full local check (build + tests + any proof-boundary or lint checks the project defines).
- Review against essential checklist:
references/essential/checklist.md - For specific questions, consult:
references/comprehensive/{topic}.md
Project-Local Caveats
Each project using this skill should document its own bootstrap script, test-mirroring convention, namespace rules, and any vendored Lean dependencies that must be excluded from style searches. Read the invoking project's CLAUDE.md (or equivalent agent-config file) for those specifics before applying the generic guidance below.
Vendored Lean dependencies are not style references. When a project pulls in a third-party Lean library through lake (under .lake/packages/<name>/ or the equivalent), that code is a build artifact, not a reference for Lean naming, proof style, tactic preferences, comment or docstring format, file structure, or math prose. Exclude such paths from grep-for-conventions searches. The invoking project's CLAUDE.md should name the specific packages to exclude.
What ships with it
12 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/comprehensive/build-infrastructure.md 14 KB
- references/comprehensive/general-programming.md 7.8 KB
- references/comprehensive/mathlib-api-discovery.md 20 KB
- references/comprehensive/mathlib.md 12 KB
- references/comprehensive/metaprogramming.md 7.9 KB
- references/comprehensive/naming.md 16 KB
- references/comprehensive/pfr-downstream.md 8.5 KB
- references/comprehensive/proof-style.md 10 KB
- references/comprehensive/style-and-formatting.md 14 KB
- references/essential/checklist.md 9.2 KB
- references/review-checklist.md 4.7 KB
- references/tests/workflow.md 13 KB
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.
- 1mo ago Changed · -5 lines · +2 tokens per session 51c9167ee4cb
- 1mo ago Changed · +1 lines · +10 tokens per session bf8be8131d70
- 2mo ago Changed · +4 lines 4f9dd550f2b2
- 2mo ago Changed · -5 lines · -150 tokens per session b37fcbb5bb2f
- 2mo ago First seen · 75 lines · 189 tokens per session scan A 188e312955ed
write-lean-code is a skill published in the GitHub repository cboone/agent-harness-plugins (3 stars, last pushed 5d ago), licensed MIT. It adds 51 tokens to every session and 1,310 once invoked, about $0.0002 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-09-03.
write-lean-code compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| write-lean-codecboone/agent-harness-plugins | Skill | 3 | 5d ago | MIT | A | 51 | Claude Code |
| cirqagentlas-ai/agentlas-desktop | Skill | 10 | 2d ago | Apache-2.0 | A | 67 | Claude Code |
| biopythonagentlas-ai/agentlas-desktop | Skill | 10 | 2d ago | Apache-2.0 | A | 76 | Claude Code |
| scikit-bioagentlas-ai/agentlas-desktop | Skill | 10 | 2d ago | Apache-2.0 | A | 54 | Claude Code |
| simpyagentlas-ai/agentlas-desktop | Skill | 10 | 2d ago | Apache-2.0 | A | 42 | Claude Code |
| scveloagentlas-ai/agentlas-desktop | Skill | 10 | 2d ago | Apache-2.0 | A | 56 | Claude Code, Codex |
| cuequivariance-jaxNVIDIA/skills | Skill | 4.2k | today | Apache-2.0 | A | 38 | Claude Code, Codex |