tdd

tdd is a skill for Claude Code, Codex from codeaholicguy/ai-devkit. It costs 36 tokens per session (754 once invoked), scanned A, original, Apache-2.0.

A test-first development method, commonly called TDD, where you write a test that fails before writing the code that should pass it. You then make it pass and clean up the code.

In plain words
What is it for?
Use it when adding a feature, changing behavior, or fixing a bug during development.
Why use it?
It makes the intended behavior explicit and catches code that does not do what the test requires.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the ai-devkit plugin — 29 skills, 1 hook shipped together

Good fit Use it when adding a feature, changing behavior, or fixing a bug during development.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/codeaholicguy/ai-devkit/tdd
About the project

AI DevKit is a local-first control layer that gives multiple AI coding agents shared configuration, a terminal dashboard, cross-agent messaging, local memory retrieval, and reusable engineering workflows. It is for developers and teams supervising agents such as Claude Code, Codex CLI, Gemini CLI, OpenCode, Pi, Cursor, Copilot, or Devin. The catalogue entries are composable skills and plugin components used within that agent-management system.

codeaholicguy/ai-devkit · 1,649 stars · on GitHub · ai-devkit.com

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.

Any agent
npx skills add codeaholicguy/ai-devkit --skill tdd
Clone the repo
git clone --depth 1 https://github.com/codeaholicguy/ai-devkit

Made for: Claude Code, Codex.

Or install ai-devkit, the plugin that ships this one along with the rest of its 29 skills, 1 hook.

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 tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/codeaholicguy/ai-devkit/tdd/github.svg)](https://agentmods.dev/skills/codeaholicguy/ai-devkit/tdd)
Your own site
<a href="https://agentmods.dev/skills/codeaholicguy/ai-devkit/tdd"><img src="https://agentmods.dev/badge/skills/codeaholicguy/ai-devkit/tdd/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/codeaholicguy/ai-devkit/tdd"><img src="https://agentmods.dev/badge/skills/codeaholicguy/ai-devkit/tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 754 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 66
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.1 $0.00036 $0.00754
Opus 5.5 $0.00014 $0.00302
Sonnet 5.5 $0.00007 $0.00151
Haiku 4.5 $0.00004 $0.00075

Measured 1mo ago against content hash 86b44ef491b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tdd 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 1mo ago.

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/tdd/SKILL.md · 67 lines

How it starts

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

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.

Anti-Patterns

Pattern Problem Fix
Test-after Code shapes the test instead of the other way around Delete the code, write the test first
Testing internals Tests break on refactor, not on behavior change Test public behavior only
Giant red step Multiple behaviors in one test One assertion per behavior
Gold-plating green Adding code no test requires Remove untested code
Skipping refactor Tech debt accumulates immediately Refactor before the next red
Mock-heavy tests Tests pass but real code fails Prefer real dependencies, mock at boundaries only

Read the full file on GitHub · 67 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 67 lines · 36 tokens per session scan A 86b44ef491b0

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository codeaholicguy/ai-devkit (1,649 stars, last pushed yesterday), licensed Apache-2.0. It adds 36 tokens to every session and 754 once invoked, about $0.0001 per session on Opus 5.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-08-30.