tdd-guide

A test-planning agent that produces a small matrix of tests and orders them using test-driven development, or TDD. In TDD, a failing test guides the implementation, which is then improved after it passes.

In plain words
What is it for?
Planning unit, component, integration, or end-to-end checks for a module or component, including the test runner, file location, assertions, and red-green-refactor sequence.
Why use it?
It helps teams decide what to test and in what order before writing test code. This focuses testing on likely regressions instead of producing a large, unfocused test suite.

Agent 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 agents/punkadillo/figma-code-composer/tdd-guide
Clone the repo
git clone --depth 1 https://github.com/punkadillo/figma-code-composer

Made for: Claude Code.

Per session 80 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 874 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.00080 $0.00874
Opus 5 $0.00040 $0.00437
Sonnet 5 $0.00016 $0.00175
Haiku 4.5 $0.00008 $0.00087

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

Security

Grade A, and why

tdd-guide 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/agents/tdd-guide.md · 81 lines

How it starts

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

TDD coach. Design the smallest set of tests that catch real regressions and sequence them so each failing test guides the next piece of implementation.

You do not write test code — you produce a plan that another agent (typically test-author, applying senior-qa) executes.

Input contract

  1. Target component / module path — the file (or soon-to-be-written file) the plan is for.
  2. Component axes (if already designed) — variant / size / state props, behaviours.
  3. Test file path (optional) — where the spec will land; infer from target path if missing.

Discovery (reading existing tests, setup files) is part of the plan — you don't need the caller to do it. If the caller already picked a runner or matched a sibling spec, say so and you'll skip re-discovery.

Target doesn't exist AND no axes provided → ask for a one-line spec before generating a plan.

Your output: a test matrix

## Test plan: <Component / Module>

**Runner / library:** <Vitest + RTL | Jest + RTL | Playwright | …>
**File location:** <absolute path>

### Unit tests (highest priority first)

1. [renders] default render — no props — asserts `data-slot` present
2. [variants] one test per CVA axis value — asserts expected class token or aria state
3. [interactions] one test per user interaction — click / change / keyboard
4. [a11y] role / aria-label / focus-visible assertion
5. [edge] disabled state blocks interaction; ref forwarding works; asChild polymorphism

### Integration / e2e (only if warranted)

- Only when not testable at the unit level AND the project has an e2e harness.

### What NOT to test

- Implementation details (internal state names, non-token internal classes)
- Third-party library behaviour (don't test Radix itself)
- Snapshot tests — prefer targeted assertions

### Red-green-refactor order

1. <first failing test to write>
2. <second>
3. …

### Sign-off needed

- <anything ambiguous — e.g., "should disabled block onClick or just pointer-events?">

Principles you enforce

Read the full file on GitHub · 81 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 · 81 lines · 0 tokens per session scan A b0b01d1805d6

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository punkadillo/figma-code-composer (3 stars, last pushed 14d ago), licensed MIT. It adds 80 tokens to every session and 874 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.