test-driven-development

test-driven-development is a skill for Claude Code, Codex from itallstartedwithaidea/agent-skills. It costs 27 tokens per session (1,226 once invoked), scanned A, original, MIT.

A coding workflow that writes a failing test before each code change, makes it pass with the smallest implementation, then improves the code and commits the result. TDD means test-driven development.

In plain words
What is it for?
It helps build functions, methods, and modules; fix bugs; and make changes with a test-first process.
Why use it?
It prevents untested code and catches edge cases while the change is being made. Each small change also leaves a focused version-control commit.

Skill for Claude CodeCodex

Part of the software-dev-skills plugin — 8 skills shipped together , and of all-skills

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/itallstartedwithaidea/agent-skills/test-driven-development
Any agent
npx skills add itallstartedwithaidea/agent-skills --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/itallstartedwithaidea/agent-skills

Made for: Claude Code, Codex.

Or install software-dev-skills, the plugin that ships this one along with the rest of its 8 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-driven-development

README.md
[![agentmods](https://agentmods.dev/badge/skills/itallstartedwithaidea/agent-skills/test-driven-development.svg)](https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/test-driven-development"><img src="https://agentmods.dev/badge/skills/itallstartedwithaidea/agent-skills/test-driven-development.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,226 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00027 $0.01226
Opus 5 $0.00014 $0.00613
Sonnet 5 $0.00005 $0.00245
Haiku 4.5 $0.00003 $0.00123

Measured yesterday against content hash f10d531dc07d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-driven-development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/software-dev/test-driven-development/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test-Driven Development

Part of Agent Skills™ by googleadsagent.ai™

Description

Test-Driven Development enforces the RED-GREEN-REFACTOR discipline on every code change an agent produces. The agent writes a failing test first, confirms the failure, writes the minimal code to pass, confirms the pass, refactors for clarity, and commits. No production code exists without a corresponding test that demanded its creation.

This skill eliminates the most common agent anti-pattern: generating large blocks of untested code that "look right" but silently break under edge cases. By forcing the agent through the TDD cycle, each line of production code is justified by a specific test assertion. The result is a codebase where test coverage is not an afterthought but a structural guarantee.

The cycle integrates directly with version control. Each RED-GREEN-REFACTOR iteration produces an atomic commit, creating a reviewable history of design decisions. The refactor phase is mandatory—the agent must evaluate naming, duplication, and structural clarity before moving to the next feature increment.

Use When

  • Writing any new function, method, or module
  • Fixing a bug (write the test that exposes the bug first)
  • Refactoring existing code (ensure tests pass before and after)
  • The user requests "TDD", "test-first", or "red-green-refactor"
  • Building APIs, data transformations, or business logic
  • You need confidence that a change does not introduce regressions

How It Works

graph LR
    R[RED: Write Failing Test] --> G[GREEN: Minimal Code to Pass]
    G --> RF[REFACTOR: Clean Up]
    RF --> C[COMMIT: Atomic Commit]
    C --> R
    style R fill:#e74c3c,color:#fff
    style G fill:#2ecc71,color:#fff
    style RF fill:#3498db,color:#fff
    style C fill:#95a5a6,color:#fff

RED: Write a test that describes the next small behavior increment. Run it. Confirm it fails for the expected reason—not a syntax error or import failure, but a genuine assertion failure. GREEN: Write the simplest production code that makes the test pass. Resist the urge to generalize. REFACTOR: Improve names, extract duplication, simplify control flow. All tests must still pass. COMMIT: Stage and commit with a message referencing the behavior added.

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 121 lines · 27 tokens per session scan A f10d531dc07d

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository itallstartedwithaidea/agent-skills (36 stars, last pushed 4mo ago), licensed MIT. It adds 27 tokens to every session and 1,226 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.