datit309/supergraph / plugins/supergraph/skills/tdd
tdd
VerifiedStrict test-driven development for behavior changes. Requires verified RED before production code, minimal GREEN, and refactor only after passing tests.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.8 KB |
| writing-good-tests.md | markdown | 1.4 KB |
writing-good-tests.md
View on GitHub# Writing Good Tests
Use this guide when designing the RED test. The test should be able to fail for the behavior it claims to protect, not merely prove that a line, mock, or fixture exists.
## Falsifiability checklist
- Name the behavior that must break if the implementation regresses.
- Use independent expected values. Do not calculate the expected answer with the same helper or algorithm as production code.
- Prefer behavior over implementation text: assert observable output, state, files, exit status, or protocol payloads when feasible.
- Choose the mock level deliberately. Mock only an external, slow, flaky, or nondeterministic boundary; keep the behavior under test real.
- Apply a mutation check: temporarily remove or alter the relevant production behavior and confirm the test turns RED.
## Strong fixture shape
Keep fixtures small and name the reason each input exists. Include at least one input that distinguishes the intended behavior from a plausible but wrong implementation. For shell workflows, assert both stdout/artifacts and failure behavior for invalid input.
## Review questions
1. What exact break does this test detect?
2. Could a hard-coded or change-detector implementation pass it?
3. Are expected values independent from production logic?
4. Does the mock hide the integration boundary that matters?
5. Which one-line mutation should make the test fail?
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |