Test-Driven Development loop. Write a failing test first, then the minimum code to pass it, then refactor. Repeat.
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Run ALL tests after each change. If anything breaks, undo immediately.
Stop refactoring when the code is clean enough. Don't gold-plate
Choosing What to Test Next
Work from simple to complex:
Degenerate cases. Null input, empty collection, zero
Happy path. The simplest valid input
Variations. Different valid inputs that exercise different branches
Edge cases. Boundary values, max sizes, special characters
Error cases. Invalid input, failures, exceptions
Integration. How this connects to the rest of the system
Each test should require a small code change. If you need to write more than ~10 lines of production code to pass a test, the test is too big. Split it.
Rules
Never write production code without a failing test that demands it.
Never write more than one failing test at a time. One red → green → refactor cycle at a time.
The test drives the design. If the code is hard to test, the design is wrong. Change the design, not the test approach.
Don't mock what you own. If you need to mock your own code to test it, the code needs restructuring.
Commit after each green+refactor cycle. Small, passing, meaningful commits.
Output
After each cycle, briefly state:
Test: what behavior was added
Code: what changed to make it pass
Refactor: what was cleaned up (or "none needed")
When the feature is complete, provide a summary of all behaviors covered and any gaps that would need integration or manual testing.