dev-tdd

dev-tdd is a skill for Claude Code from christopherlouet/claude-base. It costs 75 tokens per session (2,708 once invoked), scanned A, original, MIT.

A test-first development guide built around TDD, a method where you write a failing test before writing the code that should pass it.

In plain words
What is it for?
Use it to add features or fix bugs by writing a small failing test, making it pass, and then cleaning up the code.
Why use it?
It defines a repeatable red-green-refactor cycle for checking expected behavior while implementing changes.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

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/christopherlouet/claude-base/dev-tdd
Any agent
npx skills add christopherlouet/claude-base --skill dev-tdd
Clone the repo
git clone --depth 1 https://github.com/christopherlouet/claude-base

Made for: Claude Code.

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 dev-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/christopherlouet/claude-base/dev-tdd.svg)](https://agentmods.dev/skills/christopherlouet/claude-base/dev-tdd)
Your own site
<a href="https://agentmods.dev/skills/christopherlouet/claude-base/dev-tdd"><img src="https://agentmods.dev/badge/skills/christopherlouet/claude-base/dev-tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,708 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.1 $0.00075 $0.02708
Opus 5 $0.00037 $0.01354
Sonnet 5 $0.00015 $0.00542
Haiku 4.5 $0.00007 $0.00271

Measured 2d ago against content hash c1b38e41e76f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

dev-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 2d 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.

.claude/skills/dev-tdd/SKILL.md · 362 lines

How it starts

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

Test-Driven Development (TDD)

Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

If code was written before the test: delete it. Start over with TDD.

  • Don't keep it "as a reference"
  • Don't "adapt" it by writing the tests
  • Don't look at it
  • Delete = delete

Implement from scratch starting from the tests. Period.

TDD Cycle

┌─────────┐     ┌─────────┐     ┌──────────┐
│   RED   │ ──▶ │  GREEN  │ ──▶ │ REFACTOR │
│  Test   │     │  Code   │     │  Clean   │
│  fail   │     │  pass   │     │   up     │
└─────────┘     └─────────┘     └──────────┘
      ▲                              │
      └──────────────────────────────┘

Phase 1: RED - Write a failing test

Write ONE minimal test showing the expected behavior

describe('Module', () => {
  describe('function', () => {
    it('should [behavior] when [condition]', () => {
      // Arrange - Prepare
      // Act - Execute
      // Assert - Verify
    });
  });
});

Good test vs Bad test

Good: Clear name, tests real behavior, one thing only

test('retries failed operations 3 times', async () => {
  let attempts = 0;
  const operation = () => {
    attempts++;
    if (attempts < 3) throw new Error('fail');
    return 'success';
  };

  const result = await retryOperation(operation);

  expect(result).toBe('success');
  expect(attempts).toBe(3);
});

Bad: Vague name, tests the mock instead of the code

test('retry works', async () => {
  const mock = jest.fn()
    .mockRejectedValueOnce(new Error())
    .mockRejectedValueOnce(new Error())
    .mockResolvedValueOnce('success');
  await retryOperation(mock);
  expect(mock).toHaveBeenCalledTimes(3);
});

Verify RED (MANDATORY - never skip)

npm test path/to/test.test.ts

Confirm:

  • The test fails (no syntax error)
  • The failure message is the expected one
  • The failure comes from the missing feature (not a typo)

Test passes immediately? You're testing existing behavior. Fix the test.

Read the full file on GitHub · 362 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. 2d ago First seen · 362 lines · 75 tokens per session scan A c1b38e41e76f

Subscribe to this mod's changes

dev-tdd is a skill published in the GitHub repository christopherlouet/claude-base (5 stars, last pushed yesterday), licensed MIT. It adds 75 tokens to every session and 2,708 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

moai-workflow-tdd

Test-Driven Development workflow specialist using RED-GREEN-REFACTOR cycle for test-first software development. Use when developing new features from scratch or when behavior specification drives implementation.

modu-ai/moai-adk · 42 tokens

implement

Use when an approved plan and task list exist and it is time to turn them into working, tested code — the SDD phase after analyze and before verify. Enforces TDD: a failing test comes before the code that makes it pass, one task at a time, appended to a progress ledger that survives compaction. Delegates test tooling…

ericrisco/rsc-harness · 123 tokens

test-writing

Writes meaningful tests that actually catch bugs.

andreaswasita/copilot-agents-dojo · 11 tokens

test-first-agent-loop

Require builders to run validation, reviewers to demand evidence, and all agents to record failures honestly instead of claiming success without test results.

pillaiharish/opencode-ollama-steroids · 31 tokens

auto

Drive an autonomous execution arc end-to-end — compose brainstorm→spec→/prospect→plan→/prospect→TDD→/retrospect under the Rule 35 posture, decide objectively-validatable forks yourself, and stop only on a load-bearing fork or an ungranted approval. Modes: arc (default), execute (skip ideation), plan (stop at a…

mikeprasad/aria-knowledge · 314 tokens

test-driven-development

Use this skill when developing new features using TDD. It guides through writing failing tests first, then implementing code to pass them.

ApexIQ/skillsmith · 30 tokens