Skip to content
Skill

Test driven development

Guides an agent through red-green-refactor test-first development and bug reproduction

Test driven development is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
122K
Last commit
License
MIT
Listing updated

Similar skills

About Test driven development

This skill makes the agent write a failing test before changing any logic, whether it is a new behavior, a bug fix or an edit to existing functionality. For bug reports it has the agent reproduce the defect in a test first, then implement the fix and confirm the test passes along with the rest of the suite.

Before writing the first test, the agent is told to discover how the repository runs its tests: checking the build files, checked-in wrappers, test configuration, neighboring test conventions and documented CI commands, and to use those commands rather than a default like npm test. It also covers test sizing, preferring real implementations over mocks, arrange-act-assert structure, and naming tests after the behavior they check.

For browser-based changes it points to combining the workflow with Chrome DevTools MCP for runtime checks such as console, network and DOM inspection. The skill includes a JavaScript and TypeScript patterns reference file, but its examples are illustrative and the process applies to any language.

When your agent uses it

Drives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality. Use when asked to add tests to a function, fix a bug in it or change its behavior, even when the code is pasted inline, the request does not mention tests and the answer looks obvious from reading it. The skill writes the failing test first and changes the function second, never the change alone.

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 2 files (24 KB) on GitHub on 3 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 agent-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add chrisalehman/bionic
/plugin install agent-skills@bionic

Or copy only this skill to ~/.claude/skills/test-driven-development:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/test-driven-development &&
cp -R "$tmp/skills/test-driven-development" ~/.claude/skills/test-driven-development &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/test-driven-development inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/test-driven-development to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/test-driven-development &&
cp -R "$tmp/skills/test-driven-development" ~/.agents/skills/test-driven-development &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/test-driven-development inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/test-driven-development to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/test-driven-development &&
cp -R "$tmp/skills/test-driven-development" ~/.cursor/skills/test-driven-development &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/test-driven-development 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/addyosmani/agent-skills.git --path skills/test-driven-development

Or copy the folder to ~/.gemini/skills/test-driven-development yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/test-driven-development:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/test-driven-development &&
cp -R "$tmp/skills/test-driven-development" ~/.copilot/skills/test-driven-development &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/test-driven-development inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/addyosmani/agent-skills.git

Then copy agent-skills/skills/test-driven-development into your agent's skills folder as test-driven-development. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Red-green-refactor loop
Walks the agent through writing a failing test, minimal passing code and a clean-up step.
Bug reproduction first
Has the agent write a test that demonstrates a reported bug before attempting a fix.
Repository command discovery
Directs the agent to find and use the project's own test runner and full-suite command.
Test quality guidance
Covers state-based assertions, test isolation, naming and limiting mocks to boundaries.
Test pyramid and sizing
Explains small, medium and large test categories and how to split testing effort between them.
Browser runtime verification
Describes using Chrome DevTools MCP to inspect console, network, DOM and performance during UI fixes.

Good for

  • Add tests before implementing a new function or feature
  • Reproduce a reported bug with a failing test, then fix it
  • Change existing behavior while keeping the test suite green
  • Verify a front-end fix by checking console and network output in a browser

Test driven development FAQ

What does the skill change in my project?

It changes how the agent works: it writes a failing test first and uses the repository's own test commands for each step. It does not add files of its own beyond the skill folder.

Does Test driven development need any scripts or tools?

It ships no scripts. Browser checks need Chrome DevTools MCP, and the examples assume TypeScript, though the workflow applies to any language.

When does Test driven development trigger?

Its description says it applies when implementing logic, fixing bugs or changing behavior, including when the request does not mention tests.

How do I install Test driven development in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/test-driven-development to use it in all your projects, or to .claude/skills/test-driven-development in one project. Or install the agent-skills plugin, which includes it: /plugin marketplace add chrisalehman/bionic, then /plugin install agent-skills@bionic.

Does Test driven development 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 Test driven development?

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 Test driven development?

The closest alternatives to Test driven development are TDD, TDD workflow, TDD, TDD and TDD loop.

Where this comes from

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

More from addyosmani/agent-skills

  1. Audits interfaces against WCAG 2.2 AA and guides fixing the violations found

    • Open source
    • 122K GitHub stars
    • Developer tools
  2. Guides designing stable, hard-to-misuse APIs, REST endpoints and module contracts

    • Open source
    • 122K GitHub stars
    • Design and media
  3. Lets your coding agent inspect and test live browser pages through Chrome DevTools

    • Open source
    • 122K GitHub stars
    • Browser automation
  4. Sets up CI/CD quality gates, deployment strategies and rollback plans for agents

    • Open source
    • 122K GitHub stars
    • Developer tools
  5. Guides an agent through multi-axis code review before changes are merged

    • Open source
    • 122K GitHub stars
    • Developer tools
  6. Guides an agent to simplify working code for clarity without changing behavior

    • Open source
    • 122K GitHub stars
    • Developer tools