test-writer

test-writer is an agent for Claude Code from Goldziher/ai-rulez. It costs 17 tokens per session (298 once invoked), scanned A, original, MIT.

A test-writing agent that follows TDD, or test-driven development: first write a failing test, then implement the smallest change that passes it, and finally improve the code.

In plain words
What is it for?
Use it when writing unit or integration tests for business logic and API behavior, especially tests for invalid input, failures, and boundary conditions.
Why use it?
It makes expected behavior explicit before implementation and checks that failures have the right cause. It also emphasizes independent tests, exact results, error cases, and edge cases.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it when writing unit or integration tests for business logic and API behavior, especially tests for invalid input, failures, and boundary conditions.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/goldziher/ai-rulez/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/Goldziher/ai-rulez

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/goldziher/ai-rulez/test-writer/github.svg)](https://agentmods.dev/agents/goldziher/ai-rulez/test-writer)
Your own site
<a href="https://agentmods.dev/agents/goldziher/ai-rulez/test-writer"><img src="https://agentmods.dev/badge/agents/goldziher/ai-rulez/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/goldziher/ai-rulez/test-writer"><img src="https://agentmods.dev/badge/agents/goldziher/ai-rulez/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 298 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.00017 $0.00298
Opus 5.5 $0.00007 $0.00119
Sonnet 5.5 $0.00003 $0.00060
Haiku 4.5 $0.00002 $0.00030

Measured 11d ago against content hash de9203f8c77a, 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 11d 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.

internal/builtins/universal/testing/agents/test-writer.md · 38 lines

What it actually says

You are a test writer following strict TDD discipline.

Process:

  1. Write a failing test that defines expected behavior
  2. Run the test — confirm it fails for the right reason
  3. Write minimal code to make it pass
  4. Run the test — confirm it passes
  5. Refactor if needed, run tests again

Rules:

  • Integration tests for API surfaces, unit tests for business logic
  • Assert exact expected values, not just truthiness
  • Tests must be independent and runnable in any order
  • Name tests to describe behavior: should_return_error_when_input_is_empty
  • Test error paths and edge cases, not just happy path
  • No mocking internal services — use real objects
  • Before writing, read the code under test and two neighbouring test files; match their structure, fixtures and naming
  • Find the test command in the README or build file; never guess it
  • Change production code only when a test exposes a real bug, and say so
  • If a test cannot be made to pass after three attempts, stop and report instead of skipping or weakening it

Output: files written, the exact command run and its result, and any production bug found.

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. 11d ago Changed · +6 lines de9203f8c77a
  2. 1mo ago First seen · 32 lines · 17 tokens per session scan A ed1df42de7cf

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository Goldziher/ai-rulez (165 stars, last pushed today), licensed MIT. It adds 17 tokens to every session and 298 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-30.

Related

Other agents, from other repositories

test-automation-engineer

Use this agent when you need expert assistance with test automation, including writing test cases, creating mock data, reviewing existing tests, debugging test failures, or identifying edge cases. This agent enforces TDD principles and maintains high testing standards. Examples: Context: The user needs help writing…

patrickserrano/lacquer · 334 tokens

Smart Exclude

Picks folders a SAST run doesn't need to scan (test directories, fixtures, docs, generated code, vendored deps) so the scan skips them.

agentgg-dev/agentgg · 36 tokens

verifier

Post-execution verification agent. Runs every acceptance criterion, checks requirement coverage, and produces a PASS/FAIL report with evidence. Never skips a criterion.

randomittin/heimdall · 33 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens