Loading...
Loading...
Test-Driven Development methodology enforcing RED-GREEN-REFACTOR cycle. Use for writing tests first, preventing regression, and ensuring code correctness. Based on obra/superpowers.
npx skill4agent add vamseeachanta/workspace-hub tdd-obra| Approach | Validates |
|---|---|
| Tests-first | "What should this do?" |
| Tests-after | "What did I build?" |
1. Write failing test reproducing the bug
2. Verify test fails for expected reason
3. Implement minimal fix
4. Verify all tests pass
5. Refactor if needed
6. Commit with test and fix together| Error | Cause | Solution |
|---|---|---|
| Test passes immediately | Wrote code first | Delete code, start over with test |
| Test errors instead of fails | Syntax or setup issue | Fix test setup, not production code |
| Tests pass but feature broken | Testing wrong thing | Review test assertions |
| Flaky tests | Async or state issues | Fix test isolation |
| Metric | Target | Description |
|---|---|---|
| Test-First Rate | 100% | Tests written before code |
| RED Verification | 100% | All tests watched failing |
| Coverage | >80% | Line coverage baseline |
| Critical Path Coverage | 100% | Auth, payments, security |
| Test Independence | 100% | No test order dependencies |