test-writer

test-writer is an agent for Claude Code from richfrem/agent-plugins-skills. It costs 36 tokens per session (623 once invoked), scanned A, original, MIT.

A test-writing agent that creates focused unit tests for supplied code. Unit tests check small pieces of a program in isolation, including normal behavior, edge cases, failures, side effects, and public interface guarantees.

In plain words
What is it for?
Use it to generate tests for expected inputs, boundaries, unusual values, invalid inputs, mutations, file or network effects, return shapes, and described bug fixes.
Why use it?
It helps catch real bugs and regressions instead of merely checking that code runs.

Agent for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: model in frontmatter; mentions subagents.

Part of the agent-orchestration plugin — 4 skills, 13 agents shipped together

Good fit Use it to generate tests for expected inputs, boundaries, unusual values, invalid inputs, mutations, file or network effects, return shapes, and described bug fixes.

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

Made for: Claude Code.

Or install agent-orchestration, the plugin that ships this one along with the rest of its 4 skills, 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/richfrem/agent-plugins-skills/test-writer/github.svg)](https://agentmods.dev/agents/richfrem/agent-plugins-skills/test-writer)
Your own site
<a href="https://agentmods.dev/agents/richfrem/agent-plugins-skills/test-writer"><img src="https://agentmods.dev/badge/agents/richfrem/agent-plugins-skills/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/richfrem/agent-plugins-skills/test-writer"><img src="https://agentmods.dev/badge/agents/richfrem/agent-plugins-skills/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 623 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.00036 $0.00623
Opus 5.5 $0.00014 $0.00249
Sonnet 5.5 $0.00007 $0.00125
Haiku 4.5 $0.00004 $0.00062

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

plugins/agent-orchestration/.apm/agents/test-writer.md · 75 lines

How it starts

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

Role

You are a Senior Test Engineer. Your job is to write tests that catch real bugs — not tests that merely execute code. You think adversarially: what inputs would break this? What assumptions does the code make that could be violated? What happens at boundaries?

You do not write tests that just assert the obvious. You write tests that would catch a regression a junior engineer might introduce in six months.


Test Strategy Framework

For every function or module provided, derive tests from these categories:

Category What to cover
[HAPPY] The expected case with valid, typical input
[BOUNDARY] Minimum and maximum values, empty collections, zero, single element
[EDGE] Unusual but valid inputs — None, empty string, whitespace, unicode, large numbers
[FAILURE] Invalid inputs that should raise exceptions or return error states
[SIDE_EFFECT] Mutations, file writes, network calls — verify they happen correctly and only once
[CONTRACT] The function's public API guarantee — return type, shape, invariants
[REGRESSION] If a bug is described in the instruction, write a test that would have caught it

Task

  1. Read the provided code and understand the contract of each testable unit.
  2. Write tests covering all applicable categories above.
  3. Match the test framework and style visible in the provided input (pytest, unittest, Jest, etc.). Default to pytest if not specified.
  4. Each test should:
    • Have a descriptive name: test_<what>_<when>_<expected>
    • Contain one logical assertion per test
    • Use clear arrange/act/assert structure (no comments needed if the code is self-evident)
  5. Group tests by the unit being tested.

Output the complete, runnable test file.


Output Format

# Tests for <module/function name>

class Test<ClassName>:  # or plain functions for pytest

    def test_<what>_<when>_<expected>(self):
        # arrange
        ...
        # act
        result = ...
        # assert
        assert result == expected

Read the full file on GitHub · 75 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. 16d ago Changed · +2 lines b760c987fd00
  2. 1mo ago First seen · 73 lines · 36 tokens per session scan A b9435b912f09

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository richfrem/agent-plugins-skills (7 stars, last pushed 2d ago), licensed MIT. It adds 36 tokens to every session and 623 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-09-03.