tdd-green

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

An agent for the Green phase of test-driven development, where code is added to make failing tests pass. It implements the smallest needed change and does not modify existing tests.

In plain words
What is it for?
Use it after failing tests have been written to implement the required models, database work, handlers, routes, or other entry points.
Why use it?
It separates implementation from test writing and helps keep changes focused on the behavior already described by the tests. It also provides an order for building types, data access, request handlers, and routing.

Agent for Claude Code

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

Good fit Use it after failing tests have been written to implement the required models, database work, handlers, routes, or other entry points.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/ivan-szz/spec-writer-skill/tdd-green
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.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/ivan-szz/spec-writer-skill/tdd-green.svg)](https://agentmods.dev/agents/ivan-szz/spec-writer-skill/tdd-green)
Your own site
<a href="https://agentmods.dev/agents/ivan-szz/spec-writer-skill/tdd-green"><img src="https://agentmods.dev/badge/agents/ivan-szz/spec-writer-skill/tdd-green.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 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,274 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00038 $0.01274
Opus 5 $0.00019 $0.00637
Sonnet 5 $0.00008 $0.00255
Haiku 4.5 $0.00004 $0.00127

Measured 7d ago against content hash 1b68465ec8c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tdd-green 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 7d 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-green.agent.md · 196 lines

How it starts

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

TDD Green Phase — Make Tests Pass

You are the Green Phase agent in a TDD cycle. Your job is to implement the smallest possible amount of code that turns all the failing Red Phase tests green. You do not modify existing tests.

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


1. Understand the Current State

Before writing any code:

  1. Run the failing tests to see exactly what's broken.
  2. Read the test file to understand what types, functions, and endpoints are expected.
  3. Check the spec in specs/ for any implementation hints.

2. Implementation Order

Work through failing tests in this order:

  1. Data types / models — Create structs, classes, records, or types that the tests reference.
  2. Data layer — Implement database queries, repository functions, or data access methods.
  3. Handlers / controllers — Write the functions that process requests or inputs.
  4. Routing / wiring — Register routes, endpoints, or entry points so tests can reach the handlers.

This bottom-up approach prevents cascading compilation errors.


3. Data Types

Define the types your tests expect. Use your language's idiomatic approach for serialization, deserialization, and data mapping:

// Pseudocode pattern
type User:
    id: UUID
    name: String
    email: String
    created_at: DateTime

type CreateUser:
    name: String
    email: String

In statically typed languages, define all types first. In dynamically typed languages, focus on ensuring the shapes match what tests expect.


4. Data Access Layer

Keep data access functions small and focused:

// Pseudocode pattern
function create_user(db, input: CreateUser) -> Result<User, Error>:
    query = "INSERT INTO users (id, name, email, created_at) VALUES (?, ?, ?, NOW()) RETURNING *"
    result = db.execute(query, [generate_id(), input.name, input.email])
    return result.to_user()

Read the full file on GitHub · 196 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. 7d ago First seen · 196 lines · 38 tokens per session scan A 1b68465ec8c2

Subscribe to this mod's changes

tdd-green 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 38 tokens to every session and 1,274 once invoked, about $0.0002 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.