lean-setup
Skill3 starsChanged 24 days agoApache-2.0View on GitHub
USE FOR: bootstrapping a Lean 4 project or toolchain, configuring elan, pinning `lean-toolchain`. DO NOT USE FOR: building Lake projects (@lean-build); bisecting regressions (@lean-bisect). TRIGGERS: elan, lean-toolchain, lake serve, moreServerArgs.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- VeryMath/AI4Math-Lean-Agentstheir own version, first seen Oct 11, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- VeryMath/AI4Math-Lean-Agents★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-guard-judge-evalSkill
- applied-data-information-securitySkill
- applied-engineering-disciplinesSkill
- applied-legal-reasoningSkill
- epistemic-discovery-engineSkill
- epistemic-mappingSkill
- hol-metamath-adapterSkill
- isabelle-isar-adapterSkill
- itp-cross-portingSkill
- lean-ai-formalizationSkill
- lean-applied-reasoningSkill
- lean-axiom-closureSkill
- lean-bigraph-modelingSkill
- lean-bisectSkill
- lean-blueprintSkill
- lean-buildSkill
- lean-causal-reasoningSkill
- lean-competitive-mathSkill
- lean-convergence-verificationSkill
- lean-core-onlySkill
- lean-dag-visualizerSkill
- lean-deep-auditSkill
- lean-doc-feedbackSkill
- lean-doc-improvementSkill
- lean-doc-requirementsSkill
- lean-enforcementSkill
- lean-formalization-breakdownSkill
- lean-gatewaySkill
- lean-integration-protocolSkill
- lean-knowledge-formalizationSkill
- lean-math-analysisSkill
- lean-math-discreteSkill
- lean-math-dynamicalSkill
- lean-math-foundationsSkill
- lean-math-optimizationSkill
- lean-math-stochasticSkill
- lean-mweSkill
- lean-nested-learningSkill
- lean-package-researchSkill
- lean-pedagogical-expositionSkill
- lean-proof-refactorSkill
- lean-proof-repairSkill
- lean-proof-reviewSkill
- lean-proofSkill
- lean-prSkill
- lean-quality-engineSkill
- lean-replay-verificationSkill
- lean-reportSkill
- lean-researchSkill
- lean-retroactive-auditSkill
- lean-retro-methodologySkill
- lean-review-councilSkill
- lean-security-formalizationSkill
- lean-specificationSkill
- lean-tautology-triageSkill
- lean-upstream-portingSkill
- lean-vendor-substrateSkill
- lean-zettelkastenSkill
- math-product-managementSkill
- The first 60 shown.
The file
Files
lean-setup
MANDATORY (hot-tier): the gates in Section Behavioural rules and the Persist
Routing
- USE FOR: configuring
elantoolchains; pinninglean-toolchain; configuring Lake server arguments (moreServerArgs) to prevent OOM SIGKILL and stack exhaustion; discovering Lean C sysroot paths vialean --print-prefix; verifyinglean --versionandlake env lean --versionagree; bootstrapping or repairing local builds. - DO NOT USE FOR: building Mathlib or downstream Lake projects (use
@lean-build); bisecting which commit changed behaviour (use@lean-bisect); minimising an error into a reproducer (use@lean-mwe); writing proofs against an existing toolchain (use@lean-proof); scaffolding new lakefiles for
Workflow
- Discover [discover] -- inspect clone state: check
lean-toolchain,elan list, and lakefile configuration. Identify whether this is fresh project setup, version bump, or toolchain repair. - Plan [discover] -- choose toolchain release or disambiguated name; identify required server arguments
(
moreServerArgs). STOP if confidence < 80% on naming or version target. - Execute [execute] -- install/link toolchain (
elan toolchain installorcmake+elan toolchain link); writelean-toolchain; configuremoreServerArgsinlakefile.lean. - Verify [validate] --
lean --versionmatches target (G-6);lake env lean --versionagrees (G-7);lake servestarts without watchdog errors. On disagreement, fix overrides; max 3 attempts then escalate.
Recovery & STOP
make -j -C build/releaseorelandownload fails x3 -> STOP, escalate to human; do not retry blindly.lean --versionandlake env lean --versiondisagree after 3 fix attempts -> STOP, escalate (G-8 forbids handing off).- Scope drift (edit files outside
lean-toolchainfamily or lakefile) -> immediate STOP, re-anchor. - Confidence < 80% on toolchain naming or release compatibility -> STOP, ask.
Handoffs
- Predecessors / successors: see FM
handoffs.lean-setupis a root node. Typical outbound:@lean-build(compile project),@lean-proof(start tactic proving),@lean-bisect(investigate regressions),@lean-mwe(reproduce toolchain bugs). - Sister skills:
@lean-buildfor Lake builds;@lean-prooffor live proving. - Source spec:
specs/lean/setup/requirements.md.
Detailed reference
Full encyclopedic reference, decision trees, and lookup tables live in
references/lean-setup-handbook.md .
See also
../../references/lean-setup-handbook.md-- Completelean-setupHandbook../lean-gateway/SKILL.md-- Top-level skill router
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

