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
- HaipingShi/coderailtheir own version, first seen Jul 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 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.
- adversarial-review-gateSkill
- launch-checkSkill
- proven-code-reviewSkill
- spec-trace-gateSkill
- verify-gateSkill
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
- Very specific: line 16
Use the first that works as <PY>.
- Very specific: line 18
Ask: this project only (.claude/settings.json) or every project (~/.claude/settings.json)?
- Distinctive: line 38
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: …
- Distinctive: line 40
Never edit the hook's state, disable hooks, or run a different command that "looks green".
≈ “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.
Files
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)
- Find Python 3.9+:
python3 --version, thenpython --version, thenpy -3 --version(Windows). Use the first that works as<PY>. <DIR>= the absolute path of this skill's folder (where this SKILL.md is).- Ask: this project only (
.claude/settings.json) or every project (~/.claude/settings.json)? - Merge
assets/hooks-settings.jsoninto that file, replacing<PY>and<DIR>. Merge, never overwrite: keep every existing setting and hook; append these three entries. - 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 with0 tests collecteddoes 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 lowermax_blocks) lives only in the user's~/.claude/proof-of-done.json, globally or underprojects. A repository's.proof-of-done.jsoncan only tighten it: a highermax_blocksand"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
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
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.

