test-gate
Skill2 starsChanged 45 days agoMITView on GitHub
Checks that a test fails on some plausible wrong code, such as a guard that always allows or always refuses, an empty result, an identity transform or a missing lock, and gates each new test on four answers: behaviour, regression, owner and seam. 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 that may not 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) or deriving a property the output must satisfy (use prove-invariant).
7 other projects use a version of this.
Adopted by
Most recently taken up by
- stigmer/stigmertheir own version, first seen Nov 8, 2026
- Alex5350/arsenaltheir own version, first seen Nov 1, 2026
- Jaxsbr/sabstheir own version, first seen Oct 20, 2026
- Giamme/kent-testtheir own version, first seen Oct 15, 2026
- BrentRector/claude-skillstheir own version, first seen Oct 3, 2026
- gabrieldabbah/genesistheir own version, first seen Jul 28, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- stigmer/stigmer★ 9same name
- BrentRector/claude-skills★ 6same name
- gabrieldabbah/genesis★ 4same name
- Docat0209/SoloForge★ 1same name
- Giamme/kent-test★ 1same name
- Alex5350/arsenal★ 0same name
- Jaxsbr/sabs★ 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 repository22 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
- scientific-posterSkill
- 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, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
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.
- Distinctive: line 63
Run each wrong version in the copy.
“Common” is measured: kept by at least 6 in 10 of the 7 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 procedure
- Copy the tree to a fresh directory of your own (
mktemp -d); a shared scratch directory can hold another run's files. Check that the copy's tests import the copy, not an editable install of the real tree (print<pkg>.__file__). Leave the real tree as you found it. - For each test and fixture, pick the wrong versions from the table, in both directions.
- Run each wrong version in the copy. A test that still passes on one is not done: fix it and return to this step. "Would fail" counts only after you have seen it fail.
- Report one line per test and fixture: 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.
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.

