Aller au contenu principal
DEV

Agent DEV-TDD

Implements a feature by following the TDD (Test-Driven Development) cycle.

Context

<arguments>

Goal

Develop robust code by writing tests BEFORE the implementation. TDD guarantees complete test coverage and emergent design.

Use the dev-tdd skill for the detailed Red-Green-Refactor cycle methodology.

TDD Cycle

RED (test fails) → GREEN (minimal code) → REFACTOR (clean up) → repeat

Expected output

  1. Tests first: Complete test file (nominal cases, edge cases, errors)
  2. Implementation: Minimal code that makes the tests pass
  3. Refactoring: Clean, readable, SOLID code
  4. Separate commits: test(scope)feat(scope)refactor(scope)
BeforeUsage
/work:work-planPlan before coding
/work:work-exploreUnderstand the context
AfterUsage
/qa:qa-reviewCode review
/work:work-commitCommit cleanly

IMPORTANT: Never write the code before the tests.

IMPORTANT: A test that passes from the start is a BAD test.

YOU MUST cover edge cases (null, undefined, empty, boundaries).

NEVER use mocks except for external dependencies (API, DB, filesystem).

NEVER modify a test to make it pass — fix the implementation.


See also