tdd

tdd is a skill for Claude Code, Codex from marcoemrich/EXACT-Coding-Exercises. It costs 70 tokens per session (2,010 once invoked), scanned A, original, MIT.

A strict Test-Driven Development workflow, where tests are written first, the smallest implementation is added to pass them, and the code is then improved. TDD is a way to build software through repeated test, implementation, and cleanup steps.

In plain words
What is it for?
Use it when explicitly practicing TDD, such as for a coding exercise or feature built from a test list. It guides test planning, failing tests, passing implementations, and refactoring.
Why use it?
It provides a fixed Red-Green-Refactor process and human approval checkpoints, reducing the risk of writing code without a clear test. It also separates implementation from later cleanup work.

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/marcoemrich/exact-coding-exercises/tdd
Any agent
npx skills add marcoemrich/EXACT-Coding-Exercises --skill tdd
Clone the repo
git clone --depth 1 https://github.com/marcoemrich/EXACT-Coding-Exercises

Made for: Claude Code, Codex.

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/marcoemrich/exact-coding-exercises/tdd.svg)](https://agentmods.dev/skills/marcoemrich/exact-coding-exercises/tdd)
Your own site
<a href="https://agentmods.dev/skills/marcoemrich/exact-coding-exercises/tdd"><img src="https://agentmods.dev/badge/skills/marcoemrich/exact-coding-exercises/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,010 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.00070 $0.02010
Opus 5 $0.00035 $0.01005
Sonnet 5 $0.00014 $0.00402
Haiku 4.5 $0.00007 $0.00201

Measured 4d ago against content hash d6cb98238b90, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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/tdd/SKILL.md · 186 lines

How it starts

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

TDD Rules — Hybrid (v6, exact-coding baseline)

⚠️ CRITICAL: Skill + Subagent Usage is MANDATORY

This workflow is a hybrid of v4 and v5:

  • /test-list, /red, /green run as Skills in the main context (like v5) — they share state, so the model keeps test list, last error, and current implementation in working memory.
  • Refactor runs as a Task subagent with isolated context (like v4) — the refactor agent sees only the current source/tests, not the full red/green history. Hypothesis: refactoring benefits most from a fresh perspective free of implementation bias.

Do NOT perform TDD phases without invoking the appropriate skill or agent.

Before Starting Any TDD Work — Complete This Checklist:

  • Have I been asked to implement something using TDD?
  • Am I about to write tests or implementation code?
  • STOP — Use the Skill tool (test-list/red/green) or the Task tool (refactor)
  • NEVER write tests, code, or refactorings directly — ALWAYS delegate

Which Tool to Use:

Phase Mechanism Invoke With
Example Mapping (optional, before TDD) Skill Skill({ skill: "example-mapping" })
Test List Skill (main context) Skill({ skill: "test-list" })
Red Phase Skill (main context) Skill({ skill: "red" })
Green Phase Skill (main context) Skill({ skill: "green" })
Refactor Phase Task subagent (isolated context) Task({ subagent_type: "refactor", prompt: ... })
Final quality pass (optional, manual) Skill Skill({ skill: "end-refactor" })

If you find yourself writing test code, implementation code, or a refactoring without invoking the right tool first, you are doing it WRONG.

Overview

This project follows strict Test-Driven Development practices using the Red-Green-Refactor cycle. v6 keeps red and green in a shared context so the predictions, error messages, and minimal implementations stay coherent — and isolates refactoring so the model evaluates the resulting code on its own merits.

Read the full file on GitHub · 186 lines

Files

What ships with it

3 files 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. 4d ago First seen · 186 lines · 70 tokens per session scan A d6cb98238b90

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository marcoemrich/EXACT-Coding-Exercises (13 stars, last pushed 15d ago), licensed MIT. It adds 70 tokens to every session and 2,010 once invoked, about $0.0003 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-08-30.