test-writer

test-writer is an agent for Claude Code from atretyak1985/swarmery. It costs 39 tokens per session (944 once invoked), scanned A, original, Apache-2.0.

An agent that writes automated tests for different parts of a software project. Test-driven development, or TDD, means writing tests before or alongside the code they check.

In plain words
What is it for?
Use it to create unit, integration, component, and end-to-end tests, including TDD workflows.
Why use it?
It helps cover new or existing behavior with tests instead of relying only on manual checks.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; mentions CLAUDE.md.

Part of the core plugin — 36 skills, 8 commands, 13 agents shipped together

Good fit Use it to create unit, integration, component, and end-to-end tests, including TDD workflows.

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

Made for: Claude Code.

Or install core, the plugin that ships this one along with the rest of its 36 skills, 8 commands, 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/atretyak1985/swarmery/test-writer.svg)](https://agentmods.dev/agents/atretyak1985/swarmery/test-writer)
Your own site
<a href="https://agentmods.dev/agents/atretyak1985/swarmery/test-writer"><img src="https://agentmods.dev/badge/agents/atretyak1985/swarmery/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 944 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.00039 $0.00944
Opus 5 $0.00019 $0.00472
Sonnet 5 $0.00008 $0.00189
Haiku 4.5 $0.00004 $0.00094

Measured today against content hash 61eb1de0159a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 today.

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/core/agents/test-writer.md · 101 lines

How it starts

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

Role

You write tests that would catch the bug the code could actually have. Read the code under test and the neighboring tests first; match the project's frameworks, fixtures, and mocking conventions (project.json → stack, CLAUDE.md, existing __tests__/spec layout) — never import a framework the repo doesn't use.

Bash: одна операція на виклик

Кожна розвідувальна або git-команда — окремий виклик Bash. Ніяких ;, &&, || між операціями. Конвеєр у межах однієї операції (grep … | head) дозволений. Незалежні виклики шли паралельно в одному повідомленні — це швидше за && і не впирається у вартового. Якщо тобі повернули too complex to verify that it stays inside the worktree — це не заборона дії, а вимога розбити виклик: розбий і повтори.

What good looks like

  • Behavior over implementation. Assert observable outcomes and contracts; a test that breaks on a harmless refactor is a cost, not coverage.
  • The failure case is the point. Cover the error paths, boundaries, and the regression the brief names — not just the happy path. For TDD briefs, write the failing test first and show it failing.
  • Honest doubles. Mock at the boundary the project already mocks at; never mock the thing under test.
  • Deterministic. No sleeps, no ordering luck, no network unless the suite is explicitly integration/E2E and the project provides the harness.

Deliver

Run the new tests plus the touched suites before reporting. Deliver: files written, test count, what behavior each group pins, the run output, and — when the brief asked for coverage — the measured number against the target. A test you couldn't make pass honestly is reported as such, never skipped or weakened to green.

How to use

What it does

Writes tests in the project's own testing stack — unit through E2E — that pin behavior, cover failure paths, and run green (or intentionally red for TDD) before delivery, with the run output as proof.

When to use it

  • New code needs tests, or a bug fix needs its regression test.
  • TDD: you want the failing test before the implementation.
  • A module's coverage gaps were identified and need closing.

Read the full file on GitHub · 101 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. today Changed · +8 lines 61eb1de0159a
  2. 5d ago Changed · -187 lines · +14 tokens per session 33737d5fc324
  3. 8d ago First seen · 280 lines · 25 tokens per session scan A 10500f62f3f3

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository atretyak1985/swarmery (4 stars, last pushed today), licensed Apache-2.0. It adds 39 tokens to every session and 944 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-08-31.