Skip to content

Test-Driven Development skill (Addy Osmani)

Use repository-specific red, green and refactor steps to prove behavior and reproduce bugs.

Community · Addy Osmani
AuthorAddy Osmani
LicenceMIT
Sourceaddyosmani/agent-skills · SKILL.md on GitHub
Project websiteskills.addy.ie
Works inClaude Code · Codex, Gemini CLI, Cursor, Copilot
Read from the source on

The test-driven-development skill by Addy Osmani puts a failing behavior test before the change.

It discovers the project's language, wrappers and test conventions first. Unit, integration and browser verification serve different boundaries; examples in TypeScript do not restrict it to JavaScript projects.

From the skill's SKILL.md: # Test-Driven Development

This is a community skill by Addy Osmani, not checked by us or by Anthropic. Skills can tell the agent to run code, read files or call the network. Before installing, read its SKILL.md and every script in the folder, and look for anything that does not match what it says it does.

What it does

  1. Find the repository's focused and full-suite test commands.
  2. Run a failing test that exposes the missing behavior or bug.
  3. Make the minimal change, then refactor with tests still passing.

What you get

  • Behavior tests, a scoped implementation and recorded red/green verification.

When to use it

  • Implement logic, fix a reproducible bug or change existing behavior.

When not to use it

  • Adding artificial tests for static prose or treating mocked boundaries as real integration evidence.

What it needs

  • A coding agent, project access and the project's existing testing toolchain; browser work may need a separately configured browser integration.

Files in the skill

File or folderWhat it is for
SKILL.mdStack discovery, red-green-refactor and test-boundary guidance.

Licence as found in the repository on 2026-11-23: MIT.

Example prompts

Type one of these after installing; naming the skill makes sure it is used.

  • Write a failing regression test for this reported bug first.
  • Discover the project's test wrapper before changing the function.
  • Separate a unit test from the real database rollback check.

How to install test-driven-development

Retain the shared testing references

Install the plugin or retain the clone alongside the skill folder. Root references are not included by a per-folder copy. Optional browser tooling must be configured separately.

No runner, browser server or database fixture is bundled with the instruction file.

A skill is a folder with a SKILL.md file. You install it once; the agent reads its short description at the start of each session and loads the full instructions only when a request matches. Pick the place you use:

Claude Code: from the plugin marketplace

  1. Start Claude Code in a terminal with claude.
  2. Add the marketplace (once per computer):
    /plugin marketplace add addyosmani/agent-skills
  3. Install the plugin. Claude Code opens its details first: check what it will add (skills, hooks, MCP servers), then choose whether it is for you, for everyone on this repository, or for you in this repository only.
    /plugin install agent-skills@addy-agent-skills
  4. Type / and look for /agent-skills:test-driven-development, or simply ask for the task.

From your shell instead of a session:

claude plugin marketplace add addyosmani/agent-skills
claude plugin install agent-skills@addy-agent-skills

The plugin installs as a whole, so other skills come with it, including accessibility-engineering, api-and-interface-design, browser-testing-with-devtools, ci-cd-and-automation, code-review-and-quality, code-simplification, constraint-driven-development, context-engineering, debugging-and-error-recovery, deprecation-and-migration, documentation-and-adrs, doubt-driven-development, frontend-ui-engineering, git-workflow-and-versioning, idea-refine, incremental-implementation, interview-me, observability-and-instrumentation, performance-optimization, planning-and-task-breakdown, security-and-hardening, shipping-and-launch, source-driven-development, spec-driven-development, using-agent-skills.

Claude Code: copy the folder into your skills folder

Put the skill's folder in ~/.claude/skills/ to use it in every project on this computer, or in .claude/skills/ inside a repository to share it with everyone who works there (commit it).

git clone --depth 1 https://github.com/addyosmani/agent-skills.git
mkdir -p ~/.claude/skills
cp -R agent-skills/skills/test-driven-development ~/.claude/skills/

Claude Code notices new or changed skills in these folders during the session. If the skills folder did not exist when the session started, run /reload-skills once. Then type /test-driven-development or just describe the task.

On Windows, run the commands in Git Bash or WSL, or copy the folder into the same place with File Explorer.

Codex, Gemini CLI, Cursor and GitHub Copilot

These agents read the same SKILL.md folders. The one folder all four accept inside a project is .agents/skills/, so this copies the skill there:

git clone --depth 1 https://github.com/addyosmani/agent-skills.git
mkdir -p .agents/skills
cp -R agent-skills/skills/test-driven-development .agents/skills/
AgentProject folderYour user folderNotes
OpenAI Codex
.agents/skills/
~/.agents/skills/
Type $ or run /skills to pick a skill; Codex also chooses one when your task matches.
Gemini CLI
.agents/skills/
.gemini/skills/
~/.agents/skills/
~/.gemini/skills/
Or install from Git with gemini skills install <git URL> --path <folder> --consent. Google replaced Gemini CLI with Antigravity CLI for free-tier and Google One users on 18 June 2026; Antigravity uses .agents/skills/ in a project and ~/.gemini/config/skills/ for you.
Cursor
.agents/skills/
.cursor/skills/
~/.agents/skills/
~/.cursor/skills/
Type / in Agent chat to pick a skill. Cursor also reads Claude Code's .claude/skills/ folders.
GitHub Copilot
.github/skills/
.agents/skills/
.claude/skills/
~/.copilot/skills/
~/.agents/skills/
Works in Copilot CLI, the cloud agent, and agent mode in VS Code, Visual Studio and JetBrains (IDE support depends on the version). Or run gh skill install OWNER/REPOSITORY SKILL (public preview, GitHub CLI 2.90.0 or later).
Only install skills you trust. Anthropic's advice is to use skills only from trusted sources, and to read every file of any other skill before using it: a skill can direct the agent to run commands, read files or send data in ways its description does not mention.

Sources for these steps

Checked against each vendor's documentation on 2026-11-14:

Make the failure informative

A red test should fail for the intended missing behavior. Confirm the failure reason before treating the later green run as evidence that the change worked.

Test the actual boundary

Use focused fast tests for pure logic and real implementations where practical. Browser flows and crash recovery require runtime evidence beyond a passing mocked unit test.

Questions about test-driven-development

Is it limited to TypeScript?

No. TypeScript is illustrative; the agent must use the repository's own ecosystem.

Is every test expected to fail first?

New behavior and bug-reproduction tests should demonstrate the missing behavior before the fix, rather than fail for unrelated setup errors.

Do mocks prove integration works?

No. A mock can isolate logic, but real boundary tests are needed for database, process or browser behavior.

Does it include a test runner?

No. It guides the agent to the project's existing runner and conventions.

More AI skills

Related skills

Skill categories

Buy me a coffee