agentsclimarketplace

Lean gateway

Skill r-irbe/proof-skills/skills/lean-gateway

USE FOR: routing the top-level entry-point for a complex Lean 4 task; selecting which downstream skill(s) own each phase; preventing context collapse across long sessions; maintaining feedback / feedforward loops; fan-in / fan-out coordination; system-wide health monitoring. DO NOT USE FOR: doing any actual work (always delegate to a domain skill); single-file editing (use @lean-proof or @lean-doc-improvement); script-level enforcement (use @lean-enforcement). TRIGGERS: gateway, orchestrate, route, dispatch, top-level, context collapse, fan-out, fan-in, ecosystem health.From its SKILL.md

Install
npx -y skills add r-irbe/proof-skills --skill lean-gateway

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.8 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

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 REFERENCE.md Part 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).
  • TRIGGERS: gateway, orchestrate, route, dispatch, top-level, context collapse, fan-out, fan-in, ecosystem health.

Behavioural rules (G-*)

  • G-1 (MUST NOT): The gateway MUST NOT execute substantive proof, doc, or research work itself; every such operation MUST be a delegation. [Trace: AC-01]
  • G-2 (MUST): Each phase MUST be routed to exactly one owning skill from the registry; if no clear owner exists, the gateway MUST escalate per §Recovery & STOP. [Trace: AC-02]
  • G-3 (MUST): Fan-out topology (parallel skills) MUST converge through a documented fan-in (a single skill that integrates the results). [Trace: AC-03]
  • G-4 (SHOULD): The gateway SHOULD prefer the most specific skill in the registry over a broader one (e.g. @lean-blueprint over @lean-doc-improvement for blueprint work). [Trace: AC-04]
  • G-5 (MUST): On any of the documented context-collapse signals (≥ 2 from AGENT.md), the gateway MUST recommend a fresh session before continuing. [Trace: AC-05]
  • G-6 (MUST): The gateway MUST maintain the per-task tracker (phase status, owner, predecessors, successors, sign-offs); a missing tracker entry = a missing delegation. [Trace: AC-06]
  • G-7 (SHOULD NOT): The gateway SHOULD NOT silently retry a failed downstream delegation; it MUST escalate per §Recovery & STOP. [Trace: AC-07]
  • G-8 (MUST): On any guard failure the skill MUST escalate per §Recovery & STOP. [Trace: AC-08]

Workflow

  1. Discover [discover] — receive the task, locate prior tracker for this scope (if any), enumerate the candidate skills from the registry.
  2. 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 %.
  3. Delegate [execute] — invoke each phase's owning skill in the chosen order; capture the returned artefact reference + sign-off state.
  4. Integrate [validate] — when fanning in, confirm every parallel branch returned a sign-off; halt on any unsigned branch.
  5. Health-check [validate] — sweep for context-collapse signals; recommend a fresh session if ≥ 2 are present.
  6. Persist [persist] (MANDATORY) — update the per-task tracker (phase status, owner, artefact links, sign-offs); update the ecosystem-health dashboard; tick the global tasks list. Skipping Persist = incomplete.

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 AGENT.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_targets for 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 REFERENCE.md for the full skill registry, context-collapse signal list, feedback-loop topology, fan-in/fan-out patterns, health dashboard schema, hierarchy management, enforcement-script orchestration, and ecosystem topology diagram (original v1 content, preserved verbatim).

Common failure modes

AI agents commonly: do the work themselves "to save a delegation"; pick a broad skill when a specific one exists; retry a failed delegation instead of escalating; ignore context-collapse signals; skip the per-task tracker update. Full registry: GUARDRAILS.md §Agent failure taxonomy.

What ships with it: 1 file

32.9 KB alongside SKILL.md

Gives 0 of the 12 instructions most operations skills give in ~1.1k tokens

Counted across 483 of the 484 authors here whose files we hold, read 2026-08-07

  • Collect monitoring data throughout the simulationin 14 of 483, across 6 files
  • Set the random seed for reproducibilityin 14 of 483, across 6 files
  • Validate simulations against analytical solutionsin 12 of 483, across 4 files
  • Clarify goals, constraints, and inputsin 11 of 483, across 2 files
  • Implement contract tests for integration pointsin 11 of 483, across 2 files
  • Implement strangler fig infrastructure with API gatewayin 11 of 483, across 2 files
  • Audit modernized components for security vulnerabilitiesin 11 of 483, across 2 files
  • Avoid Python blocking calls in processesin 10 of 483, across 3 files
  • Use resource context managers for automatic cleanupin 9 of 483, across 2 files
  • Maintain consistent time unitsin 9 of 483, across 2 files
  • Validate outcomes against success criteriain 8 of 483, across 1 file
  • Analyze the legacy codebase for technical debtin 8 of 483, across 1 file

Said here and by no other author read

  • stop if confidence is low
  • delegate every operation to a skill
  • route each phase to exactly one owning skill
  • prefer the most specific skill available
  • route parallel work through a documented fan-in
  • recommend a fresh session on context collapse

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.