tdd

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 CodeCodex

Part of the at plugin — 13 skills shipped together

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/patforna/auto-task/tdd
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, Codex.

Or install at, the plugin that ships this one along with the rest of its 13 skills.

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. 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.00072 $0.01278
Opus 5 $0.00036 $0.00639
Sonnet 5 $0.00014 $0.00256
Haiku 4.5 $0.00007 $0.00128

Measured 3d ago against content hash 0bdcd645a273, 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 3d 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. 3d 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 (3 stars, last pushed 14d ago), licensed MIT. It adds 72 tokens to every session and 1,278 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-08-31.

Related

Other skills, from other repositories

test-driven-development

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

obra/superpowers · 17 tokens

absolute-work

End-to-end, phase-gated SDLC for AI coding agents: relentless design interview → reviewed spec → dependency-graphed task board → safe-wave TDD execution → verification → converge. Handles features, bugs, refactors, greenfield projects, planning breakdowns, and migrations. Triggers on "absolute work", "build this…

maddhruv/absolute · 104 tokens

ox-attest-goal

Pursue a customer capability to proven, Attest-backed BDD: author it from the customer's journey, drive the acceptance run to green, then hand to ox-attest-create to mint the honest red/green proof. Use when a user asks to add, improve, prove, or review a BDD/customer capability, or mentions customer flow, acceptance…

sageox/ox · 119 tokens

ox-attest-create

Turn a demonstrated red/green Attest run pair into an honest portable proof. Use when a user asks to attest, prove, stamp, record, publish, or explain a BDD capability's evidence. Inspect ox attest proof and the run artifacts first; use ox attest record only after a real red failure and a green recovery demonstrate…

sageox/ox · 82 tokens

implementer

Write minimal production-quality code to make failing tests pass. This is the GREEN phase of TDD.

MountainUnicorn/add · 19 tokens

tdd-cycle

Execute a complete Test-Driven Development cycle for a feature from the specification through production-quality code.

MountainUnicorn/add · 25 tokens