test-first
Skill2 starsChanged 4 months agoMITView on GitHub
Drive changes with a failing test before writing implementation. Use when adding a feature or fixing a bug in a codebase that has tests.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- 9Ashwin/let-it-gotheir own version, first seen Sep 28, 2026
- llopresto87/Cypresstheir own version, first seen Sep 22, 2026
- atgreen/hackinatortheir own version, first seen Aug 24, 2026
- duthaho/claudekittheir own version, first seen Jul 22, 2026
- TIANTIAN-ZHAN/claude-harnesstheir own version, first seen Jul 15, 2026
- ccpowerpack/claude-code-skillstheir own version, first seen Jul 3, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- NoobyGains/godmode★ 107same name
- duthaho/claudekit★ 97same name
- llopresto87/Cypress★ 95same name
- claude-world/director-mode-lite★ 80same name
- s-hiraoku/synapse-a2a★ 16same name
- TIANTIAN-ZHAN/claude-harness★ 3same name
- atgreen/hackinator★ 1same name
- goblindegook/skills★ 1same name
- orkait/hyperstack★ 1same name
- 9Ashwin/let-it-go★ 0same name
1 more not listed
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.
- commit-surgeonSkill
- debug-scientificallySkill
- no-slopSkill
- pr-describerSkill
- security-sweepSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Write the test before the code.
- Distinctive: line 13
Red: Write the smallest test that captures the desired behavior and watch it fail for the right reason.
- Distinctive: line 16
Green: Write the least code that makes the test pass.
- Distinctive: line 27
Deterministic: No real network, no wall-clock sleeps, no shared mutable state between tests.
- Distinctive: line 38
Run the full suite, not just your new test.
“Common” is measured: kept by at least 6 in 10 of the 10 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 First
Write the test before the code. Not for dogma, but because a failing test proves you understand the requirement and gives you a definition of done you cannot fool.
The rhythm
- Red. Write the smallest test that captures the desired behavior and watch it fail for the right reason. A test that passes before you write code is testing nothing.
- Green. Write the least code that makes the test pass. Resist gold-plating.
- Refactor. Clean up now that the test protects you. Run the suite again.
What makes a good test
- Tests behavior, not implementation. Assert on outputs and observable effects, not private internals, so refactors do not break it needlessly.
- One reason to fail. Each test pins one behavior. When it breaks, the name alone tells you what regressed.
- Descriptive names.
returns_401_when_token_expiredbeatstest_auth_2. - Arrange, act, assert, with the interesting value obvious at a glance.
- Deterministic. No real network, no wall-clock sleeps, no shared mutable state between tests. Fake the clock and the network.
For bug fixes specifically
Reproduce the bug as a failing test first. When it goes green, you have both the fix and a permanent guard against the bug returning. A bug fix without a regression test is half a fix.
Before finishing
- Run the full suite, not just your new test.
- Confirm your new test actually fails when you break the code (sabotage it once to be sure it has teeth, then restore).
- Match the project's existing test framework, folder layout, and naming.
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.

