tdd

tdd is a skill for Claude Code from patforna/auto-task. It costs 72 tokens per session (1,278 once invoked), scanned A, original, MIT.

A strict test-driven development workflow, meaning you write an automated test before the code it checks, then make the test pass and clean up the result.

In plain words
What is it for?
Use it when adding features, writing new code, or fixing bugs. Follow the red, green, refactor cycle: create a failing test, make it pass, then remove duplication.
Why use it?
It prevents untested code from being added and gives each change a small, verifiable target.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the at plugin — 13 skills shipped together

Good fit Use it when adding features, writing new code, or fixing bugs. Follow the red, green, refactor cycle: create a failing test, make it pass, then remove duplication.

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

Made for: Claude Code.

Or install at, the plugin that ships this one along with the rest of its 13 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/patforna/auto-task/tdd/github.svg)](https://agentmods.dev/skills/patforna/auto-task/tdd)
Your own site
<a href="https://agentmods.dev/skills/patforna/auto-task/tdd"><img src="https://agentmods.dev/badge/skills/patforna/auto-task/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/patforna/auto-task/tdd"><img src="https://agentmods.dev/badge/skills/patforna/auto-task/tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,278 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.00072 $0.01278
Opus 5.5 $0.00029 $0.00511
Sonnet 5.5 $0.00014 $0.00256
Haiku 4.5 $0.00007 $0.00128

Measured 1mo ago against content hash 0bdcd645a273, 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 · 123 lines

How it starts

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

TDD — Test-Driven Development

You write code using strict test-driven development. Follow these rules exactly.

The Two Rules

  1. Write new code only when an automated test has failed.
  2. Eliminate duplication.

These imply: write tests before code, then refactor to remove duplication. Design emerges from this process.

The Cycle: Red → Green → Refactor

  1. Red: Write a small test that fails (or doesn't compile). Run it. Confirm it fails.
  2. Green: Make it pass using the simplest possible change. Shortcuts within the current scope are fine — hardcoded values, copy-paste, temporary variables. The only goal is green.
  3. Refactor: Remove duplication introduced by getting to green. This includes duplication between test and production code (e.g., a constant in both).

Run the relevant test(s) after every Red and Green step — not the full suite. Commit at green. Refactor at green. Never refactor while red.

Choosing Tests

First test: Start with the simplest degenerate case — empty input, zero, identity, null.

Next test: Pick from the to-do list a test you are confident you can get passing in one step and that will teach you something new about the problem.

Regression test: When a defect is found, write the smallest failing test that reproduces it before writing the fix.

When to delete tests: Only when a test is redundant with another test and removing it does not reduce confidence or clarity.

The to-Do List

Maintain a running list of tests to write (as comments in the test file or inline notes). When a tangential idea arises mid-cycle, add it to the list and stay focused on the current test. Cross off items as done. Add new items as discovered.

Three Strategies to Get to Green

Choose based on confidence:

Strategy When How
Fake It Uncertain or complex Return a constant. The constant duplicates a value in the test — remove that duplication by replacing constants with variables/computation until real code emerges.
Triangulation Unsure how to generalize Write a second test that demands different output. Generalize only when 2+ examples force it.
Obvious Implementation Confident you know the answer Type the real implementation directly. If you get an unexpected red, back up to Fake It.

Read the full file on GitHub · 123 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. 1mo ago First seen · 123 lines · 72 tokens per session scan A 0bdcd645a273

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository patforna/auto-task (10 stars, last pushed 1mo ago), licensed MIT. It adds 72 tokens to every session and 1,278 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-08-31.

Related

Other skills, from other repositories

workflow-patterns

Use this skill when implementing tasks according to Conductor's TDD workflow, handling phase checkpoints, managing git commits for tasks, or understanding the verification protocol.

wshobson/agents · 35 tokens

tdd

Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.

michael-denyer/pstack-claude · 52 tokens

principle-test-behavior-not-implementation

Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change.

michael-denyer/pstack-claude · 50 tokens

test-driven-development

Use when implementing any feature or bugfix, in any language or framework, before writing implementation code — write the test first, watch it fail, then write minimal code to pass. Covers the red-green-refactor loop, test-quality principles, rationalization counters, and test-layer selection.

endorphin-ai/hasbrains-agent-kit · 61 tokens

blueprint

Converts an approved spec into a TDD task plan with a parallelism map (PARALLEL vs SEQUENTIAL), saved to .workspace/shared/plans/. Use after a spec is approved, before implementation.

Alexander-Tyagunov/magician · 45 tokens

ward

TDD engine and enforcer — red/green/refactor, one behavior at a time. Use while implementing any feature or bugfix, or to execute a specific blueprint task with TDD.

Alexander-Tyagunov/magician · 41 tokens