agentleFS
Ces107Ces107/agent-forge/skills/done-gate/SKILL.md

done-gate

Skill0 starsChanged 5 months agoMITView on GitHub

Free Claude Code hook that stops a coding agent from saying "done", "fixed" or "all tests pass" without proof. After a code edit, the agent cannot end its turn until a real test command has run and passed after its last change; piped, masked or failing runs do not count. Use when you want Claude Code to prove its work before it reports success, or when an agent keeps claiming tests pass without running them.

  • Deletes or force-pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. HaipingShi/coderail★ 8same 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 repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the first that works as <PY>.

    line 16
  2. Very specific:

    Ask: this project only (.claude/settings.json) or every project (~/.claude/settings.json)?

    line 18
  3. Distinctive:

    Do what the message says: run the real test command, read the result, fix the code (never the tests), re-run, then report with evidence: …

    line 38
  4. Distinctive:

    Never edit the hook's state, disable hooks, or run a different command that "looks green".

    line 40

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

Done Gate (free)

Your agent says "done, all tests pass". Done Gate checks the commands that actually ran, not the agent's words. No passing test run after the last edit means no "done": the agent is told exactly what to run, runs it, fixes what fails, and only then finishes.

Install (Claude Code; ask the user first)

  1. Find Python 3.9+: python3 --version, then python --version, then py -3 --version (Windows). Use the first that works as <PY>.
  2. <DIR> = the absolute path of this skill's folder (where this SKILL.md is).
  3. Ask: this project only (.claude/settings.json) or every project (~/.claude/settings.json)?
  4. Merge assets/hooks-settings.json into that file, replacing <PY> and <DIR>. Merge, never overwrite: keep every existing setting and hook; append these three entries.
  5. Tell the user it is active from the next turn, and how to switch it off (remove the entries or /hooks).

What it checks (scripts/done_gate.py)

  • PostToolUse records code edits and test runs (pytest, npm/yarn/pnpm test, jest, vitest, go test, cargo test, mvn, gradle, dotnet test, rspec, phpunit, make test and more).
  • Stop blocks the end of the turn when code changed and no passing test run happened after the last edit. A run piped into tail/grep, masked with || true, or with 0 tests collected does not count.
  • It never traps you: after two reminders it lets the turn end with a visible warning, so projects without tests keep working. Sessions without code edits are never blocked.
  • Local and private: standard-library Python, a tiny state file per session, no network, no telemetry.
  • Config that relaxes the gate (test_commands, ignore_paths, allow, a lower max_blocks) lives only in the user's ~/.claude/proof-of-done.json, globally or under projects. A repository's .proof-of-done.json can only tighten it: a higher max_blocks and "integrity": true.

When the hook blocks you (agent instructions)

Do what the message says: run the real test command, read the result, fix the code (never the tests), re-run, then report with evidence: the command, its exit code and the summary line. Never edit the hook's state, disable hooks, or run a different command that "looks green".

Want more?

The paid Proof-of-Done adds a test-integrity guard (blocks deleted, skipped or weakened tests, lowered coverage thresholds and softened CI); drop its test_integrity.py next to done_gate.py and it switches on. The Claude Code Guardrails kit adds Safety Guard (blocks recursive deletes, git reset --hard, force pushes when they would destroy work) and Fake Package Blocker. Both on Agensi: https://www.agensi.io/creators/cesar-pereiro

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.