lean-gateway
Skill3 starsChanged 24 days agoApache-2.0View on GitHub
USE FOR: routing the top-level entry-point for a complex Lean 4 task; selecting which downstream skill(s) own each phase. DO NOT USE FOR: doing any actual work (always delegate to a domain skill). TRIGGERS: gateway, orchestrate, route, dispatch, top-level.
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-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-specificationSkill
- 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
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 64
No clear owning skill for a phase → STOP, ask which skill to add or extend.
≈ “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-gateway
⚠️ MANDATORY (hot-tier): the gateway NEVER does substantive proof or documentation work — every operation is a delegation. Skipping Persist (the global task tracker) = incomplete.
Routing
- USE FOR: receiving a Lean 4 task at session start, decomposing it into phases, routing each phase to the
appropriate skill
in
references/lean-gateway-handbook.mdPart 1's registry; deciding fan-in vs fan-out vs sequential topology; maintaining the per-task state document; detecting context-collapse signals and prescribing a fresh session. - DO NOT USE FOR: writing a proof (delegate to
@lean-proof); reviewing a proof (delegate to@lean-proof-review); editing docs (delegate to@lean-doc-improvement); running scripts (delegate to@lean-enforcement).
Workflow
- Discover [discover] — receive the task, locate prior tracker for this scope (if any), enumerate the candidate skills from the registry.
- Plan [discover] — partition the task into phases; for each phase, pick the owning skill; choose topology (sequential / fan-out / fan-in / hybrid); STOP if confidence < 90 %.
- Delegate [execute] — invoke each phase's owning skill in the chosen order; capture the returned artefact reference + sign-off state.
- Integrate [validate] — when fanning in, confirm every parallel branch returned a sign-off; halt on any unsigned branch.
- Health-check [validate] — sweep for context-collapse signals; recommend a fresh session if ≥ 2 are present.
Recovery & STOP
- No clear owning skill for a phase → STOP, ask which skill to add or extend.
- A downstream skill returns a hard failure → STOP, do NOT silently retry; escalate to that skill's owner.
- Fan-in fails because a parallel branch is unsigned → STOP, complete the missing branch before integrating.
- ≥ 2 context-collapse signals from
AGENTS.md→ STOP, recommend a fresh session. - Confidence < 90 % on phase decomposition or topology → STOP, ask.
Handoffs
- Predecessors / successors: see FM
handoffs(grammar from ADR-0080). - Dispatch targets: see FM
dispatch_targetsfor the full set of downstream skills the gateway may delegate to. - Source spec:
specs/lean/gateway/requirements.md— every G-rule traces to an AC there. - Related ADRs: ADR-0076, ADR-0080.
- Reference: see
references/lean-gateway-handbook.mdfor the full skill registry, context-collapse signal list, feedback-loop topology, fan-in/fan-out
Detailed reference
Full encyclopedic reference, decision trees, and lookup tables live in
references/lean-gateway-handbook.md .
See also
../../references/lean-gateway-handbook.md-- Completelean-gatewayHandbook../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.

