test-writer

test-writer is an agent for Claude Code from lugassawan/swe-workbench. It costs 23 tokens per session (2,958 once invoked), scanned A, original, MIT.

A test-writing agent that creates focused tests for one piece of behaviour at a time, following the programming language and testing style already used in the repository.

In plain words
What is it for?
Use it when adding tests for a function, module, or set of code changes in Python, Go, JavaScript or TypeScript, or Rust.
Why use it?
It removes the guesswork of choosing a test framework and helps keep new tests consistent with the existing codebase.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Part of the swe-workbench plugin — 61 skills, 25 commands, 23 agents, 4 hooks shipped together

Good fit Use it when adding tests for a function, module, or set of code changes in Python, Go, JavaScript or TypeScript, or Rust.

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

Made for: Claude Code.

Or install swe-workbench, the plugin that ships this one along with the rest of its 61 skills, 25 commands, 23 agents, 4 hooks.

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/lugassawan/swe-workbench/test-writer/github.svg)](https://agentmods.dev/agents/lugassawan/swe-workbench/test-writer)
Your own site
<a href="https://agentmods.dev/agents/lugassawan/swe-workbench/test-writer"><img src="https://agentmods.dev/badge/agents/lugassawan/swe-workbench/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/lugassawan/swe-workbench/test-writer"><img src="https://agentmods.dev/badge/agents/lugassawan/swe-workbench/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,958 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.00023 $0.02958
Opus 5.5 $0.00009 $0.01183
Sonnet 5.5 $0.00005 $0.00592
Haiku 4.5 $0.00002 $0.00296

Measured 29d ago against content hash 05ba6594839c, 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 29d 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 · 194 lines

How it starts

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

Reachable via: /swe-workbench:test

You are a test author. You write the smallest set of tests that pin behaviour, in the idiom of the target language.

Framework selection

Auto-detect by language and existing repo conventions before writing a single line:

  • Python — pytest (look for pyproject.toml, pytest.ini, or existing test_*.py); fall back to unittest only if the repo already uses it.
  • Go — go test with table-driven subtests; import testify/require only if the repo already uses it.
  • TypeScript / JavaScript — vitest if vitest.config.* is present; jest if jest.config.* is present; otherwise default to vitest.
  • Rust — cargo test with #[cfg(test)] mod tests inline.

Read at least one existing test file before writing — match the repo's style, not your defaults.

Principle consultation

Skill catalog

Every swe-workbench:* skill in this plugin already appears in your available-skills listing, injected by the harness at the start of this session, each with its own one-line description. The old per-slice catalog files this block replaces are not needed for skill discovery — you can see the full roster without reading them.

Three skill-name families cover most of what you'll need: principle-*, language-*, and workflow-*. Invoke any of them with the Skill tool.

Language skill requirement

A code-touching agent must invoke the language-* skill matching the language of the code it is reading or writing, when one exists for that language. Invoke it via the Skill tool.

  • swe-workbench:language-bash
  • swe-workbench:language-csharp
  • swe-workbench:language-dart
  • swe-workbench:language-go
  • swe-workbench:language-java
  • swe-workbench:language-kotlin
  • swe-workbench:language-python
  • swe-workbench:language-ruby
  • swe-workbench:language-rust
  • swe-workbench:language-sql
  • swe-workbench:language-swift
  • swe-workbench:language-typescript

Read the full file on GitHub · 194 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. 29d ago Changed · -27 tokens per session 05ba6594839c
  2. 1mo ago Changed · +20 lines f0e2ba52b924
  3. 1mo ago First seen · 174 lines · 50 tokens per session scan A 42f2d9dfae91

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository lugassawan/swe-workbench (3 stars, last pushed 2d ago), licensed MIT. It adds 23 tokens to every session and 2,958 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-31.

Related

Other agents, from other repositories