# Test Driven Development

> Implement backend/API changes with a test-first RED-GREEN-REFACTOR workflow.

- Skill: `counterpointconsulting/test-driven-development` (Agent Skill)
- Install (CLI): `npx skillmds@latest add counterpointconsulting/test-driven-development`
- Raw SKILL.md: https://api.skillmd.com/api/skills/counterpointconsulting/test-driven-development/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: CounterpointConsulting (https://skillmd.com/u/counterpointconsulting)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/counterpointconsulting/test-driven-development

---


# Test-Driven Development (TypeScript API)

## Overview
Use a failing-test-first loop for behavior changes. Work is complete only when tests prove expected behavior.

## When to Use
- New endpoint or service behavior
- Bug fixes
- Validation/error-handling changes
- API contract updates

## When NOT to Use
- Pure docs/config edits with no behavior impact

## Inputs
- Requirement/spec for expected behavior
- Existing tests and project test conventions
- Relevant route/controller/service code

## Process
1. RED: write/update failing tests first.
2. GREEN: implement minimal code to pass tests.
3. REFACTOR: improve code while tests remain green.
4. Re-run impacted tests and project checks.

## Verification Checklist
- [ ] Behavior change is captured by tests
- [ ] Error path(s) are tested
- [ ] HTTP status and response shape are validated
- [ ] Typecheck/build expectations pass

## Failure Modes to Avoid
- Coding before failing test exists
- Happy-path-only test coverage
- Declaring done without executing tests

## Output Requirements
- Use `summarize` for final output.
- Include test evidence and any gaps/risks.
- Use canonical camelCase result fields.

