
Write Lean Tests
- 2 repo stars
- Updated July 24, 2026
- cboone/agent-harness-plugins
Conventions for compile-time, example-based Lean 4 API regression tests that mirror a library's public surface.
About
Write-lean-tests defines conventions for compile-time, example-based Lean 4 API regression tests that mirror a library's public surface. It helps formal-methods authors lock in API behavior so changes that break the public interface are caught at compile time. Aimed at Lean and Mathlib library maintainers.
- Lean 4 regression tests
- Compile-time, example-based
- Mirrors public API surface
- Mathlib-aligned
Write Lean Tests by the numbers
- Data as of Jul 25, 2026 (Skillselion catalog sync)
/plugin marketplace add cboone/agent-harness-plugins/plugin install write-lean-tests@agent-harness-pluginsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| repo stars | ★ 2 |
|---|---|
| Last updated | July 24, 2026 |
| Repository | cboone/agent-harness-plugins ↗ |
What it does
Conventions for compile-time, example-based Lean 4 API regression tests that mirror a library's public surface.
README.md
Write Lean Tests
Conventions for compile-time, example-based Lean 4 API regression tests that mirror a library's public surface.
Type: Skill
Trigger: /write-lean-tests (also activates automatically)
Installation
See the marketplace install instructions.
What It Does
Provides conventions for the test-side of Lean libraries: a sibling <Name>Test/ directory of compile-time example-based regression tests that pin every exported definition and lemma to its public signature. Tests catch accidental renames, tightened hypotheses, and removed re-exports in a deliberate, localized way. Pairs with the write-lean-code skill, which governs the library code itself.
Covers test mirroring (1:1 with library structure), import discipline (public surface only, no Internal reach-arounds), composition tests per milestone, build-gate wiring (testDriver vs default targets), and anti-patterns to avoid.
Usage
/write-lean-tests
The skill also activates automatically when Claude Code touches files under a <Name>Test/ directory or wires lake test configuration.
Examples
- Adding a new module under the main library and creating its sibling test module
- Reviewing a PR that touches library or test code
- Wiring
lake testviatestDriverinlakefile.tomlorlakefile.lean - "/write-lean-tests": loads the full conventions explicitly
See Also
- Write Lean Code: the library-side companion (naming, proof style, Mathlib conventions)
- Write Formalization Roadmap: structuring multi-milestone proof projects with parallel test surface
- All plugins