plan-tdd

A command that turns a feature description into a detailed task list using test-driven development (TDD), where tests are written before the code. It splits work into small, independently demonstrable steps and records task dependencies.

In plain words
What is it for?
Use it to plan features from a specification, brainstorming document, or codebase exploration. It helps organize tests, implementation, and integration work into a dependency-aware checklist.
Why use it?
It removes the need to work out the full implementation sequence by hand. The small steps and test-first order make long coding sessions easier to track.

Command for Claude Code

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 commands/pproenca/agent-tui/plan-tdd
Clone the repo
git clone --depth 1 https://github.com/pproenca/agent-tui

Made for: Claude Code.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,788 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.00013 $0.02788
Opus 5 $0.00006 $0.01394
Sonnet 5 $0.00003 $0.00558
Haiku 4.5 $0.00001 $0.00279

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

Security

Grade A, and why

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

.claude/commands/plan-tdd.md · 363 lines

How it starts

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

TDD Task Planning Command

Create an extensive, detailed task list using TDD methodology with carpaccio-style slicing. This command is designed for long coding sessions where comprehensive tracking is essential.

Artifact Chain

This command is part of the brainstorm → spec → plan pipeline:

.claude/specs/<feature-name>/
├── brainstorm.md    ← From /brainstorm (optional)
├── spec.md          ← From /spec (recommended input)
└── plan-summary.md  ← Output: task plan summary

Input Priority:

  1. If .claude/specs/<feature-name>/spec.md exists → use it as primary input
  2. If .claude/specs/<feature-name>/brainstorm.md exists → use it (less structured)
  3. If neither exists → gather requirements interactively or explore codebase

Core Principles

1. Carpaccio Slicing

Every task must be:

  • Atomic: Completable in a single focused action (< 30 min of work)
  • Demonstrable: Has visible, verifiable output
  • Valuable: Delivers a small increment of functionality
  • Vertical: Touches all necessary layers (test → impl → integration)

2. TDD Workflow (Red-Green-Refactor)

For every feature, create this task chain:

  1. RED - Write failing test(s) first
  2. GREEN - Implement minimal code to pass
  3. REFACTOR - Clean up while keeping tests green

3. Dependency Chains

Use addBlockedBy to enforce:

  • Test tasks block their implementation tasks
  • Implementation tasks block refactor tasks
  • Earlier phases block later phases

Execution Flow

Step 1: Load Context from Artifact Chain

Extract feature name from argument: $ARGUMENTS

Check for existing artifacts in order:

1. .claude/specs/<feature-name>/spec.md      → Full specification (best)
2. .claude/specs/<feature-name>/brainstorm.md → Raw ideas (usable)
3. Neither exists                             → Interactive mode

If spec.md exists:

  • Read the entire specification
  • Extract: success criteria, scope, architecture decisions, interfaces, testing strategy
  • Use these directly to inform task creation
  • Skip most interactive questions (spec has answers)

Read the full file on GitHub · 363 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. 2d ago First seen · 363 lines · 13 tokens per session scan A 8ef72512a7f7

Subscribe to this mod's changes

plan-tdd is a command published in the GitHub repository pproenca/agent-tui (113 stars, last pushed 3d ago), licensed MIT. It adds 13 tokens to every session and 2,788 once invoked, about $0.0001 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.