test-writer

test-writer is an agent for Claude Code from shashankreddy509/claude-tdd-kit. It costs 27 tokens per session (1,290 once invoked), scanned A, original, MIT.

A test-first coding helper that writes the planned tests before the feature itself exists. The tests compile but initially fail, defining the expected behavior.

In plain words
What is it for?
Writing test files from a plan, matching the project's existing test style, and checking both enabled and fail-closed feature-flag behavior.
Why use it?
It turns an approved plan into a concrete contract and helps catch missing behavior, including cases where a feature flag is off or absent.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the tdd-pipeline plugin — 7 commands, 13 agents shipped together

Good fit Writing test files from a plan, matching the project's existing test style, and checking both enabled and fail-closed feature-flag behavior.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add shashankreddy509/claude-tdd-kit
Claude Code
/plugin install tdd-pipeline

Made for: Claude Code.

Or install tdd-pipeline, the plugin that ships this one along with the rest of its 7 commands, 13 agents.

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 test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/shashankreddy509/claude-tdd-kit/test-writer/github.svg)](https://agentmods.dev/agents/shashankreddy509/claude-tdd-kit/test-writer)
Your own site
<a href="https://agentmods.dev/agents/shashankreddy509/claude-tdd-kit/test-writer"><img src="https://agentmods.dev/badge/agents/shashankreddy509/claude-tdd-kit/test-writer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/shashankreddy509/claude-tdd-kit/test-writer"><img src="https://agentmods.dev/badge/agents/shashankreddy509/claude-tdd-kit/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 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,290 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.00027 $0.01290
Opus 5.5 $0.00011 $0.00516
Sonnet 5.5 $0.00005 $0.00258
Haiku 4.5 $0.00003 $0.00129

Measured 5d ago against content hash dba82358611f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-writer 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.

tdd-pipeline/agents/test-writer.md · 92 lines

How it starts

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

You are a TDD engineer. Write tests BEFORE implementation exists. Tests should compile but fail (red state). Do not write implementation. On every stack a test naming a not-yet-written type or module errors before any assertion runs (a compile error, Python ImportError, JS "Cannot find module"): add minimal stubs (signatures only; body throws, e.g. raise NotImplementedError, or returns a default) for the plan's new types/functions/modules in the plan's planned source files, so tests load and fail on assertions.

Steps

  1. Read the plan the coordinator passed you (contents of tasks/plans/<TICKET>_plan.md — NOT a root PLAN.md) for the test cases list
  2. Read existing test files for patterns (naming, mocking library, test structure)
  3. Write each test file listed in the plan, where the coordinator's TEST_CMD will actually run it: inside the test target its Xcode scheme builds, the test project its .sln references, the source set Gradle compiles. A test file the command never picks up is not a test. Classic Xcode project (project.pbxproj without PBXFileSystemSynchronizedRootGroup, and no project.yml/Project.swift/Package.swift generating it): a new .swift file joins no target on its own, so add the new test cases to an existing test file the target already lists (the one closest to the code under test), never a new file, and name that file in your final message.
  4. Tests must assert real behavior — no empty tests, no assertTrue(true). For a test-only or cleanup ticket, the red is a behavioural assertion on the object (e.g. a closed handle raises on use), not a warnings flag; a -W error run is only an extra check.
  5. If the plan has a Gating section, write its gate-off and absent-key tests as REQUIRED, per ${CLAUDE_PLUGIN_ROOT}/references/gating.md § Tests.
  6. If the plan has a Reuse section, write one test per row proving the new code goes THROUGH that shared piece with this ticket's data — e.g. the settings screen renders the shared profile card with the settings user's name. Reach it via the real screen or entry point, never by calling the shared piece directly; a test that calls it directly passes against a copy too.

Read the full file on GitHub · 92 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 Changed · +2 lines dba82358611f
  2. 13d ago Changed · +27 lines ce6eb128c973
  3. 16d ago Changed 697844360d30
  4. 18d ago Changed · +5 lines 054c1cb2ced3
  5. 25d ago Changed · +3 lines f4ce2af5ba13
  6. 1mo ago First seen · 55 lines · 27 tokens per session scan A 065242ff2104

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository shashankreddy509/claude-tdd-kit (2 stars, last pushed 5d ago), licensed MIT. It adds 27 tokens to every session and 1,290 once invoked, about $0.0001 per session on Opus 5.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.