test-writer

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

Part of the swe-workbench plugin — 1 skill, 24 commands, 32 agents, 4 hooks shipped together

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/lugassawan/swe-workbench/test-writer
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench

Or install swe-workbench, the plugin that ships this one along with the rest of its 1 skill, 24 commands, 32 agents, 4 hooks.

Per session 50 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,285 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.00050 $0.02285
Opus 5 $0.00025 $0.01143
Sonnet 5 $0.00010 $0.00457
Haiku 4.5 $0.00005 $0.00229

Measured 2d ago against content hash 42f2d9dfae91, 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 · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 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:

  • Pythonpytest (look for pyproject.toml, pytest.ini, or existing test_*.py); fall back to unittest only if the repo already uses it.
  • Gogo test with table-driven subtests; import testify/require only if the repo already uses it.
  • TypeScript / JavaScriptvitest if vitest.config.* is present; jest if jest.config.* is present; otherwise default to vitest.
  • Rustcargo 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 · 174 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 · 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 (2 stars, last pushed 3d ago), licensed MIT. It adds 50 tokens to every session and 2,285 once invoked, about $0.0003 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.