npx claudepluginhub ancplua/ancplua-lean-proofProve C#/.NET state machines correct with Lean 4 and turn every counterexample into a reproduced, fixed bug. Runs in Claude Code.
Prove the state machines in a C#/.NET codebase correct with Lean 4, and turn every counterexample into a bug that a failing MSTest test reproduces and a draft pull request fixes.
Lean proves the model. The plugin ties the model to the code: Roslyn lists every write site of the modelled state and cites it to a model transition, real runs replay through the model, an independent skeptic agent reviews each model, and a final audit rebuilds the proofs, checks their axioms and replays every module through the Lean kernel.
The plugin follows the workflow Boris Cherny showed in September 2026. From a one-line prompt, Opus 5.5 modelled the Claude Agent SDK's state machines in Lean, and the run became 16 pull requests fixing 24 bugs. Five things made that run work, and each one is a step here:
Each step has one input and one output.
| Step | Input → output |
|---|---|
| Anchor | code → write sites, each cited to a model transition |
| Model | write sites → Lean model |
| Specify | contract → claims |
| Replay | real runs → accepted or rejected traces |
| Review | model → skeptic's report |
| Reproduce | counterexample → failing test |
| Fix | finding → draft pull request |
| Detect | proved claim → killed mutants |
| Simplify | proofs → merged code paths |
| Audit | Lean project → pass or fail |
The repository is its own marketplace:
/plugin marketplace add ANcpLua/ancplua-lean-proof
/plugin install ancplua-lean-proof@ancplua-lean-proof
Ask Claude to prove a state machine, or name the types or files:
/ancplua-lean-proof:lean-proof MyApp.Orders.OrderSaga
Without targets, the skill proposes candidates and starts with the riskiest: state written from several methods, retry and backoff loops, shutdown and drain paths, cancellation and approval flows.
lean-proof: the pipeline above.skeptic: tries to break a model, proof, fix or test, and reports only what it can reproduce.scripts/state-writes.cs: the Roslyn inventory of write sites, as JSON with stable ids.scripts/lean_audit.sh and scripts/axiom_audit.lean: build, axiom and spec audit, and the kernel replay.evals/: a claude plugin eval suite that checks when the skill starts on its own: twelve requests it should start for and twelve just outside its scope. evals/FINDINGS.md has the latest measurement.docs/experiments/: experiments that are planned but not yet run, each with its question, method and decision rule.dotnet run)elan and LakeTested on .NET SDK 10.0.401 (runtime 10.0.12), MSTest.Sdk 4.4.1 on Microsoft.Testing.Platform 2.4.1, and Lean 4.34.1.
dotnet run state-writes.cs restores Microsoft.CodeAnalysis.Workspaces.MSBuild 5.9.0 and Microsoft.CodeAnalysis.CSharp.Workspaces 5.9.0 from nuget.org, loads your project or solution with MSBuild (which evaluates your build files) and prints its inventory to standard output.lean_audit.sh runs lake build, lake env lean --run axiom_audit.lean and lake env leanchecker in your Lake project. lake build fetches the dependencies your lakefile declares.The full privacy policy says the same in one place.
MIT, see LICENSE.
7-day visitors to each marketplace page
Anthropic example skills
Anthropic's Claude Code plugins, installed from the claude-plugins-official repository
Ultra-compressed communication mode. Shortens prose while preserving technical terms, code, commands, and exact errors.