# tdd

Guides agents through a disciplined red-green-refactor loop. It builds features one vertical slice at a time and tests public behavior over implementation details.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2800 installs · ★ 379
- Author: brianlovin
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/brianlovin/agent-config/tree/HEAD/skills/tdd/SKILL.md
- Updated: 2026-03-25
- HTML: https://affpapa.org/en/nevibecode/skills/brianlovin-tdd

## What it does

This skill enforces a strict test-driven workflow. Instead of generating dozens of tests upfront, the agent plans the public interface with you, identifies critical behaviors, and writes a single failing test. It then writes just enough code to make that test pass before moving on.

The workflow explicitly blocks horizontal slicing, where one writes all tests first and all code second. Tests target public APIs rather than internal methods or direct database state. Because tests ignore internal structure, later code changes will not break them.

Refactoring is permitted only after reaching green status. Touching code architecture while tests remain red is forbidden.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add brianlovin/agent-config --skill tdd -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/tdd/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/tdd/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add brianlovin/agent-config --skill tdd -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/tdd/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add brianlovin/agent-config --skill tdd -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/tdd/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install brianlovin/agent-config tdd
```

2. **Manually: put the files in place**
- File: `.github/skills/tdd/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add brianlovin/agent-config --skill tdd -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/brianlovin/agent-config --path skills/tdd
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/tdd/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add brianlovin/agent-config --skill tdd -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/brianlovin/agent-config/tree/HEAD/skills/tdd/SKILL.md

## When to use it
- design testable public interfaces before implementation
- verify end-to-end flows with minimal tracer bullet tests
- keep tests working during internal code refactors
- add features incrementally without speculative code

## Example prompts
- Build the shopping cart checkout using TDD and red-green-refactor
- Fix the discount calculation bug test-first
- Create integration tests for the user registration endpoint

## Similar
- [rtk-tdd](https://affpapa.org/en/nevibecode/skills/rtk-tdd.md) — skill · 2100 installs
- [tdd-rust](https://affpapa.org/en/nevibecode/skills/tdd-rust.md) — skill · 1400 installs
- [tdd-workflow](https://affpapa.org/en/nevibecode/skills/ruvnet-tdd-workflow.md) — skill · 743 installs
- [laravel-tdd](https://affpapa.org/en/nevibecode/skills/iserter-laravel-tdd.md) — skill · 378 installs
- [tdd-gate](https://affpapa.org/en/nevibecode/hooks/tdd-gate.md) — hook · 192 installs
- [test-driven-development](https://affpapa.org/en/nevibecode/skills/sickn33-test-driven-development.md) — skill · 1400 installs

## Other versions with the same name
- [tdd · mattpocock](https://affpapa.org/en/nevibecode/skills/tdd.md) — 1141062 installs
- [tdd · backnotprop](https://affpapa.org/en/nevibecode/skills/backnotprop-tdd.md) — 5100 installs
- [tdd · codewithmukesh](https://affpapa.org/en/nevibecode/skills/codewithmukesh-tdd.md) — 2800 installs
- [tdd · parcadei](https://affpapa.org/en/nevibecode/skills/parcadei-tdd.md) — 470 installs

From the same set: [brianlovin/agent-config](https://affpapa.org/en/nevibecode/by/brianlovin/agent-config.md) — 12 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
