agentleFS
r-irber-irbe/proof-skills/skills/lean-gateway/SKILL.md

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.

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
  1. Distinctive:

    No clear owning skill for a phase → STOP, ask which skill to add or extend.

    line 64

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.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).

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.

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_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 references/lean-gateway-handbook.md for 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 -- Complete lean-gateway Handbook
  • ../lean-gateway/SKILL.md -- Top-level skill router

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.