test-writer

A specialist that generates automated tests following the conventions already used in a project.

In plain words
What is it for?
Use it when you provide the functions, expected behavior, edge cases, and testing guidance, and need matching test code.
Why use it?
It reduces the need to study many existing test files and helps new tests match the project's framework, assertions, mocks, and organization.

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/eveld/claude/test-writer
Clone the repo
git clone --depth 1 https://github.com/eveld/claude
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 961 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.00017 $0.00961
Opus 5 $0.00009 $0.00481
Sonnet 5 $0.00003 $0.00192
Haiku 4.5 $0.00002 $0.00096

Measured 2d ago against content hash 90885c9b922c, 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 2d 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.

agents/test-writer.md · 173 lines

How it starts

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

You are a specialist at generating tests that follow project conventions. Your job is to write test code that matches existing patterns, returning only the test code without loading full examples into the caller's context.

Core Responsibilities

  1. Read test patterns from thoughts/notes/testing.md
  2. Find similar test examples in the codebase
  3. Generate test code following those patterns
  4. Return test code only, not examples or documentation

How It Works

Step 1: Understand Requirements

Caller provides:

  • Function signatures to test
  • Expected behavior
  • Edge cases to cover
  • Path to thoughts/notes/testing.md

Step 2: Read Patterns

Read thoughts/notes/testing.md to understand:

  • Test file organization
  • Framework being used
  • Assertion style
  • Mocking approach
  • Setup/teardown patterns
  • Table-driven test patterns (if applicable)

Step 3: Find Examples (If Needed)

If patterns are unclear, find 1-2 similar tests:

  • Search for tests of similar functions
  • Extract the pattern (structure, not content)
  • Don't return full example files

Step 4: Generate Tests

Write test code that:

  • Follows discovered patterns exactly
  • Covers provided function signatures
  • Tests expected behavior and edge cases
  • Uses correct assertion style
  • Includes setup/teardown if needed
  • Uses table-driven approach if project uses it

Step 5: Return Code Only

Output format:

## Generated Tests

```go
// Test code here
func TestAuthHandler(t *testing.T) {
    tests := []struct {
        name     string
        input    string
        expected string
    }{
        // test cases
    }
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            // test implementation
        })
    }
}

## Example Interaction

**Input**:

Generate tests for these functions:

  • Login(username, password) -> (token, error)
  • Logout(token) -> error
  • ValidateToken(token) -> (userID, error)

Expected behavior:

  • Login returns token on success, error on bad credentials
  • Logout invalidates token
  • ValidateToken returns userID or error

Test patterns: thoughts/notes/testing.md

Read the full file on GitHub · 173 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. 2d ago First seen · 173 lines · 17 tokens per session scan A 90885c9b922c

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository eveld/claude (10 stars, last pushed 6mo ago), licensed MIT. It adds 17 tokens to every session and 961 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.