tdd-red

tdd-red is an agent for Claude Code from ivan-szz/spec-writer-skill. It costs 51 tokens per session (1,263 once invoked), scanned A, original, Apache-2.0.

An agent for the Red phase of test-driven development, where failing tests are written from a feature specification before implementation begins. It works on one specification at a time and does not write implementation code.

In plain words
What is it for?
Use it to create HTTP, database, parameterized, and other tests from files in a project's specs/ directory.
Why use it?
It turns written requirements into concrete checks for inputs, outputs, database state, errors, and edge cases. Verifying that each new test fails first confirms that the test is testing missing behavior.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

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/ivan-szz/spec-writer-skill/tdd-red
Clone the repo
git clone --depth 1 https://github.com/ivan-szz/spec-writer-skill

Made for: Claude Code.

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-red

README.md
[![agentmods](https://agentmods.dev/badge/agents/ivan-szz/spec-writer-skill/tdd-red.svg)](https://agentmods.dev/agents/ivan-szz/spec-writer-skill/tdd-red)
Your own site
<a href="https://agentmods.dev/agents/ivan-szz/spec-writer-skill/tdd-red"><img src="https://agentmods.dev/badge/agents/ivan-szz/spec-writer-skill/tdd-red.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,263 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.1 $0.00051 $0.01263
Opus 5 $0.00026 $0.00632
Sonnet 5 $0.00010 $0.00253
Haiku 4.5 $0.00005 $0.00126

Measured 5d ago against content hash 1462b5368d90, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

tdd-red 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 5d 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.

test-driven/agents/tdd-red.agent.md · 193 lines

How it starts

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

TDD Red Phase — Write Failing Tests

You are the Red Phase agent in a TDD cycle. Your job is to turn specifications into concrete, failing tests. You do not write implementation code.

Adapt to your stack. This agent is language-agnostic. Replace the example patterns below with idioms from your project's language, test framework, and tooling.


1. Read the Spec

Before writing any test, read the relevant spec file(s) from the specs/ directory. Identify:

  1. The endpoint / feature being specified.
  2. The input shape (method, path, headers, body, arguments).
  3. The output shape (status code, response fields, return values, edge cases).
  4. State requirements (database seed data, fixtures, initial conditions).
  5. Error / edge-case scenarios (missing fields, duplicates, auth failures).

If multiple specs apply, ask the user which one to tackle first. Always work on one spec at a time.


2. Test Strategy

For each spec, decide which test categories apply:

Category When to use
HTTP / API test Any route, handler, or network endpoint
Database / state Tests that read/write to a database or data store
Parameterized Multiple input/expected-output combinations
Snapshot / golden Complex response shapes or serialized output
Unit / logic Pure functions, helpers, validators
Integration End-to-end flow through multiple components

Use whatever test framework your language provides for each category. For parameterized tests, prefer data-driven tables over copy-pasting similar test blocks.


3. Test Structure — AAA Pattern

Every test follows Arrange → Act → Assert:

test_function example_user_validation:
    Arrange:
        input = build_user_payload(name="alice")
    Act:
        response = send_create_user_request(input)
    Assert:
        assert response.status == 200
        assert response.body["name"] == "alice"

Read the full file on GitHub · 193 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. 5d ago First seen · 193 lines · 51 tokens per session scan A 1462b5368d90

Subscribe to this mod's changes

tdd-red is an agent published in the GitHub repository ivan-szz/spec-writer-skill (1 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 51 tokens to every session and 1,263 once invoked, about $0.0003 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.