ad-tdd

A Test-Driven Development workflow for writing code one behavior test at a time: first make the test fail, then write the smallest code that makes it pass, and finally clean up the code.

In plain words
What is it for?
Use it when the requested behavior is clear enough to describe in a test. It guides implementation, incremental testing, and refactoring while the tests remain passing.
Why use it?
It gives an agent a clear check at every step, helping prevent code that is only almost correct. It also keeps tests focused on observable behavior instead of private implementation details.

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/corridortech/posecap/ad-tdd
Any agent
npx skills add CorridorTech/PoseCap --skill ad-tdd
Clone the repo
git clone --depth 1 https://github.com/CorridorTech/PoseCap

Made for: Claude Code, Codex.

Per session 201 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,783 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.00201 $0.01783
Opus 5 $0.00101 $0.00892
Sonnet 5 $0.00040 $0.00357
Haiku 4.5 $0.00020 $0.00178

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

Security

Grade A, and why

ad-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.

.agents/skills/ad-tdd/SKILL.md · 87 lines

How it starts

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

<background_information> Implements WORKFLOW.md §16 end-to-end. The skill is for the implementation phase when the change's behavior is known and expressible as a test up front. No file is written. The output of the skill is the verified implementation that lands in the repo through normal commits.

TDD is a deterministic LLM guardrail: a failing test is unambiguous, so "almost right" (the WORKFLOW §12 failure mode) cannot slip past. The skill keeps the agent inside red-green-refactor and blocks the named anti-pattern (horizontal slicing — bulk-write tests, then bulk-write code).

Good tests read like a specification. "User can checkout with a valid cart" tells you exactly what capability exists. Bad tests couple to implementation — mock internal collaborators, assert on private state, test the shape of things (data structures, function signatures) rather than user-facing behavior. A test that breaks on a rename but not on a behavior change was testing implementation, not behavior.

Distinction from ad-tdg: TDD focuses on driving code through one test at a time (behavior-known regime); TDG picks between three implementation candidates against one ground-truth pair (technique-known, implementation-strategy-uncertain regime). When both apply, use TDD as the outer loop and invoke ad-tdg inside the GREEN phase to pick the implementation strategy for that test cycle.

Codex auto-trigger on description keywords is less mature than Claude Code's. If auto-invocation does not fire when the user mentions TDD, red-green-refactor, test-first, tracer bullet, or behavior-not-implementation, invoke this skill manually. </background_information>

Route elsewhere when:

  • The outcome is known but the implementation strategy has multiple plausible paths → ad-tdg (WORKFLOW §9).
  • The technique itself is uncertain across multiple plausible approaches → ad-spike (WORKFLOW §14).
  • The task is bug investigation, not behavior implementation → ad-diagnose (WORKFLOW §15).
  • No test runner is wired → ad-hooks first to scaffold deterministic gates (WORKFLOW §11). TDD depends on a fast green/red signal.

Step 1 — plan vertically. Before writing a test or a line of code:

  • Read CONTEXT.md if it exists — anchor test names and interface vocabulary in the project's ubiquitous language.
  • Confirm the public interface. What is the smallest surface the caller needs to know? Types, ordering constraints, error modes.
  • Identify deepening opportunities (small interface over deep implementation per WORKFLOW §8). Surface-area-light interfaces are easier to test against and survive refactors.
  • List the behaviors to test, not the implementation steps. Pick the first behavior — the one that proves end-to-end the path works. The rest are deferred until the tracer bullet lands.
  • Test Dependency Map (TDM) for existing code. If the change modifies existing code, list the tests already covering the surface and run them to establish the green baseline. New-code changes skip the TDM and write the first test fresh.
  • Get user approval on the plan. One sentence — "I'll test behavior X first via interface Y, then iterate."

You cannot test everything. Confirm with the user which behaviors matter most; focus on critical paths and complex logic.

Step 2 — tracer bullet. Write ONE test that confirms ONE behavior through the public interface:

  • RED: write the test → run → confirm it fails for the expected reason. The fail reason matters — a test that fails because the function is undefined is different from a test that fails because the assertion is wrong.
  • GREEN: write the minimum code that makes the test pass → run → confirm green.

Do not write a second test until this one is green.

Read the full file on GitHub · 87 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 · 87 lines · 201 tokens per session scan A fc2715cf2650

Subscribe to this mod's changes

ad-tdd is a skill published in the GitHub repository CorridorTech/PoseCap (190 stars, last pushed 10d ago), licensed Apache-2.0. It adds 201 tokens to every session and 1,783 once invoked, about $0.0010 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.