agentleFS
AgriciDanielAgriciDaniel/gatekeeper/SKILL.md

gatekeeper

Skill18 starsChanged 50 days agoMITView on GitHub

Rule-driven decision gates for anything that needs a verdict before it proceeds: agent selection, routing, triage, approvals. Each gate is a YAML rulebook: deterministic hard rules decide what code can decide, Jev (TypeSafe System One) answers the semantic questions as typed Choice, Noul, or Score judgments, and confidence bands turn answers into allow, route, suggest, confirm, escalate, or block. Rosters come from installed Claude Code agents and skills or from a JSON index, with rollup by group. Runs as Claude Code hooks in shadow, advise, or enforce mode (ships in shadow). Use for "/gatekeeper", "gatekeeper", "which agent should handle this", "why was that blocked", "tune the gate", "bench the gate", "write a new gate", "add a rule", "is the gate healthy", or "gatekeeper doctor".

  • Reads credentials

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. Gldywn/gatekeeper★ 2same name
    2. lkc-studio/claude-skill-gatekeeper★ 1same name
    3. otarampinelli/gatekeeper★ 0same 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 repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Read the rulebook and gates/_schema.json first.

    line 50
  2. Very specific:

    Put anything a regex or comparison can decide in hard_rules.

    line 51
  3. Very specific:

    Run bin/gatekeeper lint <gate> and python3 -m pytest -q before reporting done.

    line 59
  4. Very specific:

    Never move model: or a band without a fresh bench on the new setting.

    line 100
  5. Very specific:

    Only a hand-reviewed bench can move a threshold.

    line 106

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Gatekeeper

Repo: this skill's folder (installed as a symlink at ~/.claude/skills/gatekeeper). CLI: python3 ~/.claude/skills/gatekeeper/bin/gatekeeper <command>, or bin/gatekeeper from the repo.

A gate name resolves to gates/local/<gate>.yaml (private, git-ignored) first, then gates/<gate>.yaml, then examples/<gate>/<gate>.yaml. A path to a YAML file works anywhere a gate name does, except log --gate, which takes the gate's gate: name.

event -> hard_rules (code) -> judgments (one Jev request) -> decide (first match) -> verdict + log

Commands

AskRun
What would the gate decide?bin/gatekeeper judge <gate> "<text>" [--project P] [--json]
Why did it decide that?bin/gatekeeper explain <gate> "<text>"
Which handlers can it pick?bin/gatekeeper roster <gate> [--all]
Is the rulebook sound?bin/gatekeeper lint <gate>
How good are the thresholds?bin/gatekeeper bench <gate> [--file F] (live; about $0.00006 per row on a 24-handler roster, $0.0004 at 143)
What happened recently?bin/gatekeeper log [--tail N]
Turn enforcement on or off`bin/gatekeeper mode <gate> shadowadviseenforceoff`
Is it still working?bin/gatekeeper doctor [gate] [--offline] [--json] [--days N] [--project P] (exit 1 on any FAIL)

judge, explain, and bench call Jev and need TYPESAFE_API_KEY. The client reads it from the environment, then the file named by GATEKEEPER_ENV_FILE, then ~/.config/gatekeeper/env. Never print it.

Editing a rulebook (gates/<gate>.yaml)

  1. Read the rulebook and gates/_schema.json first.
  2. Put anything a regex or comparison can decide in hard_rules. Put only the semantic part in judgments.
  3. One narrow question per judgment. A Choice needs an escape option when nothing may fit.
  4. Bands are per judgment and follow the cost of a wrong call. They stay untuned guesses until bench over reviewed labels says otherwise.
  5. Bump version whenever a rule, band, or option changes, so the log shows which rulebook made each decision.
  6. Run bin/gatekeeper lint <gate> and python3 -m pytest -q before reporting done.

New gate

Copy the shape of gates/agent-selection.yaml: state.fields names the event fields Jev sees, judgments holds the questions, and decide maps answers to verdicts. A new domain (for example email triage) needs a new YAML file plus whatever adapter turns its input into an event dict. The engine does not change.

Rosters from an index

A gate can route to Markdown procedures instead of Claude Code agents: set roster.sources: [index] and point roster.index.file at a JSON list (fields for name, description, group, and path are configurable). Add rollup: group to the Choice and the engine also sums probabilities by group, so a decide rule can use group_band: act when the exact handler is unclear but its group is not. See examples/marketing-team/. Such gates run in advise mode.

Enforcement (agent-selection)

The hooks are installed with scripts/install_hooks.py (--global or --project, dry run by default). shadow only logs what it would inject or deny. advise injects the verdict as context but never blocks or denies. enforce injects the route as context and denies Agent or Skill calls that break an act-band route or a forbid rule. GATEKEEPER=off disables every hook at once. The hooks fail open: a Jev outage never blocks work. A handler named in the prompt is never denied. Harness messages (passthrough) are never judged. See README "Safety rules".

Keep it working

The gate fails open, so a broken gate looks exactly like a quiet one. Run bin/gatekeeper doctor monthly, after installing or removing agents or skills, after a Claude Code update, and always before mode ... enforce. It checks the key, that the pinned model still answers, what jev-latest now serves, hook installs, the fail-open rate in the log, harness messages that slipped past passthrough, handlers no rule covers, and whether the bench is stale.

  • FAIL: fix before anything else. The gate is not judging.
  • WARN: fix soon. Each line carries its own fix:.
  • INFO: a choice for the user (for example a newer Jev version to bench).
  • Never move model: or a band without a fresh bench on the new setting.

Rules

  • Gatekeeper decides who handles work. It never sends, publishes, or spends.
  • Typed output guarantees the shape, not the truth. Tune on labelled data.
  • Only a hand-reviewed bench can move a threshold. Draft labels (label_source: claude-draft) are a starting point.
  • Re-check the Jev model, limits, and price against GET https://api.typesafe.ai/v1/models and docs.typesafe.ai before relying on them.

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.