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.
66
79%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./plugins/agentic-engineering/skills/tdd/SKILL.mdCore principle: tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
See tests.md for examples and mocking.md for mocking rules.
Do not write all tests first, then all implementation. Bulk-written tests verify imagined behavior — they test the shape of things (signatures, data) rather than user-facing behavior, and become insensitive to real changes.
Correct: vertical slices. One test → one implementation → repeat. Each test responds to what you learned from the previous cycle.
WRONG (horizontal): RED: t1,t2,t3,t4,t5 → GREEN: i1,i2,i3,i4,i5
RIGHT (vertical): RED→GREEN: t1→i1, t2→i2, t3→i3, ...Before writing code:
Ask: "What should the public interface look like? Which behaviors matter most?"
Write ONE test for ONE behavior. RED → minimal code → GREEN. Proves the path works end-to-end.
For each remaining behavior: RED (next test fails) → GREEN (minimal code passes).
Rules: one test at a time; only enough code to pass it; no anticipating future tests; tests stay on observable behavior.
After GREEN, look for refactor candidates:
Never refactor while RED. Get to GREEN first.
[ ] Test describes behavior, not implementation
[ ] Test uses public interface only
[ ] Test would survive an internal refactor
[ ] Code is minimal for this test
[ ] No speculative features addedbe88d6c
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.