tdd

tdd is a skill for Claude Code from krzysztofsurdy/code-virtuoso. It costs 69 tokens per session (2,587 once invoked), scanned A, original, MIT.

A test-driven development procedure, usually called TDD, where you write a failing test, add the smallest code that makes it pass, and then clean up the code. The cycle is repeated one test at a time.

In plain words
What is it for?
It is for bug fixes and new behavior in code with tests, including writing a test first and checking each change as it is made.
Why use it?
It makes the intended behavior explicit before production code is written. Seeing the test fail first also shows that the test can detect the missing behavior.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Part of the playbooks-virtuoso plugin — 12 skills shipped together

Good fit It is for bug fixes and new behavior in code with tests, including writing a test first and checking each change as it is made.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/krzysztofsurdy/code-virtuoso/tdd
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 krzysztofsurdy/code-virtuoso --skill tdd
Clone the repo
git clone --depth 1 https://github.com/krzysztofsurdy/code-virtuoso

Made for: Claude Code.

Or install playbooks-virtuoso, the plugin that ships this one along with the rest of its 12 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 tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/tdd/github.svg)](https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/tdd)
Your own site
<a href="https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/tdd"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/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/krzysztofsurdy/code-virtuoso/tdd"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,587 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.
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.00069 $0.02587
Opus 5.5 $0.00028 $0.01035
Sonnet 5.5 $0.00014 $0.00517
Haiku 4.5 $0.00007 $0.00259

Measured 2d ago against content hash 10961e04cdac, 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 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.

skills/playbooks/tdd/SKILL.md · 166 lines

How it starts

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

Test-driven development loop

Write one failing test, make it pass with the least code, clean up while the tests stay green, repeat. The loop is useful for agents for a specific reason: a test that has never failed proves nothing. If you only ever see tests pass, you cannot tell a test that checks the behavior from one that checks nothing. Watching the failure is what makes the later pass meaningful.

Each step produces evidence: command output you can quote. Without it the loop has not been run, only described.

For test strategy, the pyramid, and test-double theory (mocks, stubs, fakes, London versus Chicago school), see the testing skill. This playbook covers the procedure, not those concepts.

Core principles

Principle Meaning
No production code without a failing test first The test defines the behavior; the code only satisfies it
One test at a time Small steps keep the cause of any failure obvious
Show the red Run the test and read the failure. It must fail for the reason you expect
Minimum code to green Write only what the current test needs. More code is untested code
Refactor only on green Cleanup while red hides whether you broke something
Test behavior, not implementation A test should survive a refactor that keeps behavior the same

Step 0: Prepare

  1. Find the project's test command and how to run a single test (check AGENTS.md, CLAUDE.md, the Makefile, package.json, composer.json, CI config). Do not guess.
  2. Run the existing suite once. Record the result. A suite that is already red must be understood before you add to it.
  3. Pick the smallest behavior to start with. If a spec exists with requirement IDs and WHEN/THEN criteria (see spec-driven-development), each criterion is one or more tests.
  4. Find the right seam (see below) and an existing test file in the same area to copy conventions from.

The loop

1. Red: write one failing test

Write a single test for one behavior. Name it after the behavior (rejects_expired_token), not the method. Use arrange, act, assert, with one reason to fail.

Read the full file on GitHub · 166 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 · 166 lines · 69 tokens per session scan A 10961e04cdac

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository krzysztofsurdy/code-virtuoso (36 stars, last pushed yesterday), licensed MIT. It adds 69 tokens to every session and 2,587 once invoked, about $0.0003 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-10-22.

Related

Other skills, from other repositories

triage-issue

Triage a bug or issue by exploring the codebase to find root cause, then create a GitHub issue with a TDD-based fix plan. Use when user reports a bug, wants to file an issue, mentions "triage", or wants to investigate and plan a fix for a problem.

qhuang20/shazam · 65 tokens

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code.

obra/superpowers · 17 tokens

test-driven-development

Drives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality. Use when asked to add tests to a function, fix a bug…

addyosmani/agent-skills · 92 tokens

writing-skills

A guide for creating and testing reusable instructions for AI agents, called skills. It applies test-driven development, or TDD—the practice of writing tests before implementation—to instruction documents.

jnMetaCode/superpowers-zh · 23 tokens

skillshare-implement-feature

Implement a feature from a spec file or description using TDD workflow. Use this skill whenever the user asks to: add a new CLI command, implement a feature from a spec, build new functionality, add a flag, create a new internal package, or write Go code for skillshare. This skill enforces test-first development…

runkids/skillshare · 114 tokens

test-driven-development

Test-driven development, or TDD, is a way to build software by writing a test that fails, adding the smallest code that makes it pass, and then cleaning up the code. These instructions require that process for features, bug fixes, refactors, and behavior changes.

jnMetaCode/superpowers-zh · 20 tokens