# Apply Test-Driven Development to Every Change

Software changes often grow before their expected behavior is verified. This skill guides Claude, Codex, and Claude Code through focused Red-Green-Refactor cycles.

## Install

```bash
npx skillstore add benny9193/tdd
```

## Metadata

- Status: approved
- Slug: benny9193-tdd
- Skillstore revision: r2
- Version status: missing
- Tree hash: 42338d29d12cd9e5a6fb5727255307acd52af8657e50064c202ee329cf871e79
- Author: Benny9193
- GitHub username: Benny9193
- License: MIT
- Repository: https://github.com/Benny9193/devflow/tree/master/skills/tdd
- Ref: 8c3e20bba512c392d9b02ee748b18e0b09d4982c
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 79
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/benny9193-tdd
- Manifest: https://skillstore.pages.dev/api/skills/benny9193-tdd/manifest

## Capabilities

- Structures feature work into Red, Green, and Refactor phases.
- Requires a correctly failing test before production implementation.
- Guides minimal implementation until each selected test passes.
- Encourages behavior-focused test names and assertions.
- Provides checklists for tests, implementation, and refactoring.

## Use Cases

- Build a Small Feature: Turn one behavior into a failing test, minimal implementation, and focused refactoring.
- Fix a Reproducible Defect: Capture a defect with a failing regression test before changing production behavior.
- Teach Incremental Design: Demonstrate how successive tests drive a general solution from a simple starting point.

## Prompt Templates

### Start One TDD Cycle

```
Use TDD to add [behavior]. First write one focused test, explain the expected failure, then implement only enough to pass.
```

### Fix a Bug with TDD

```
Reproduce [bug] with one failing regression test. Confirm why it fails, apply the smallest fix, then suggest a focused refactor.
```

### Plan Incremental Test Cases

```
List the behaviors for [feature] from simplest to most complex. Begin the first Red-Green-Refactor cycle and stop after one passing test.
```

### Drive a Complex Refactor

```
Review [module] and its tests. Identify observable behavior, add characterization tests incrementally, and refactor only while all tests remain green.
```

## Limitations

- Does not select or configure a testing framework.
- Does not replace integration, performance, or security testing.
- Requires an existing project where tests can be executed.
- Does not define domain requirements or acceptance criteria.

## Best Practices

- Confirm each new test fails for the expected reason.
- Change one behavior at a time and keep feedback cycles short.
- Refactor only with a passing test suite.

## Anti Patterns

- Do not write production behavior before observing a failing test.
- Do not add many tests before making the first test pass.
- Do not assert private implementation details when public behavior is available.

## Security Audit

- Audited at: 2026-07-23T11:25:55.921\+00:00
- Summary: All 18 static findings are false positives caused by Markdown code formatting or ordinary TDD guidance. The skill contains no shell execution, network reconnaissance, data exfiltration, or prompt injection instructions.

## Stats

- Views: 206
- Downloads: 10
- Favorites: 0
- Popularity score: 0
