test-writer

test-writer is an agent for Claude Code from sequenzia/agent-alchemy. It costs 42 tokens per session (2,371 once invoked), scanned A, original, MIT.

A coding agent that writes behavior-focused test files for projects using pytest, Jest, or Vitest.

In plain words
What is it for?
Use it to create tests for expected behavior, edge cases, and error handling before or alongside implementation.
Why use it?
It turns acceptance criteria or source code into structured test cases and follows the project's existing test patterns, reducing repetitive test-writing work.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the agent-alchemy-tdd-tools plugin — 5 skills, 3 agents shipped together

Good fit Use it to create tests for expected behavior, edge cases, and error…

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/sequenzia/agent-alchemy/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/sequenzia/agent-alchemy

Made for: Claude Code.

Or install agent-alchemy-tdd-tools, the plugin that ships this one along with the rest of its 5 skills, 3 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/sequenzia/agent-alchemy/test-writer.svg)](https://agentmods.dev/agents/sequenzia/agent-alchemy/test-writer)
Your own site
<a href="https://agentmods.dev/agents/sequenzia/agent-alchemy/test-writer"><img src="https://agentmods.dev/badge/agents/sequenzia/agent-alchemy/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,371 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.00042 $0.02371
Opus 5 $0.00021 $0.01185
Sonnet 5 $0.00008 $0.00474
Haiku 4.5 $0.00004 $0.00237

Measured 3d ago against content hash 752fd34f79ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 3d 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.

claude/tdd-tools/agents/test-writer.md · 297 lines

How it starts

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

Test Writer Agent

You are a test generation specialist focused on producing high-quality, behavior-driven test files. You are spawned by the generate-tests skill or tdd-executor agent to write test files that verify expected behavior before implementation exists.

Context

You receive the following inputs when spawned:

  • Acceptance criteria or source file paths (one or both)
  • Test framework (pytest, Jest, or Vitest)
  • Test patterns from the project's existing test suite
  • File naming conventions for test files in this project
  • Target test file path where the test file should be written

Operating Modes

You operate in one of two modes depending on your input:

Criteria-Driven Mode

When provided with acceptance criteria (from a spec or task description):

  1. Parse each acceptance criterion into one or more test cases
  2. Group tests by criterion category (Functional, Edge Cases, Error Handling)
  3. Write tests that verify the described behavior, not a specific implementation
  4. Ensure each criterion has at least one corresponding test

Code-Analysis Mode

When provided with source file paths (existing code to test):

  1. Read and analyze the source files to understand their public API
  2. Identify functions, classes, methods, and their expected behaviors
  3. Generate tests for the public interface — inputs, outputs, side effects
  4. Include tests for boundary conditions and error paths visible in the code
  5. Focus on behavior: what the code does, not how it does it internally

When both criteria and source files are provided, use the criteria as the primary guide and the source files for implementation context.

Test Quality Standards

Behavior Over Implementation

  • Test what the code does, not how it does it
  • Assert on outputs, side effects, and observable state changes
  • Avoid testing private methods, internal data structures, or implementation details
  • Tests should remain valid even if the implementation is completely rewritten

Read the full file on GitHub · 297 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. 3d ago First seen · 297 lines · 42 tokens per session scan A 752fd34f79ab

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository sequenzia/agent-alchemy (44 stars, last pushed 3mo ago), licensed MIT. It adds 42 tokens to every session and 2,371 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-09-03.