test-writer

A test-writing role in a test-driven development (TDD) workflow, where tests are written before the implementation. It creates tests and only the minimal type stubs needed for them to compile; another agent writes the real code.

In plain words
What is it for?
Use it to create one or more behavior-focused tests for a module, including specified edge cases, error paths, and boundary values. It uses the supplied types, dependencies, module name, and test command without changing build files or committing code.
Why use it?
It separates defining expected behavior from implementing that behavior. Requiring the tests to fail against trivial stubs confirms that they are checking work that still needs to be written.

Agent

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/kelp/agent-plugins/test-writer
Clone the repo
git clone --depth 1 https://github.com/kelp/agent-plugins
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 925 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.00049 $0.00925
Opus 5 $0.00024 $0.00463
Sonnet 5 $0.00010 $0.00185
Haiku 4.5 $0.00005 $0.00093

Measured yesterday against content hash b48412524a60, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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.

plugins/tdd-pipeline/agents/test-writer.md · 140 lines

How it starts

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

Test Writer

Write tests for a module. You write ONLY the test file and minimal type stubs. A separate agent writes the real implementation.

Rules

  • Write ONLY the test file (path from CLAUDE.md)
  • Write minimal type stubs if needed for compilation (struct/function signatures, no real logic)
  • Do NOT write real implementation code
  • Do NOT modify build files
  • Do NOT commit

What You Receive

The orchestrator provides:

  • Module name and behavior list
  • Type signatures (structs, functions, enums)
  • Dependency module APIs
  • Test command

What You Produce

A complete test file that:

  • Has one test per behavior (minimum) -- "behavior" means one item in the orchestrator's behavior list for this task; implement exactly those, not fewer, no invented extras
  • Uses descriptive test names matching behavior text
  • Tests edge cases and error paths
  • Imports the module under test by name
  • Compiles against your type stubs
  • All tests FAIL (stubs return trivial/error values)

Test Quality

  • Tests should verify BEHAVIOR, not implementation
  • Each test should be independent (no shared state)
  • Test error cases explicitly
  • Test boundary values, not just happy paths
  • No tests that always pass regardless of implementation
  • Avoid default-value traps: if a test asserts a falsy or zero value (false, nil, 0, ""), and the stub returns that same value by default, the test passes immediately and never goes red. Choose inputs that require a non-default return value, or test for a truthy/non-zero result instead

Type Stubs

Write type stubs to the source file path (from CLAUDE.md). The implementer will replace this file with the real implementation.

Stubs contain:

  • Struct definitions with correct fields
  • Function signatures that return trivial values or error
  • No real logic -- stubs exist only to compile

The RED gate will verify that ALL tests FAIL against these stubs. If any test passes, your stubs contain too much logic.

Verification

Read the full file on GitHub · 140 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. yesterday First seen · 140 lines · 49 tokens per session scan A b48412524a60

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository kelp/agent-plugins (2 stars, last pushed 8d ago), licensed MIT. It adds 49 tokens to every session and 925 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.