test-driven-development
/test-driven-development
Use when adding or changing production behavior, fixing a bug, or refactoring, even if the user never mentions tests. Applies RED → GREEN → REFACTOR, with characterization coverage before behavior-preserving refactors. Not for documentation or comments.
- Author
- sitien173 ↗
- Repository
- refract ↗
- Licence
- MIT
- Last repository change
- 13.11.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 13.11.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 adding or changing production behavior, fixing a bug, or refactoring, even if the user never mentions tests. Applies RED → GREEN → REFACTOR, with characterization coverage before behavior-preserving refactors. Not for documentation or comments.
Original author description
Use when adding or changing production behavior, fixing a bug, or refactoring, even if the user never mentions tests. Applies RED → GREEN → REFACTOR, with characterization coverage before behavior-preserving refactors. Not for documentation or comments.
How it works
- Role
- Iron Law
- Cycle
- Edge Cases
- Rules
- Evidence Record
SKILL.md preview
--- name: test-driven-development description: "Use when adding or changing production behavior, fixing a bug, or refactoring, even if the user never mentions tests. Applies RED → GREEN → REFACTOR, with characterization coverage before behavior-preserving refactors. Not for documentation or comments." --- # Test-Driven Development ## Role This skill owns implementation test order. `systematic-debugging` owns bug cause; `verifying-before-completion` owns final evidence claims. ## Iron Law Change behavior only after a test fails for that behavior, and refactor only under passing characterization coverage. Without them, nothing shows the change did what it claims. ## Cycle 1. **RED.** Add one focused behavior test and run it. Quote the failure line. RED counts only when the failure names the intended missing behavior; an import error, typo, or missing fixture is not RED. 2. **GREEN.** Make the smallest production change that passes the focused test and the tests covering every module you touched. 3. **REFACTOR.** Improve structure only, running tests after each step. Stay green. 4. Repeat for the next behavior. For a bug, RED reproduces the diagnosed defect. For a behavior-preserving refactor, establish passing characterization tests first and keep them green. ## Edge Cases - **RED passes already.** Strengthen the test. If the behavior truly exists, report that and write no production code. - **No test harness.** Ask the user whether to add one or waive TDD for this change. - **Flaky RED.** Run it three times. A test that does not fail every time is not RED; stabilize it first. - **Hard boundary.** Network, clock, filesystem, or hardware: mock only that boundary and keep real behavior everywhere else. ## Rules - Production behavior you wrote before its test is discarded and redone test-first. Pre-existing code is characterized, not discarded. - Fix production code to meet the assertion. Change an assertion only when it contradicts the specification, and say so. - Exceptions require user approval: generated code, pure configuration, or a throwaway prototype. ## Evidence Record Record in the phase `notes.md` under Test evidence, or in the final report for direct work: ```text RED: <command> -> <failing test>: <failure line> GREEN: <command> -> <N> passed, 0 failed ``` Changed behavior without credible RED → GREEN evidence fails specification review unless the user waived TDD.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · sitien173/refract | 100 | 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 705be3b257e5 (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. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests. - 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. - 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. - 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. - 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. - 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.