# TDD workflow

> TDD workflow is an open-source agent skill for developer tools. Guides an agent through test-first red-green-refactor cycles with per-step commits. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/Nabwinsaud/forgeline/tree/main/skills/tdd-workflow
- **Repository:** https://github.com/nabwinsaud/forgeline
- **GitHub stars:** 8
- **License:** MIT
- **Skill name:** tdd-workflow
- **Collection:** https://github.com/Nabwinsaud/forgeline
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill sets a disciplined build loop for an agent working inside a job worktree. It takes each acceptance criterion in turn, writes a failing test first, confirms the failure is for the right reason, then writes the minimal code to pass it, refactors with the suite green, and commits after each step. Bug fixes start with a regression test that reproduces the defect before any production change is made.

The guidance also covers practical testing choices. It favors real databases for data access and fakes only at network boundaries, injected clocks and random sources instead of sleeps, self-contained test data, and assertions on outcomes rather than on internal helper calls. It includes conventional commit message examples and forbids skipped or focused tests used to hide failures.

The skill is a single SKILL.md with no bundled scripts. It refers to a verification-loop step for checking coverage, and its examples use Go, TypeScript and Python, so the agent needs a working test toolchain in the repository it is building.

## When your agent uses it

> Test-first build loop for factory jobs - red, green, refactor, one acceptance criterion at a time, with a commit after each green step. Use when implementing a spec, fixing a bug, or changing behavior inside a job worktree.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/Nabwinsaud/forgeline/tree/HEAD/skills/tdd-workflow)
- [License: MIT](https://github.com/Nabwinsaud/forgeline/tree/HEAD/skills/tdd-workflow)

## Features

- **Red-green-refactor loop:** Walks the agent through one acceptance criterion at a time, from failing test to passing code to cleanup.
- **Regression-first bug fixing:** Requires a test that reproduces a reported bug to fail before any production code is changed.
- **Test shape guidance:** Sets conventions for arrange-act-assert layout, naming, parametrized cases and deterministic setup.
- **Mocking boundaries:** Explains which layers should use real databases and code and which should be faked, such as third-party HTTP APIs.
- **Commit cadence rules:** Defines small conventional commits per green step and forbids committing skipped or commented-out tests.
- **Review feedback handling:** Describes how to turn failing gate output or review findings from an earlier attempt into tests before continuing.

## Good for

- Implement a feature from a spec one acceptance criterion at a time
- Fix a bug by first writing a test that reproduces it
- Add a new endpoint with tests covering its error responses
- Refactor a module while keeping the test suite green at every commit
- Address failing test output from a previous attempt before continuing work

## Install

### Claude Code

This skill ships in the `forgeline` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add Nabwinsaud/forgeline
/plugin install forgeline@forgeline
```

Or copy only this skill to `~/.claude/skills/tdd-workflow`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/tdd-workflow &&
cp -R "$tmp/skills/tdd-workflow" ~/.claude/skills/tdd-workflow &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/tdd-workflow` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/tdd-workflow` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/tdd-workflow &&
cp -R "$tmp/skills/tdd-workflow" ~/.agents/skills/tdd-workflow &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/tdd-workflow` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/tdd-workflow` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/tdd-workflow &&
cp -R "$tmp/skills/tdd-workflow" ~/.cursor/skills/tdd-workflow &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/tdd-workflow` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/Nabwinsaud/forgeline.git --path skills/tdd-workflow
```

Or copy the folder to `~/.gemini/skills/tdd-workflow` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/tdd-workflow`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/tdd-workflow &&
cp -R "$tmp/skills/tdd-workflow" ~/.copilot/skills/tdd-workflow &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/tdd-workflow` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git
```

Then copy `forgeline/skills/tdd-workflow` into your agent's skills folder as `tdd-workflow`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does TDD workflow apply?

It is meant for implementing a spec, fixing a bug, or changing behavior inside a job worktree, as stated in its description.

### Does TDD workflow run any scripts or tools?

No scripts are included. It is a single SKILL.md with instructions only, and it does not set allowed tools.

### What languages do the examples use?

The examples show Go, TypeScript and Python test code, and the commit examples use conventional commit prefixes.

### How do I install TDD workflow in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/tdd-workflow to use it in all your projects, or to .claude/skills/tdd-workflow in one project. Or install the forgeline plugin, which includes it: /plugin marketplace add Nabwinsaud/forgeline, then /plugin install forgeline@forgeline.

### Does TDD workflow run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use TDD workflow?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to TDD workflow?

The closest alternatives to TDD workflow are TDD, TDD, TDD loop, TDD and Mt build.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [TDD](https://ai-powered.com/skills/tdd): TDD is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd-kripu77): TDD is an open-source agent skill for developer tools.
- [TDD loop](https://ai-powered.com/skills/tdd-loop): TDD loop is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd-michael-denyer): TDD is an open-source agent skill for developer tools.
- [Mt build](https://ai-powered.com/skills/mt-build): Mt build is an open-source agent skill for developer tools.
- [Develop](https://ai-powered.com/skills/develop): Develop is an open-source agent skill for developer tools.
- [Cpp testing](https://ai-powered.com/skills/cpp-testing): Cpp testing is an open-source agent skill for developer tools.
- [Prd v07 implementation loop](https://ai-powered.com/skills/prd-v07-implementation-loop): Prd v07 implementation loop is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/tdd-workflow-nabwinsaud
