test-driven-development
/test-driven-development
Use when implementing any feature or bugfix in code — guides the strict RED-GREEN-REFACTOR cycle: write one failing test, confirm it fails for the right reason, write the minimal code to pass, refactor while the context is fresh.
- Author
- infews ↗
- Repository
- pxp_skill ↗
- Licence
- MIT
- Last repository change
- 27.06.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 27.06.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when implementing any feature or bugfix in code — guides the strict RED-GREEN-REFACTOR cycle: write one failing test, confirm it fails for the right reason, write the minimal code to pass, refactor while the context is fresh.
Original author description
Use when implementing any feature or bugfix in code — guides the strict RED-GREEN-REFACTOR cycle: write one failing test, confirm it fails for the right reason, write the minimal code to pass, refactor while the context is fresh.
How it works
- The Iron Law
- The Cycle
- Common Rationalizations
- Red Flags — STOP
SKILL.md preview
--- name: test-driven-development description: "Use when implementing any feature or bugfix in code — guides the strict RED-GREEN-REFACTOR cycle: write one failing test, confirm it fails for the right reason, write the minimal code to pass, refactor while the context is fresh." --- # Test-Driven Development A disciplined cycle for writing code one behavior at a time: red (failing test) → green (minimal code) → refactor. ## The Iron Law **No production code without a failing test first.** Not even one line. Not even "I'll just sketch this out." Not even "the test is obvious — I'll add it after." ## The Cycle ### 1. Write the failing test Write a single test for one behavior. The test should: - Describe *what* you want, not *how* it's done. - Fail in a meaningful way (assertion error — not syntax error, not missing import). - Be small — favor one method's behavior over a whole class. ### 2. Confirm red Run the test. Confirm it fails for the expected reason. - Unexpected failure reason: diagnose first; don't paper over with implementation. - Passes without any implementation: the behavior already exists, or the test isn't testing what you think. Investigate. ### 3. Write the minimal implementation Write the simplest code that makes the test pass. Resist the urge to add more. - No "while I'm here" additions. - No defensive code for cases not yet tested. - No abstractions for hypothetical future tests. ### 4. Confirm green Run the test. Confirm it passes. Run the full suite to check for regressions. ### 5. Refactor Look at the code you just wrote and the code around it: - Is there duplication to extract? - Are names clear and intention-revealing? - Is the code as simple as it can be while remaining clear? - Any code smells? If you see an improvement, make it. Re-run tests. If nothing needs refactoring, say so out loud and move on. ## Common Rationalizations | Excuse | Reality | |---|---| | "Test is trivial, I'll skip it" | Trivial tests catch real regressions later. Write it. | | "I already manually tested it" | Manual tests don't run in CI. Write the automated test. | | "I'll write the test after" | Tests-after asks "what does this do?" Tests-first asks "what should this do?" Different exercises. | | "Refactor isn't needed here" | Say so explicitly. Don't silently skip Step 5. | | "I'll batch the refactor at the end" | Refactor with context fresh, not after you've moved on. | ## Red Flags — STOP - Code before test. - "I'll just sketch this out and add the test later." - Test added after the code already passed manually. - Implementing more than one behavior per cycle. - Skipping Step 5 without saying so. All of these mean: stop, delete the unprotected code, start the cycle properly.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · infews/pxp_skill | 90 | MIT |
| GanyuanRan/Aegis | 100 | MIT |
| lucasouzadev/agent-kit-skill | 100 | MIT |
| zeative/satgas | 100 | AGPL-3.0 |
| nikospavlopoulos/devops-mutant-powers | 100 | MIT |
| JohnStrunk/CommonCast | 100 | LGPL |
| Sanit-mann/The-Insectoids | 100 | MIT |
| mastro993/fstack | 100 | MIT |
| jelvodev/yaap | 100 | MIT |
Database snapshot: 13.11.2026 · package version 7ae84fc5c67d (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development. - 100tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development. - 100tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development. - 100tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development. - 95argentos-test-driven-development
Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle with test-first approach. - 100tdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.