test-gate
Skill1 starsChanged 2 months agoMITView on GitHub
Use when writing, changing or reviewing tests: a regression test for a fix, a PR or diff that adds tests, a coverage push, or a green suite you are not sure would catch a bug. Triggers on 'add a test for', 'review these tests', 'is this test enough', fail-closed guards and health checks, locks and concurrency tests, checks that loop over outputs, and mocks or fixtures that already hold the answer. Not for changing an existing expected value (use change-asserted-value).
3 other projects use a version of this.
Adopted by
Most recently taken up by
- BrentRector/claude-skillstheir own version, first seen Oct 3, 2026
- gabrieldabbah/genesistheir own version, first seen Jul 28, 2026
- Docat0209/SoloForgetheir own version, first seen Apr 4, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- BrentRector/claude-skills★ 4same name
- gabrieldabbah/genesis★ 4same name
- Docat0209/SoloForge★ 1same 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 repository21 other files it gives its agents.
- bounded-goalsSkill
- change-asserted-valueSkill
- check-targetSkill
- cluster-failuresSkill
- councilSkill
- enumerate-firstSkill
- eval-loopSkill
- fable-reviewSkill
- gauntlet-loopSkill
- handoffSkill
- kickoffSkill
- promo-videoSkill
- prove-invariantSkill
- refusal-censusSkill
- reuse-before-rerunSkill
- run-evalSkill
- run-gateSkill
- spy-siteSkill
- understand-before-mergeSkill
- verify-sourceSkill
- watching-background-jobsSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
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
- Distinctive: line 23
Seam: if it needs an export, flag or hook that no production caller uses, test through the real entry point instead and drop the seam.
- Very specific: line 49
No assertion, or try/except: pass where pytest.raises belongs.
- Very specific: line 65
Run the wrong versions on a fresh copy of your own (mktemp -d), because a shared scratch directory can hold another run's files.
“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.
Files
test-gate
The rule
A test earns its place only if some wrong code makes it fail. For every test you write or review, name the cheapest wrong code that a real bug could produce, and check that the test fails on it. If a plausible wrong version still passes, the test is not done.
Gate for a new test
Answer all four before adding it. A blank answer means do not add it yet.
- Behaviour: the observable behaviour or contract it protects.
- Regression: the credible bug that makes it fail. For a bug fix, run the test on the pre-fix code and watch it fail for that reason.
- Owner: why existing tests miss that bug. One contract has one primary test at the strongest boundary; extend a parametrised case before adding a near-duplicate.
- Seam: if it needs an export, flag or hook that no production caller uses, test through the real entry point instead and drop the seam.
Wrong code to try
Try each row that applies, in both directions.
| Code under test | Wrong versions the test must fail on |
| Guard, validator, permission or health check | always refuses, and always allows |
| Returns a collection | returns empty, returns everything |
| Cache, dedupe, run-once | ignores the cache, runs every time |
| Lock or other concurrency control | no lock, with callers that really overlap (a Barrier and a slow body) |
| Transform or formatter | identity, a constant |
| Error path | nothing raised |
| TTL or timeout | a margin smaller than the clock's resolution |
A guard is two contracts. "Refuses when unhealthy" also passes on a guard that refuses everything, which is a total outage. A fail-closed check needs a test that the healthy path still gets through. That test is required, not optional.
A check that loops over outputs passes on no output. "Every span is valid" holds for an empty list. Add inputs that must produce output, with exact expected values.
Signs a test cannot fail
- No assertion, or
try/except: passwherepytest.raisesbelongs. - The expected value comes from the code under test, or is imported from it.
- A mock or fixture already supplies the asserted answer: a backend mock that returns the cached value, or an autouse fixture that pre-seeds state.
- A "concurrent" test whose callers never overlap.
- A name that promises more than its input exercises.
- A helper that exists only for the test.
Review output
One line per test and fixture, in three parts:
- The verdict: keep, change or drop.
- The wrong versions you ran, and whether the test failed on each.
- The fix, for anything that is not a keep.
Run the wrong versions on a fresh copy of your own (mktemp -d), because a shared scratch
directory can hold another run's files. Leave the real tree as you found it. A claim that
the test "would fail" counts only after you have seen it fail.
Related: prove-invariant for deriving a property the output must satisfy.
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.

