lean-specification
Skill3 starsChanged 24 days agoApache-2.0View on GitHub
USE FOR: Design theorem specifications for Lean 4 proofs. DO NOT USE FOR: actual proof writing (@lean-proof). TRIGGERS: specification, theorem spec, three-part spec, lemma plan.
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-setupSkill
- lean-tautology-triageSkill
- lean-upstream-portingSkill
- lean-vendor-substrateSkill
- lean-zettelkastenSkill
- math-product-managementSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
Run mandatory specification fidelity checks before approving:
- Very specific: line 44
Check 5 (Necessity & Sufficiency
↔Pairing): Every executable Bool checker - Very specific: line 51
STOP if the artifact is informal — extract requirements via @lean-doc-requirements first.
- Very specific: line 52
STOP if the spec depends on Mathlib primitives missing at the pin — escalate to @lean-research.
- Distinctive: line 53
STOP if reviewer would reject on grounds the body covers (vacuous truth, missing hypothesis) — fix before publishing.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lean 4 Theorem Specification
Structured process for specifying theorems before implementation. Every theorem passes through Specify → Design → Implement → Review → Merge, with each stage tracked by document templates.
Routing
- USE FOR: Design theorem specifications for Lean 4 proofs. Use when planning new theorems, lemmas, definitions, or tactics. Covers the three-part specification (requirements, design, documentation), lifecycle management, dependency analysis, and integration with the review council.
- DO NOT USE FOR: actual proof writing (use @lean-proof); requirement extraction (use @lean-doc-requirements); review (use @lean-proof-review).
- TRIGGERS: specification, theorem spec, three-part spec, lemma plan, tactic plan.
Workflow
- Identify the artifact: new theorem, new lemma, new definition, or new tactic.
- Apply the three-part specification template from the body (signature, intent, traceability); verify Mathlib primitives exist at the pin.
- Run mandatory specification fidelity checks before approving:
- Check 5 (Necessity & Sufficiency
↔Pairing): Every executableBoolcheckerf ... : Boolor decidable predicate MUST specify both soundness and completeness (f x = true ↔ Spec x), never a one-wayf x = true -> ...implication alone (ONE_WAY_BOOL_CHECKER).
- Check 5 (Necessity & Sufficiency
Recovery & STOP
- STOP if the artifact is informal — extract requirements via
@lean-doc-requirementsfirst. - STOP if the spec depends on Mathlib primitives missing at the pin — escalate to
@lean-research. - STOP if reviewer would reject on grounds the body covers (vacuous truth, missing hypothesis) — fix before publishing.
Handoffs
- Predecessors:
agent:gateway,skill:lean-research. - Successors:
skill:lean-proof,skill:lean-proof-review,skill:lean-zettelkasten.
Detailed reference
Full encyclopedic reference, decision trees, and lookup tables live in
references/lean-specification-handbook.md .
See also
../../references/lean-specification-handbook.md-- Completelean-specificationHandbook../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.

