writing-lean-proofs

writing-lean-proofs is a skill for Claude Code, Codex from OutlineDriven/odin-claude-plugin. It costs 56 tokens per session (1,499 once invoked), scanned A, original, Apache-2.0.

A guide for designing, writing, reviewing, refactoring, linting, and performance-checking Lean 4 proofs and libraries. Lean 4 is a programming language and proof tool that checks mathematical statements and their proofs.

In plain words
What is it for?
Use it for Lean theorem proofs, formal definitions, proof obligations, library APIs, tactics, and Lean-specific lint or performance work.
Why use it?
It helps keep proof statements stable, proofs structured, and code compatible with the project's Lean toolchain and lint rules.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the odin-formal plugin — 9 skills shipped together

Good fit Use it for Lean theorem proofs, formal definitions, proof obligations, library APIs, tactics, and Lean-specific lint or performance work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/outlinedriven/odin-claude-plugin/writing-lean-proofs
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 OutlineDriven/odin-claude-plugin --skill writing-lean-proofs
Clone the repo
git clone --depth 1 https://github.com/OutlineDriven/odin-claude-plugin

Made for: Claude Code, Codex.

Or install odin-formal, the plugin that ships this one along with the rest of its 9 skills.

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 writing-lean-proofs

README.md
[![agentmods](https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/writing-lean-proofs/github.svg)](https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/writing-lean-proofs)
Your own site
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/writing-lean-proofs"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/writing-lean-proofs/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 writing-lean-proofs

Your own site · 80×15
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/writing-lean-proofs"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/writing-lean-proofs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,499 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Anti-Refusal · line 28
    Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.
    Fix: Remove instructions that suppress warnings, disclaimers, or ethical commentary. Let the agent surface safety-relevant caveats to the user.
How audits are shown
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.00056 $0.01499
Opus 5 $0.00028 $0.00749
Sonnet 5 $0.00011 $0.00300
Haiku 4.5 $0.00006 $0.00150

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

Security

Grade A, and why

writing-lean-proofs 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/odin-formal/skills/writing-lean-proofs/SKILL.md · 37 lines

How it starts

The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Writing Lean proofs

Contract

Field Bound contract
Trigger The task is to design, write, review, refactor, lint, or performance-diagnose Lean 4 proofs, libraries, or tactic extensions under Mathlib conventions.
Authority Reversible local: writes only Lean source files, library API, proof structure, and project linter configuration, plus scoped mechanical Lean checks; rollback is version control. No remote mutation.
Side effect Local writes to Lean source, library API, proof structure, project linter configuration, and scoped mechanical Lean checks. No remote mutation, credential change, paid action, or deployment.
Done The requested Lean declarations have stable statements and structured proofs, compile under the project toolchain, and satisfy the selected axiom and linter policy.

Inputs

A Lean 4 project with a working lakefile.lean and toolchain (lean-toolchain) is required, along with target theorem statements, definitions to formalize, or proof obligations to discharge. Optional inputs include project-specific linter configuration, axiom policy (default: [propext, Classical.choice, Quot.sound]), maxHeartbeats budget, and Mathlib dependency.

Procedure

  1. Design definitions and their API first. Prefer total functions with junk values over subtypes or Option in signatures. Bundle morphisms with FunLike, subobjects with SetLike. Pick the canonical simp-normal form for every concept. Write ext, @[simp], coercion, and injectivity lemmas in the same file immediately after the definition. Never use unfold or show ... from rfl downstream. Done when: every definition has its API lemmas co-located and the simp-normal form is chosen.
  2. Build a sorry skeleton. State the target theorem and every lemma it needs with := sorry. Verify the file compiles. Each sorry is an independent work unit. Inside a proof, lay out have/suffices/calc skeleton with sorry justifications and verify Lean accepts the structure before filling. Done when: the skeleton compiles and every sorry is an identified work unit.
  3. Fill goals one focused goal at a time. Every subgoal gets a focusing dot · with an indented block. Open each block with a redundant show stating its goal; use change instead if show would alter the goal. Chained rewrites of (in)equalities become calc blocks with relations aligned vertically. Use have for forward stepping stones, suffices for backward reduction. Annotate goal state as a comment before non-obvious tactics; in headless workflows insert trace_state or deliberate done, run lake env lean Path/To/File.lean, and copy reported hypotheses and target. Strip probes after the proof works. Done when: every sorry is replaced with a structured proof and probes are stripped.
  4. Verify mechanically. Run lake build: a green build is the floor, not the gate, because sorry exits 0. Gate unproved obligations by asking the kernel: #print axioms myTheorem for spot checks; for CI, collect axioms per declaration with Lean.collectAxioms and assert the whole expected footprint ([propext, Classical.choice, Quot.sound] unless deliberately widened) so stray sorry or new trust assumptions like native_decide fail loudly. Never grep for sorry: it matches comments and misses unproved helpers. Done when: lake build passes and the axiom footprint matches the declared policy.
  5. Apply the extraction ladder. Before extracting, state the fragment type in a scratch example, run exact? and apply? on the bare goal, then try type-pattern and source search. Level 0: sub-argument repeats within one proof → local have. Level 1: statement is independently interesting or extraction sheds hypotheses → standalone lemma. Level 2: proof reads as long and unwieldy → split; if a fragment has a clean statement, it wanted to be a lemma. Done when: every extractable fragment is at the right level of the ladder.
  6. Run project linters. Self-contained proof: linter.auxLemma, linter.style.maxHeartbeats, linter.style.multiGoal, linter.style.setOption, linter.style.show. Reusable library: also linter.flexible, linter.style.missingEnd, linter.style.openClassical, unused*InType. Treat nativeDecide as a trust-policy choice. Run Batteries' declaration-level #lint checks including simpNF separately. Verify every option against pinned Mathlib source with a known-trigger fixture. No warning gates anything unless warnings fail the build. Done when: linter output is clean under the selected profile.
  7. Write a custom linter for every project-specific convention. A declaration-level @[env_linter] is one structure. It is the only mechanism that reliably catches missing attributes across declarations. Include vacuity anchors, prove-it-can-fail fixtures, and allowlists. Done when: the custom linter is written with vacuity anchors and failure fixtures.
  8. Diagnose performance. Measure per-declaration cost with #count_heartbeats before adjusting maxHeartbeats. Every maxHeartbeats override is an unproven claim. Conditional simp lemma fires shallow but not deep → raise maxDischargeDepth (default 2). Re-derive every simp only list with simp? at its own site. Done when: performance is measured and every maxHeartbeats override is justified by measurement.

Read the full file on GitHub · 37 lines

Files

What ships with it

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

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 First seen · 37 lines · 56 tokens per session scan A e649501f2413

Subscribe to this mod's changes

writing-lean-proofs is a skill published in the GitHub repository OutlineDriven/odin-claude-plugin (35 stars, last pushed 2d ago), licensed Apache-2.0. It adds 56 tokens to every session and 1,499 once invoked, about $0.0003 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-09-06.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens