test-writer

test-writer is an agent for Claude Code from shashankreddy509/claude-tdd-kit. It costs 27 tokens per session (625 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: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the tdd-pipeline plugin — 6 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 with agentmods
npx agentmods add agents/shashankreddy509/claude-tdd-kit/test-writer
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/shashankreddy509/claude-tdd-kit

Made for: Claude Code.

Or install tdd-pipeline, the plugin that ships this one along with the rest of its 6 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.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.svg" alt="Measured on agentmods" 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 625 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.00625
Opus 5 $0.00014 $0.00313
Sonnet 5 $0.00005 $0.00125
Haiku 4.5 $0.00003 $0.00063

Measured 8d ago against content hash 065242ff2104, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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 · 55 lines

How it starts

The opening of the file, as written. The whole thing — 55 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.

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
  4. Tests must assert real behavior — no empty tests, no assertTrue(true)
  5. If the plan has a Gating section, its gate-off cases are REQUIRED tests, not optional ones — server side: flag off ⇒ the documented 404 / omitted field; client side: flag off ⇒ the surface is not rendered. Also cover the absent-key case: a missing flag entry must behave as OFF (fail closed). An untested off-path is discovered during the incident it was built for. Both sides fail closed, so absent reads as OFF and only an affirmative true renders the surface.

Stack Rules — apply ONLY the section matching the project

Detect the stack from the repo (build files, existing tests) and follow the matching section. In every stack, MIRROR the existing suite's framework and conventions — never introduce a new test framework into a project.

Android / Kotlin

  • Use JUnit4 + MockK for unit tests
  • Use kotlinx-coroutines-test for suspend functions
  • Use @get:Rule val mainDispatcherRule = MainDispatcherRule()
  • ViewModels: test StateFlow emissions with Turbine
  • Never use Thread.sleep() — use advanceUntilIdle()

Python

  • Use the project's existing runner (default pytest); plain functions + fixtures unless the suite uses classes
  • Mock with unittest.mock / monkeypatch, patching at the import site actually used
  • Async code: pytest-asyncio or the suite's existing pattern — never time.sleep() in tests
  • Time/randomness: freeze or inject; no wall-clock assertions

JavaScript / TypeScript

  • Use the project's existing runner (jest/vitest/mocha) and assertion style
  • Async: always await; no floating promises in tests
  • Timers/network: fake timers and request mocks — never real waits or live calls

Read the full file on GitHub · 55 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. 8d 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 15d ago), licensed MIT. It adds 27 tokens to every session and 625 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-31.