← ClaudeAtlas

test-driven-developmentlisted

MUST USE for any behavior change: write failing tests before production code. No exceptions. Triggers on: "TDD", "write tests first", any implementation task, bug fix needing regression tests, behavior changes during execution. Routed by using-superpowers, or invoke directly via /test-driven-development.
brunob54/superpowers-orchestrator · ★ 3 · Testing & QA · score 76
Install: claude install-skill brunob54/superpowers-orchestrator
# Test-Driven Development Write failing tests first. Then write minimal code to pass. ## Iron Law **No production code before a failing test proves the behavior is missing.** If code was written first, **delete it** and restart from a test. No exceptions. This is the hardest rule to follow and the most important. Every rationalization to skip it leads to untested behavior that breaks later. ## Cycle 1. **RED**: Write one small failing test for one behavior. 2. **VERIFY RED**: Run the test. Confirm it fails **for the expected reason** (not a syntax error or import issue). 3. **GREEN**: Write the **minimum** production code to make the test pass. Nothing more. 4. **VERIFY GREEN**: Run the target test and relevant broader tests. Confirm pass. 5. **REFACTOR**: Improve structure without changing behavior. Tests must stay green. Repeat per behavior. Never skip VERIFY steps. ## Test Infrastructure Check Before writing the first test, verify the project has a test runner: 1. Check for test config: `jest.config.*`, `vitest.config.*`, `pytest.ini`, `pyproject.toml [tool.pytest]`, `go.mod`, `Cargo.toml`, `.rspec`, `phpunit.xml` 2. Check for test script: `npm test`, `yarn test`, `make test`, or equivalent 3. If no test infrastructure exists: - Ask the user: "No test runner detected. Should I set up [recommended runner for this language/framework]?" - If yes: install and configure the minimal test runner. Write one smoke test to confirm it works. - If no: note that TDD