Back to catalog / Agent setup
Test-driven development: use Red-Green-Refactor
Write a failing behavior test first, then implement minimally and refactor.
Skills
For features, fixes, refactors, and behavior changes, start with one focused test that describes observable behavior. Run it and confirm it fails for the intended reason; correct a test that fails for an unrelated reason. Implement only enough code to pass, run the relevant suite, then refactor while keeping tests green. Prefer tests of real behavior over assertions that only verify mock call counts. The source allows discussion of exceptions for throwaway prototypes, generated code, or configuration, but “being in a hurry” is not a reason to skip verification.
Permissions
Prerequisites
- Before implementing a feature, fix, refactor, or behavior change.
Permissions
- Requires creating and running tests, which executes project test code.
Limitations
Test frameworks and repository conventions vary; the source says exceptions should be discussed with the user.
Pinned upstream source
- Repository
- obra/superpowers
- File path
- skills/test-driven-development/SKILL.md
- Pinned commit
bb92a77741419a4ab5f06e711a283343f1ada0c3- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: MIT
Compatible tools
Superpowers skill collection · Project test runner · Git repository tools
Main topic
Take a coding Agent change from context to verification