Install
$ agentstack add skill-cboone-agent-harness-plugins-write-lean-code ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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 buildto 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 you add, rename, restate, or delete anything on a module's public surface, update the matching test file in the same change. Treat the test suite as part of the proof code, not an optional extra. For the compile-time,
example-based regression style those test modules typically use (import discipline, 1:1 naming mirror, composition per milestone, anti-patterns), invoke the companionwrite-lean-testsskill;references/comprehensive/build-infrastructure.mdcovers thetestDriver/defaultTargetswiring side. - 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// 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.
Valid Lean references, in priority order: (1) the project's own code, (2) Mathlib under the project's Mathlib package path (search for both theorem and lemma declarations -- Mathlib uses both), (3) Lean core, and (4) the published documentation linked in the Sources section below.
Mathlib build policy: never use lake build as the first command in a clean worktree or clone. The supported bootstrap path runs lake update, downloads prebuilt Mathlib artifacts with lake exe cache get, verifies those artifacts exist, and only then builds the local libraries. If Mathlib artifacts are missing, rerun the project's bootstrap script rather than letting Lake compile Mathlib from source.
Reference Navigation
Quick reviews (default):
references/essential/checklist.md: condensed, actionable rules
Deep dives by topic:
references/comprehensive/naming.md: identifiers, types, lemmas, files, Mathlib naming schemereferences/comprehensive/style-and-formatting.md: indentation, imports, operators, sectionsreferences/comprehensive/proof-style.md: tactic vs term mode, structured proofs, automation, exploration tacticsreferences/comprehensive/mathlib.md: documentation (module docstrings, tactic docs, citations, linting), variable conventions, API design, heartbeatsreferences/comprehensive/mathlib-api-discovery.md: finding lemmas, navigating the module hierarchy, search strategies, common lookup patternsreferences/comprehensive/general-programming.md: type classes, monads, pattern matching, dependent types, IO,lakereferences/comprehensive/build-infrastructure.md: bootstrap script, Makefile target set,lintDriver, entrypoint manifest,testDrivervsdefaultTargets, and test-library discipline for Mathlib-downstream projectsreferences/comprehensive/pfr-downstream.md: finite-alphabet specialization,noncomputable def+volume_tac, measurability hygiene, and anonymous-constructor pair notation for projects built on PFR's entropy APIreferences/comprehensive/metaprogramming.md: macros, custom tactics, syntax, elaboration, monad hierarchy
Sources
- Lean 4 Language Reference
- Lean 4 Naming Conventions
- Mathlib Library Style Guidelines
- Mathlib Naming Conventions
- Mathlib Documentation Guidelines
- Mathematics in Lean
- Functional Programming in Lean
- Theorem Proving in Lean 4
- Metaprogramming in Lean 4
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: cboone
- Source: cboone/agent-harness-plugins
- License: MIT
- Homepage: https://github.com/cboone/agent-harness-plugins
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.