test-writer

test-writer is an agent for Claude Code from richfrem/agent-plugins-skills. It costs 36 tokens per session (615 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: mentions subagents.

Part of the cli-agents plugin — 14 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 cli-agents, the plugin that ships this one along with the rest of its 14 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 615 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.00615
Opus 5 $0.00018 $0.00308
Sonnet 5 $0.00007 $0.00123
Haiku 4.5 $0.00004 $0.00061

Measured 7d ago against content hash b9435b912f09, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 7d 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/cli-agents/agents/test-writer.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 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 · 73 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. 7d 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 (6 stars, last pushed yesterday), licensed MIT. It adds 36 tokens to every session and 615 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.

Related

Other agents, from other repositories

test-writer

Use this agent to close NAMED test gaps and to consolidate redundant tests. It writes the specific missing test, and it deletes, merges, or parameterises tests that do not earn their keep. Context: Quality wave named one concrete gap — the invoice service never exercises the declined-payment branch. user: "The invoice…

Kanevry/session-orchestrator · 281 tokens

test-engineer

Design and implement test strategy for a change.

heggria/taskflow · 12 tokens

project-quality-gate

Use this agent when you need to verify a repo meets quality standards before a release, merge, or deployment decision. Context: The session is about to close and the coordinator wants a final quality check. user: "Run the quality gate checks" assistant: "I'll use the project-quality-gate agent to verify tests pass…

Kanevry/session-orchestrator · 0 tokens

test-strategist

Create comprehensive test strategies for software projects. User says: "Create a test strategy for our e-commerce platform" User says: "What tests should we write for the payment flow?" User says: "Review our test coverage and suggest improvements".

fattain-naime/engineering-docs · 66 tokens

test-author

Writes focused tests that prove behavior through the public interface, naming what each test proves. Use when adding coverage or writing tests for a bug fix.

emtcmca/promptsmith · 32 tokens

test-engineer

Use this agent when tests need to be written, debugged, or improved. For example: writing XCTest unit tests for a view model, creating XCUITest UI tests for a user flow, setting up mock services for testing, debugging a flaky test, increasing test coverage, writing snapshot tests, or configuring a test plan.

xvirobotics/metaskill · 69 tokens