Fix a bug or add behaviour by writing a failing test first, then the smallest change that makes it pass. Use for any bug fix or new behaviour in code that has tests.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Test First?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/naidx0-test-first)
---
name: test-first
description: Fix a bug or add behaviour by writing a failing test first, then the smallest change that makes it pass. Use for any bug fix or new behaviour in code that has tests.
---
# Test first
1. Reproduce: write a test that fails for the reason the report gives. Run it and read the failure.
2. Make the smallest change that turns it green. Never change the test to fit the code.
3. Add a negative control where it helps: a case that must still be refused, or must still pass.
4. Run the whole suite and read its bare exit code, not a summary line.
5. Commit the test and the fix together, saying what was wrong and why the change fixes it.