Skip to content
Back to skills

Gate Check

CSecurity

Route changed file paths to the verify commands this repo requires before shipping — docs changed means docs strict build, shell changed means bash -n, CLI changed means the encoding smoke test. Use before committing/opening a PR, when the user asks "what checks do I need to run", "run the gates", "gate check", or after substantive edits in a repo with a .claude/gate-router.local.md rules file. Deterministic local gates instead of session memory; also helps AUTHOR the rules file for a new repo.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 6, 2026
ai-agentsrustshellbashgit

Works with

  • cli

Security analysis

C73/100
  • criticalPipes output to a shell interpreter
  • highPerforms destructive filesystem operations

Pro scans all 2 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add fakoli/fakoli-plugins --skill gate-check --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gate Check?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gate Check
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/fakoli-gate-check/badge)](https://www.skillsdirectory.com/skills/fakoli-gate-check)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gate-check
description: Route changed file paths to the verify commands this repo requires before shipping — docs changed means docs strict build, shell changed means bash -n, CLI changed means the encoding smoke test. Use before committing/opening a PR, when the user asks "what checks do I need to run", "run the gates", "gate check", or after substantive edits in a repo with a .claude/gate-router.local.md rules file. Deterministic local gates instead of session memory; also helps AUTHOR the rules file for a new repo.
---

Resolve `PLUGIN_ROOT` from the host-provided `PLUGIN_ROOT` / `CLAUDE_PLUGIN_ROOT`, or from this loaded skill’s directory (`../..`). Use that absolute path for the bundled commands; do not assume the current directory is the install root.


# Gate Check

Deterministic changed-path → verify-command routing. The rules live in the
project, not in anyone's memory: `.claude/gate-router.local.md` (the
marketplace's plugin-settings pattern).

## Check the current diff

```bash
bash "${PLUGIN_ROOT}/scripts/gate-router.sh" --list       # what's required
bash "${PLUGIN_ROOT}/scripts/gate-router.sh" --run        # run them, stop on failure
bash "${PLUGIN_ROOT}/scripts/gate-router.sh" --list --json
```

- Default diff base is `origin/main` (fall back `HEAD`); override with
  `--base <ref>`. The changed set is committed-vs-base + staged + unstaged + untracked —
  the full "about to ship" surface.
- `--run` executes gates in rule order and stops at the first failure with
  its exit code — report that failure to the user verbatim, fix, re-run.
- No config → the script says so and exits 0 (nothing to enforce). Suggest
  authoring one (below) when the repo clearly has gate-worthy surfaces.

## Author or extend the rules file

`.claude/gate-router.local.md`, rules in the frontmatter, `glob => command`:

```markdown
---
rules:
  - docs/** => mkdocs build --strict
  - "**/*.sh" => for file in {files}; do test ! -f "$file" || bash -n "$file" || exit; done
  - bin/src/** => cd bin && uv run pytest -q
  - plugins/** => bash scripts/validate.sh
---
Notes for humans below the fence (ignored by the router).
```

- `**` crosses directories; a leading `**/` also matches paths at the root.
- `{files}` passes the matched files to the command as separate arguments
  (safe for spaces, Unicode, tabs, and newlines). Keep `{files}` standalone and unquoted; the router adds quoting. Use it for linters; omit it
  for suite commands that don't take a file list.
- Duplicate commands from overlapping rules run once. Order = rule order.
- Derive rules from the repo's own history: CI workflow steps, CLAUDE.md
  test instructions, and past incident classes (encoding, docs links) are
  the gate candidates. Keep each gate FAST — these run per-change, not
  nightly.

## Trust boundary

The rules file **executes shell commands** — treat `.claude/gate-router.local.md`
like a Makefile: only run `--run` in repos you trust, and review a rules file
you didn't write before running it. The script is injection-safe with respect
to *filenames* (matched files are passed as argv, never interpolated into the
shell, so a changed file named `x;rm -rf ~` is an inert argument), but the
COMMANDS themselves are run verbatim with your privileges.

`{files}` paths are repo-root-relative. Do **not** combine `{files}` with a
command that changes directory (e.g. `cd bin && lint {files}`) — the files
would resolve against the wrong directory. Either keep such gates directory-
stable, or let the command run from the repo root.

## Composition

- `ship-loop` step 4 ("test against reality"): run `--run` before the review
  gate.
- Works identically on Windows (Git Bash) and Linux; Codex runs the same
  script via this skill (no hooks involved).

Files in this skill

  • SKILL.md3.7 KB
  • agents/openai.yaml174 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.