AI DevKit · Test-driven development — write a failing test before writing production code.

Apache-2.0Auto-check passedTesting & QA

Install TDD

skills CLI
$ npx skills add codeaholicguy/ai-devkit --skill tdd -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install codeaholicguy/ai-devkit tdd --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/codeaholicguy/ai-devkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tdd .claude/skills/tdd && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tdd
GitHub stars
1.6k
Token cost
~838 tokens
SKILL.md length
476 words
Files
2
Skills in repo
28
Repo updated
First seen
Licence
Apache-2.0

At a glance

AI DevKit · Test-driven development — write a failing test before writing production code.

  • Works in 3 steps: Red — Write a test for the next… → Green — Write the minimum production… → Refactor — Clean up both test and…
  • Implementing new functionality
  • SKILL.md covers Hard Rules, Cycle, Rules for Each Step and Anti-Patterns, plus 2 more sections
  • Calls npx

What it does

TDD is an agent skill from codeaholicguy/ai-devkit. AI DevKit · Test-driven development — write a failing test before writing production code. Use when implementing new functionality, adding behavior, or fixing bugs during active development.

Its SKILL.md is about 840 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Testing & QA, covering Test-driven development and Failing and flaky tests. The repository describes itself as: The control plane for AI coding agents. The licence is Apache-2.0.

When your agent uses it

  • Implementing new functionality
  • Adding behavior
  • Fixing bugs during active development

Example prompts

  • “/tdd”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Red — Write a test for the next behavior. Run it. It must fail. Read the failure message — it should describe the missing behavior.
  2. Green — Write the minimum production code to make the test pass. Nothing more. Run the test. Apply the verify skill.
  3. Refactor — Clean up both test and production code. Run the test again. Still green? Done. Apply the verify skill.

What it can do on your machine

Read from SKILL.md and the folder at commit 7ef0cd5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

TDD loads about 838 tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 476 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~838

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from codeaholicguy/ai-devkit at commit 7ef0cd5, republished under its Apache-2.0 licence (© codeaholicguy). 476 words, ~838 tokens.

Download SKILL.mdSave it as .claude/skills/tdd/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
tdd
description
AI DevKit · Test-driven development — write a failing test before writing production code. Use when implementing new functionality, adding behavior, or fixing bugs during active development.

TDD

Red. Green. Refactor. In that order, every time.

Hard Rules

  • No production code without a failing test first.
  • If production code was written before its test, delete it and start over with a failing test.
  • Never skip the red step. A test that has never failed proves nothing.

Cycle

For each unit of behavior:

  1. Red — Write a test for the next behavior. Run it. It must fail. Read the failure message — it should describe the missing behavior.
  2. Green — Write the minimum production code to make the test pass. Nothing more. Run the test. Apply the verify skill.
  3. Refactor — Clean up both test and production code. Run the test again. Still green? Done. Apply the verify skill.

Then pick the next behavior and repeat.

Rules for Each Step

Red:

  • Test one behavior, not one function. Name the test after what the system should do, not what the function is called.
  • The test must fail for the right reason — a missing method, wrong return value, unmet condition. Not a syntax error or import failure.
  • If the test passes immediately, it's not testing new behavior. Delete it or pick a different behavior.

Green:

  • Write the simplest code that passes. Hardcode if needed — the next test will force generalization.
  • Do not add code "while you're in there." If it's not required by a failing test, it doesn't exist yet.
  • Do not refactor during green. Pass first, clean second.

Refactor:

  • Remove duplication between test and production code.
  • Extract only when you see real duplication, not predicted duplication.
  • Tests must still pass after every refactor move. Run them after each change.
Show full SKILL.md (207 more words)Show less

Anti-Patterns

PatternProblemFix
Test-afterCode shapes the test instead of the other way aroundDelete the code, write the test first
Testing internalsTests break on refactor, not on behavior changeTest public behavior only
Giant red stepMultiple behaviors in one testOne assertion per behavior
Gold-plating greenAdding code no test requiresRemove untested code
Skipping refactorTech debt accumulates immediatelyRefactor before the next red
Mock-heavy testsTests pass but real code failsPrefer real dependencies, mock at boundaries only

Red Flags and Rationalizations

RationalizationWhy It's WrongDo Instead
"This is too simple to test first"Simple code still needs a specWrite the test — it'll be fast
"I'll add the test right after"You won't, and the code will shape the testTest first, always
"I need to see the design first"The test IS the designLet the test drive the interface
"Mocking is too hard for this"Difficulty mocking signals tight couplingFix the design, then test
"The test would be identical to the implementation"Then you're testing internalsTest the behavior from the outside

Memory Integration

After completing a TDD session, store reusable test patterns (setup, assertions, fixtures): npx ai-devkit@latest memory store --title "<pattern>" --content "<details>" --tags "tdd,testing"

© codeaholicguy, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/tdd of codeaholicguy/ai-devkit.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 7ef0cd5

Compare with similar skills

TDD next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

TDD compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TDD this skillcodeaholicguy/ai-devkit1.6k—~838Automated safety check: PassApache-2.0
Superpowers Test Driven Developmentchristopherarter/superpowers-reasonix102—~1.9kAutomated safety check: PassMIT
Openspec Plus TDDelastic/terraform-provider-elasticstack2101 repos~4.7kAutomated safety check: PassApache-2.0
Fix BugMelbourneDeveloper/dart_node1131 repos~709Automated safety check: NotesNone
Evanflow Debugevanklem/evanflow418—~760Automated safety check: PassCustom licence
TDD Workflows TDD Greenaiskillstore/marketplace4307 repos~568Automated safety check: PassNone

Similar skills

  • Superpowers Test Driven Development

    christopherarter/superpowers-reasonix

    Writing or fixing any code?. An agent skill from christopherarter/superpowers-reasonix.

    102 GitHub stars~1.9k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Openspec Plus TDD

    elastic/terraform-provider-elasticstack

    Official

    MANDATORY skill that activates whenever code is written to implement an OpenSpec change task.

    210 GitHub starsUsed in 1 repo~4.7k tokens
    Testing & QAAuto-check passed
  • Fix Bug

    MelbourneDeveloper/dart_node

    Fix a bug using test-driven development. An agent skill from MelbourneDeveloper/dart_node.

    113 GitHub starsUsed in 1 repo~709 tokens
    Testing & QAAuto-check: notes
  • Evanflow Debug

    evanklem/evanflow

    Root-cause discipline for bugs, test failures, and unexpected behavior.

    418 GitHub stars~760 tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • TDD Workflows TDD Green

    aiskillstore/marketplace

    Implement the minimal code needed to make failing tests pass in the TDD green phase.

    430 GitHub starsUsed in 7 repos~568 tokens
    Testing & QAAuto-check passed
  • Test First Changes

    pdparchitect/noodle

    Test-first procedure for every behaviour change in Noodle. An agent skill from pdparchitect/noodle.

    151 GitHub stars~201 tokensUpdated today
    Testing & QAAuto-check passed

More from codeaholicguy/ai-devkit

All 28 skills in this repo
  • Agent Management

    codeaholicguy/ai-devkit

    AI DevKit · Manage running AI agents with ai-devkit agent commands.

    1.6k GitHub stars~558 tokensUpdated today
    Auto-check passed
  • Dev Lifecycle

    codeaholicguy/ai-devkit

    AI DevKit · Orchestrator for structured SDLC phase skills. An agent skill from codeaholicguy/ai-devkit.

    1.6k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Task

    codeaholicguy/ai-devkit

    AI DevKit · Track dev-lifecycle / structured-debug progress on a durable task with the ai-devkit task CLI.

    1.6k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Simplify Implementation

    codeaholicguy/ai-devkit

    AI DevKit · Analyze and simplify existing implementations to reduce complexity, improve maintainability, and enhance scalability.

    1.6k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Agent Communication

    codeaholicguy/ai-devkit

    AI DevKit · Exchange information with active Codex, Claude Code, and other AI agents using ai-devkit agent list, detail, and send.

    1.6k GitHub stars~321 tokensUpdated today
    Auto-check passed
  • Technical Writer

    codeaholicguy/ai-devkit

    AI DevKit · Review and improve documentation for novice users.

    1.6k GitHub stars~431 tokensUpdated today
    Auto-check passed

Categories

Questions about TDD

What does TDD do?

AI DevKit · Test-driven development — write a failing test before writing production code. TDD is an agent skill from codeaholicguy/ai-devkit. AI DevKit · Test-driven development — write a failing test before writing production code.

When should I use TDD?

TDD fits situations like: implementing new functionality; adding behavior; fixing bugs during active development.

How do I install TDD in Claude Code?

Run `npx skills add codeaholicguy/ai-devkit --skill tdd -a claude-code`. Or copy the skill folder (skills/tdd in codeaholicguy/ai-devkit) into .claude/skills/tdd in your project. Claude Code loads it when a task matches its description.

How do I install TDD in Codex?

Run `npx skills add codeaholicguy/ai-devkit --skill tdd -a codex`. Or copy the skill folder (skills/tdd in codeaholicguy/ai-devkit) into .agents/skills/tdd in your project. Codex loads it when a task matches its description.

Can I use TDD in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add codeaholicguy/ai-devkit --skill tdd -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdd, .gemini/skills/tdd, .github/skills/tdd and .opencode/skills/tdd in your project.

What does TDD need to run?

Going by SKILL.md and its folder, TDD needs the command-line tools its instructions call (npx). Our summary lists: Node.js.

Does TDD access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is TDD safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does TDD use?

TDD is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does TDD use?

About 838 tokens (SKILL.md is roughly 3.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to TDD?

Skills that share tags, products or a category with TDD: Superpowers Test Driven Development (christopherarter/superpowers-reasonix, 102 stars), Openspec Plus TDD (elastic/terraform-provider-elasticstack, 210 stars), Fix Bug (MelbourneDeveloper/dart_node, 113 stars) and Evanflow Debug (evanklem/evanflow, 418 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TDD?

codeaholicguy (a GitHub user) maintains it in codeaholicguy/ai-devkit, which has 1,642 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on October 7, 2026.

Source: codeaholicguy/ai-devkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.