Agent skill · software engineering · aaaaqwq
Test-Driven Development (TDD)
Write the test first, watch it fail, write minimal code to pass
Why this skill is useful
Codifies a specific TDD process that the AI could infer but now doesn't have to guess.
What it needs
About 6k tokens when loaded. Last updated 2026-08-06. 83 stars on the source repository.
What this skill does
Test-Driven Development (TDD) Overview Write the test first. Watch it fail. Write minimal code to pass. Core principle: If you didn't watch the test fail, you don't know if it tests the right thing. Violating the letter of the rules is violating the spirit of the rules. When to Use Always: New features Bug fixes Refactoring Behavior changes Exceptions (ask your human partner): Throwaway prototypes Generated code Configuration files Thinking "skip TDD just this once"? Stop. That's rationalization. The Iron Law Write code before the test? Delete it. Start over. No exceptions: Don't keep it as "reference" Don't "adapt" it while writing tests Don't look at it Delete means delete Implement fresh from tests. Period. Red-Green-Refactor RED - Write Failing Test Write one minimal test showing what should happen. <Good> Clear name, tests real behavior, one thing </Good> <Bad> Vague name, tests mock not code </Bad> Requirements: One behavior Clear name Real code (no mocks unless unavoidable) Verify RED - Watch It Fail MANDATORY. Never skip. Confirm: Test fails (not errors) Failure message is expected Fails because feature missing (not typos) Test passes? You're testing existing behavior. Fix test. Test errors? Fix error, re-run until it fails correctly. GREEN - Minimal Code Write simplest code to pass the test. <Good> Just enough to pass </Good> <Bad> Over-engineered </Bad> Don't add features, refactor other code, or "improve" beyond the test. Verify GREEN - Watch It Pass MANDATORY. Confirm: Test passes Other tests still pass Output pristine (no errors, warnings) Test fails? Fix code, not test. Other tests fail? Fix now. REFACTOR - Clean Up After green only: Remove duplication Improve names Extract helpers Keep tests green. Don't add behavior. Repeat Next failing test for next feature. Good Tests Quality Good Bad --------- ------ ----- Minimal One thing. "and" in name? Split it. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aaaaqwq/sp-test-driven-development