# Tdd Workflow

> Skill: Test-Driven Development (TDD) Workflow

- Skill: `gabrielmoreira/tdd-workflow-7` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gabrielmoreira/tdd-workflow-7`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gabrielmoreira/tdd-workflow-7/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: gabrielmoreira (https://skillmd.com/u/gabrielmoreira)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/gabrielmoreira/tdd-workflow-7

---


# Skill: Test-Driven Development (TDD) Workflow

This skill ensures software development follows a test-first pattern, ensuring modularity, reliability, and regression proofing.

## Steps
1. **Define Interface & Contracts:** Specify standard parameter types, output structures, and Zod boundaries before writing any execution logic.
2. **Write a Failing Test:** Draft unit/component tests in the testing suite under `__tests__` using Vitest or RTL. Run the tests via `pnpm test` to verify they fail for the correct reason.
3. **Write Minimal Code:** Implement the simplest possible structural execution to make the test pass. Avoid adding extra logic not specified in the test.
4. **Pass & Refactor:** Confirm that the test suite passes. Immediately refactor the code (abstractions, function sizes, type clarity) in accordance with the `clean-code.md` rules. Verify tests still pass after refactoring.

