Skip to content
Skill

TDD

Guides the agent to write a failing regression test before fixing a bug

TDD is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
5.1K
Last commit
License
MIT
Listing updated

Similar skills

About TDD

This skill tells the agent to reproduce a bug as an executable check before touching production code. The agent identifies the intended and current behavior, picks the narrowest existing test path for that code, writes a focused test, confirms it fails for the reason the bug predicts, and then makes the smallest fix and reruns the test.

The skill is deliberately selective. It steers the agent away from tests that would need heavy harness setup, brittle mocks, slow end-to-end infrastructure or large fixture changes, and suggests a targeted script, manual reproduction, browser check or log assertion instead. It also sets guardrails against editing tests just to match a wrong implementation or weakening existing assertions without a clear reason.

The final report is expected to show evidence: the failure output seen before the fix, the passing run afterwards, and any nearby validation. It is a plain SKILL.md with no bundled scripts, so it relies on whatever test tooling the target project already has.

When your agent uses it

Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (3 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

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

/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude

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

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/tdd &&
cp -R "$tmp/plugins/pstack/skills/tdd" ~/.claude/skills/tdd &&
rm -rf "$tmp"

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

Claude Code docs on skills

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

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/tdd &&
cp -R "$tmp/plugins/pstack/skills/tdd" ~/.agents/skills/tdd &&
rm -rf "$tmp"

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

Codex docs on skills

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

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/tdd &&
cp -R "$tmp/plugins/pstack/skills/tdd" ~/.cursor/skills/tdd &&
rm -rf "$tmp"

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

Cursor docs on skills

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

gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/tdd

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

Gemini CLI docs on skills

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

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/tdd &&
cp -R "$tmp/plugins/pstack/skills/tdd" ~/.copilot/skills/tdd &&
rm -rf "$tmp"

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

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git

Then copy pstack-claude/plugins/pstack/skills/tdd into your agent's skills folder as tdd. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Failing test first
Writes the smallest focused test that would have caught the bug before any fix is made.
Narrow test selection
Prefers the closest existing unit, component or integration test for the affected code path.
Failure verification
Checks that the test fails for the intended reason rather than an unrelated error.
Skip impractical tests
Falls back to a targeted script, manual reproduction or browser check when a proper test would be costly.
Guardrails against bad tests
Discourages mock-heavy, timing-dependent or implementation-mirroring tests and weakened assertions.
Evidence-based reporting
Asks the agent to report the before-and-after failure and pass results and any nearby validation.

Good for

  • Fix a reported bug by first writing a regression test that reproduces it
  • Add a focused test for an edge case that broke in a function
  • Verify a bug fix when a unit test is impractical, using a manual reproduction command
  • Check that a flaky behavior is pinned down with a deterministic test

TDD FAQ

When does TDD trigger?

It applies when the user explicitly asks for TDD, a failing test or a regression test, or when the bug has an obvious, cheap local test target. It is meant to be skipped when the test path is unclear, expensive, integration-heavy or not requested.

What does the agent do if a test is impractical?

It uses the closest executable regression check instead, such as a targeted script, manual reproduction command, browser automation, snapshot comparison, log assertion or focused integration check.

Does the skill install anything or run scripts?

No. The skill is a single SKILL.md file with no bundled scripts. It guides the agent's workflow using the test tooling already in the project.

Does TDD require a particular testing framework?

The SKILL.md does not name a framework. It tells the agent to use the closest test already used for that code path.

How do I install TDD in Claude Code?

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

Does TDD 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?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to TDD?

The closest alternatives to TDD are TDD, Debug, Bug, TDD loop and Testing strategy.

Where this comes from

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

More from michael-denyer/pstack-claude

  1. Makes the agent read pstack's poteto-mode skill first and follow its routing

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  2. Has the agent restate your goals and the problem you're solving in its own words

    • Open source
    • 5.1K GitHub stars
    • Productivity
  3. Sketches types, signatures and module layout before the agent writes code

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  4. Runs parallel candidate attempts at a task, then merges the best parts into one artifact

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  5. Drafts a personal working-style skill from your past agent conversations

    • Open source
    • 5.1K GitHub stars
    • Developer tools