test-driven-development

A development method that writes a failing automated test before changing code, then uses the test to confirm the change works.

In plain words
What is it for?
Adding logic, fixing bugs, changing behavior, handling edge cases, and proving that code works with tests.
Why use it?
It reduces the risk of fixing the wrong problem or breaking existing behavior without noticing.

Skill for Claude CodeCodex

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/codoop/codoop-flow/test-driven-development
Any agent
npx skills add Codoop/codoop-flow --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/Codoop/codoop-flow

Made for: Claude Code, Codex.

Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,501 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 86% copy Near-identical to another mod 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.00050 $0.03501
Opus 5 $0.00025 $0.01750
Sonnet 5 $0.00010 $0.00700
Haiku 4.5 $0.00005 $0.00350

Measured yesterday against content hash 3317e80ddb45, 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.

Origin

This is a copy

86% identical to test-driven-development — 29 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/test-driven-development/SKILL.md · 394 lines

How it starts

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

Test-Driven Development

Conversation Profile

When codoop_flow.toml is available, read user_role; a missing value means general. It applies only to this conversation: use normal professional terms inside the user's field, and explain cross-field topics in plain language. The user may override it for the current conversation by asking for simpler or more professional language. Never apply the profile to code, PRD, Spec, Plan, Todo, reports, agent prompts, or other generated files; those stay precise and professional.

Overview

Write a failing test before writing the code that makes it pass. For bug fixes, reproduce the bug with a test before attempting a fix. Tests are proof — "seems right" is not done. A codebase with good tests is an AI agent's superpower; a codebase without tests is a liability.

When to Use

  • Implementing any new logic or behavior
  • Fixing any bug (the Prove-It Pattern)
  • Modifying existing functionality
  • Adding edge case handling
  • Any change that could break existing behavior

When NOT to use: Pure configuration changes, documentation updates, or static content changes that have no behavioral impact.

Related: For browser-based changes, combine TDD with runtime verification using Chrome DevTools MCP — see the Browser Testing section below.

The TDD Cycle

    RED                GREEN              REFACTOR
 Write a test    Write minimal code    Clean up the
 that fails  ──→  to make it pass  ──→  implementation  ──→  (repeat)
      │                  │                    │
      ▼                  ▼                    ▼
   Test FAILS        Test PASSES         Tests still PASS

Step 1: RED — Write a Failing Test

Write the test first. It must fail. A test that passes immediately proves nothing.

// RED: This test fails because createTask doesn't exist yet
describe('TaskService', () => {
  it('creates a task with title and default status', async () => {
    const task = await taskService.createTask({ title: 'Buy groceries' });

    expect(task.id).toBeDefined();
    expect(task.title).toBe('Buy groceries');
    expect(task.status).toBe('pending');
    expect(task.createdAt).toBeInstanceOf(Date);
  });
});

Read the full file on GitHub · 394 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 · 394 lines · 50 tokens per session scan A 3317e80ddb45

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository Codoop/codoop-flow (5 stars, last pushed 8d ago), licensed MIT. It adds 50 tokens to every session and 3,501 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 86% identical to test-driven-development, differing in 29 lines, and is treated as a copy.

Related

Other skills, from other repositories

build-teaql-app

Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…

teaql/teaql-agent-kit · 112 tokens

chatbot

Use when a support or sales bot on a live website must behave: persona/system prompt, grounding so it cannot invent prices or policy, jailbreak and injection defense, the human handoff, launch metrics and kill switch. NOT the agent loop or RAG index under it (that is building-agents), NOT a human answering one ticket…

ericrisco/rsc-harness · 78 tokens

agent-safety

Use when bounding an LLM agent that already runs — scoping its task domain, gating tools to least privilege, defending against prompt injection in untrusted web/email/RAG text, requiring human approval on irreversible actions, capping runtime and cost, or triaging what it already did. NOT building the loop, tools, or…

ericrisco/rsc-harness · 79 tokens

antidote

Stop AI agents from patching symptoms. Use this skill when coding, reviewing, refactoring, auditing, committing fixes, or adding guards, validation, workarounds, or 20+ lines without deleting code.

Avtr99/antidote · 47 tokens

anti-slop-design

Category-aware design skill that builds distinctive, production-grade UIs. Brand-vs-product register, color strategy commitment, scene-based theme choice, palettes, font pairings, UX patterns, shadcn/token integration, empty-error-loading copy, secondary slop signals, multimodal design parity from mocks, and a…

madebyaris/advance-minimax-m3-cursor-rules · 78 tokens

3d-web-experiences

Build distinctive, performant, production-grade 3D on the web with Three.js, React Three Fiber, and WebGL. Use when the user asks to "build a 3D scene", "add a 3D hero/landing", "make a product viewer/configurator", mentions three.js / react-three-fiber / r3f / drei / webgl / shaders, or asks to make an existing 3D…

madebyaris/advance-minimax-m3-cursor-rules · 147 tokens