test-driven-development
/test-driven-development
Use when implementing any feature or bugfix before implementation changes. Enforces test-first behavior: write a failing test, verify failure, implement minimal code, and prove green.
- Author
- ajbmachon ↗
- Repository
- ajbm-skills ↗
- Licence
- MIT
- Last repository change
- 13.05.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.05.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 before implementation changes. Enforces test-first behavior: write a failing test, verify failure, implement minimal code, and prove green.
Original author description
Use when implementing any feature or bugfix before implementation changes. Enforces test-first behavior: write a failing test, verify failure, implement minimal code, and prove green.
How it works
- Purpose
- Execution Posture
- When To Use
- Iron Law
- If Code Exists Before RED
- Red-Green-Refactor Loop
- Test Quality Bar
- Anti-Patterns
- Reporting Contract (Required)
- Completion Gate
SKILL.md preview
--- name: test-driven-development description: "Use when implementing any feature or bugfix before implementation changes. Enforces test-first behavior: write a failing test, verify failure, implement minimal code, and prove green." --- # Test-Driven Development (TDD) ## Purpose Use TDD to prove behavior changes, prevent regressions, and keep implementation scope tight. Core principle: ```text If you did not observe a meaningful failing test first, you do not yet have proof the test validates the change. ``` ## Execution Posture **Execute the TDD cycle. Run tests. Report evidence. Don't stop at advice.** ## When To Use Default for: - new features - bug fixes - behavior changes - refactors that may change behavior Allowed exceptions (confirm with human partner): - throwaway prototypes - generated code - pure configuration/docs changes - urgent incident mitigation where test-first is temporarily impossible If exception is used, document why and schedule follow-up tests. ## Iron Law ```text No behavior-changing production code is complete without a failing test that was observed before the final implementation. ``` ## If Code Exists Before RED If you write behavior-changing implementation code before a failing test: 1. Delete that implementation code. 2. Do not keep it as reference while writing tests. 3. Start from RED with a failing test first. 4. Re-implement minimally to GREEN from the test signal. Exception only with explicit human partner approval. ## Red-Green-Refactor Loop ### RED: Write One Failing Test - One behavior per test. - Test name states observable outcome. - Prefer real domain behavior; mock only boundaries. ### Verify RED (Mandatory) Run targeted test command and confirm: - test fails (not setup error) - failure reason matches missing behavior If it passes immediately, the test is not proving the new requirement yet. ### GREEN: Minimal Implementation - Write the smallest change that satisfies failing test. - Avoid unrelated refactors and feature expansion. ### Verify GREEN (Mandatory) Run targeted tests, then broader scope when feasible. Confirm: - new test passes - nearby tests still pass - no new failures introduced ### REFACTOR After green: - remove duplication - improve naming/structure - keep behavior unchanged Re-run tests to prove refactor preserved behavior. ## Test Quality Bar Each non-trivial change should include: - happy path - failure path - at least one boundary/edge case For bug fixes: - mandatory regression test that would have caught the bug ## Anti-Patterns - writing implementation before defining failing test - accepting a test that passes immediately without validating requirement gap - broad refactor during GREEN - mock-heavy tests that only assert call counts - claiming completion without execution evidence ## Reporting Contract (Required) ```text TDD Summary - Requirement under test: - <behavior> - RED evidence: - Command: <command> - Failure observed: <yes/no + key message> - GREEN evidence: - Command: <command> - Result: <passed/failed> - Broader verification: - <suite command + result> OR "Deferred: <reason>" - Notes: - <exceptions, constraints, or follow-up tests> ``` Required phrases: - If tests were not run: `I did not run tests.` - If only partial scope ran: `I ran targeted tests only.` ## Completion Gate Before marking done: - failing test observed for changed behavior - minimal implementation landed - targeted tests green - broader verification done or explicitly deferred with reason - summary includes concrete commands and outcomes ## Bottom Line TDD is an evidence discipline, not a slogan.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · ajbmachon/ajbm-skills | 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 3427379f17f5 (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
- 95community-test-driven-development
Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle with test-first approach. - 96ferrox-test-driven-development
Use when implementing any feature or bugfix, before writing implementation code - 100tdd
Enforces test-driven development: write failing test, write minimal code to pass, refactor. Mandatory for all implementation work. Use when writing any production code, implementing features, fixing bugs, refactoring, or when the user says "write code", "implement", "fix this",… - 96sr-test-driven-development
Use when implementing any feature or bugfix, before writing implementation code - 100tdd
Enforces strict RED-GREEN-REFACTOR test-driven development — one failing test at a time, minimal code to pass, then refactor against an inline quality checklist and a test-provenance check (`provenance` runs it alone). Triggers on "tdd", "write tests", "test driven", "red green refactor", "/tdd". - 86testing
Use when implementing any feature or bugfix, before writing implementation code