testing-first
Skill0 starsChanged 45 days agoMITView on GitHub
Use when about to implement or change behavior in code that has, or should have, automated tests, including bug fixes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- bygama/skillstheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- bygama/skills★ 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 repository13 other files it gives its agents.
- debugging-systematicallySkill
- delegating-to-subagentsSkill
- executing-plansSkill
- finishing-workSkill
- investigating-in-parallelSkill
- isolating-workspacesSkill
- planning-workSkill
- receiving-reviewSkill
- requesting-reviewSkill
- shaping-designsSkill
- using-tackleSkill
- verifying-before-claimingSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
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 13
Code without a test harness: add a harness if it's cheap and the user agrees.
- Distinctive: line 20
Green: Write the simplest code that passes.
- Distinctive: line 31
Don't delete working code.
- Distinctive: line 40
Every new behavior has a test you saw fail for the expected reason and then pass, and the relevant suite is 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
Testing First
A test you have watched fail is proof it checks something real. A test written after the code and passing on its first run proves much less: it may test the wrong thing, or nothing. Writing the test first also makes you decide what the code should do before deciding how.
Scale it
- Behavior changes and bug fixes in tested code: red → green → refactor, below.
- Code without a test harness: add a harness if it's cheap and the user agrees. Otherwise use the best available evidence (a script, a manual run with captured output) and say that's what you did.
- Config, generated code, layout/styling, throwaway spikes: tests are optional. Verify another way.
How
- Red. Write one small test for the next behavior, named for that behavior. Edge cases and error paths each get a test of their own. Use real code; mock only at boundaries you can't control (network, clock, third-party services). Assert on what the code does, not on what the mock received, and don't add methods to production code just for tests.
- Watch it fail, and for the right reason. "Function not defined" or "expected X, got Y" is right; a typo or import error is not. If it passes straight away, it isn't testing the new behavior, so change the test.
- Green. Write the simplest code that passes. Don't add options or features the test doesn't ask for.
- Run the relevant suite. New and existing tests pass, with no new warnings.
- Refactor with the tests green: tidy names, remove duplication. Behavior stays the same.
- Repeat for the next behavior.
For bug fixes, the first test reproduces the bug. That test is the regression guard.
A test that's hard to write is feedback on the design. Heavy setup or mocks everywhere usually mean the code is too coupled, so simplify the interface or pass dependencies in.
Wrote the code first?
Don't delete working code. Write the test now, then prove it can fail: temporarily revert or break the code under test, confirm the test fails, and restore it. If it doesn't fail, the test is too weak; strengthen it.
Skip or shorten when
- The user says not to test or to test later. Mention the risk once, then follow their call.
- You're spiking to learn something. Throw the spike away or backfill tests before relying on it.
Done means
Every new behavior has a test you saw fail for the expected reason and then pass, and the relevant suite is green.
Next
verifying-before-claimingdebugging-systematicallyif a test fails in a way you don't understand
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.

