write-lean-code

write-lean-code is a skill for Claude Code from cboone/agent-harness-plugins. It costs 51 tokens per session (1,310 once invoked), scanned A, original, MIT.

A style guide for Lean 4, a language that checks mathematical definitions and proofs for correctness.

In plain words
What is it for?
Use it when writing or reviewing Lean files, lemmas, theorems, tactics, and proof changes.
Why use it?
It gives developers consistent ways to structure proofs, use existing Mathlib results, and keep public APIs tested.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md.

Part of the write-lean-code plugin — 1 skill shipped together

Good fit Use it when writing or reviewing Lean files, lemmas, theorems, tactics, and proof changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cboone/agent-harness-plugins/write-lean-code
Install

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.

Any agent
npx skills add cboone/agent-harness-plugins --skill write-lean-code
Clone the repo
git clone --depth 1 https://github.com/cboone/agent-harness-plugins

Made for: Claude Code.

Or install write-lean-code, the plugin that ships this one along with the rest of its 1 skill.

Wrote 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.

agentmods badge for write-lean-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/write-lean-code/github.svg)](https://agentmods.dev/skills/cboone/agent-harness-plugins/write-lean-code)
Your own site
<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.

agentmods 80×15 button for write-lean-code

Your own site · 80×15
<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>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,310 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 3d ago against content hash 51c9167ee4cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 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.

plugins/write-lean-code/skills/write-lean-code/SKILL.md · 70 lines

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

  1. Type-driven development: let the type system guide implementation; express invariants in types
  2. Leverage Mathlib: use existing theorems, definitions, and tactics before building from scratch
  3. Tactic proofs for incremental feedback: prefer tactic mode for complex proofs; use the VS Code infoview for step-by-step development
  4. Clarity and composability: write small, focused lemmas; name them to be discoverable via exact? and apply?

Workflow

  1. In a fresh clone or worktree, run the project's documented bootstrap script before any direct lake build. Mathlib must come from lake exe cache get (prebuilt artifacts), not a local source compilation.
  2. After bootstrap has succeeded in the current worktree, run lake build <Module.Name> to check compilation; run project linters if available.
  3. 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.md for compile-time, example-based regression conventions, including import discipline, mirrored paths and composition per milestone. references/comprehensive/build-infrastructure.md covers testDriver / defaultTargets wiring.
  4. Before declaring a proof change finished, run the project's full local check (build + tests + any proof-boundary or lint checks the project defines).
  5. Review against essential checklist: references/essential/checklist.md
  6. 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.

Read the full file on GitHub · 70 lines

Changes

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.

  1. 3d ago Changed · -5 lines · +2 tokens per session 51c9167ee4cb
  2. 8d ago Changed · +1 lines · +10 tokens per session bf8be8131d70
  3. 25d ago Changed · +4 lines 4f9dd550f2b2
  4. 26d ago Changed · -5 lines · -150 tokens per session b37fcbb5bb2f
  5. 1mo ago First seen · 75 lines · 189 tokens per session scan A 188e312955ed

Subscribe to this mod's changes

write-lean-code is a skill published in the GitHub repository cboone/agent-harness-plugins (2 stars, last pushed yesterday), 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.

Related

Other skills, from other repositories

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for…

agentlas-ai/agentlas-desktop · 67 tokens

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use…

agentlas-ai/agentlas-desktop · 76 tokens

scikit-bio

Biological data toolkit. Sequence analysis, alignments, phylogenetic trees, diversity metrics (alpha/beta, UniFrac), ordination (PCoA), PERMANOVA, FASTA/Newick I/O, for microbiome analysis.

agentlas-ai/agentlas-desktop · 54 tokens

scvelo

RNA velocity analysis with scVelo. Estimate cell state transitions from unspliced/spliced mRNA dynamics, infer trajectory directions, compute latent time, and identify driver genes in single-cell RNA-seq data. Complements Scanpy/scVI-tools for trajectory inference.

agentlas-ai/agentlas-desktop · 56 tokens

simpy

Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.

agentlas-ai/agentlas-desktop · 42 tokens

julia

Julia development guidelines covering multiple dispatch, type system, performance optimization, and scientific computing best practices.

Mindrally/skills · 22 tokens