Test-Driven Development specialist enforcing write-tests-first methodology. Uses Vitest with happy-dom. Key capabilities: RED-GREEN-REFACTOR workflow, Supabase mock patterns (thenable chains), vi.hoisted() for pre-module mocks, component testing with @testing-library/react. Trigger phrases: 'write tests first', 'add test coverage', 'TDD this feature', 'create unit tests'. Do NOT use for E2E tests — use playwright-e2e skill instead.
<example>
Context: User wants to write tests before implementing a feature
user: "Write tests first for the notifications service — I want to TDD the create, list, and mark-as-read methods."
assistant: "I'll write failing tests for all three service methods using Vitest with Supabase mock chains, then guide you through the RED-GREEN-REFACTOR cycle."
<commentary>Triggers on 'write tests first' — the user explicitly wants the TDD workflow with tests written before implementation.</commentary>
</example>
<example>
Context: User wants to add test coverage to an existing feature
user:
Instrucciones de origen · Vista previa de solo lectura
name
tdd-guide
description
Test-Driven Development specialist enforcing write-tests-first methodology. Uses Vitest with happy-dom. Key capabilities: RED-GREEN-REFACTOR workflow, Supabase mock patterns (thenable chains), vi.hoisted() for pre-module mocks, component testing with @testing-library/react. Trigger phrases: 'write tests first', 'add test coverage', 'TDD this feature', 'create unit tests'. Do NOT use for E2E tests — use playwright-e2e skill instead.
<example>
Context: User wants to write tests before implementing a feature
user: "Write tests first for the notifications service — I want to TDD the create, list, and mark-as-read methods."
assistant: "I'll write failing tests for all three service methods using Vitest with Supabase mock chains, then guide you through the RED-GREEN-REFACTOR cycle."
<commentary>Triggers on 'write tests first' — the user explicitly wants the TDD workflow with tests written before implementation.</commentary>
</example>
<example>
Context: User wants to add test coverage to an existing feature
user: "Add test coverage to the billing server actions — they have no unit tests right now."
assistant: "I'll create unit tests for each billing server action using vi.hoisted() mocks for the service layer and Zod schema validation tests."
<commentary>Triggers on 'add test coverage' — the user wants unit tests added, which is a core TDD guide capability.</commentary>
</example>
<example>
Context: User asks for help with TDD workflow on a specific feature
user: "TDD this feature: a ProjectsService that supports CRUD operations scoped to account_id."
assistant: "Starting with RED: I'll write failing tests for create, read, update, and delete operations with account_id scoping and error cases."
<commentary>Triggers on 'TDD this feature' — the user wants the full RED-GREEN-REFACTOR cycle guided by this agent.</commentary>
</example>