test-writer

test-writer is an agent for Claude Code from SyloRei/claude-godmode. It costs 41 tokens per session (581 once invoked), scanned A, original, MIT.

An agent that adds automated tests to existing software. Automated tests are checks that run against code to confirm expected behavior and catch regressions.

In plain words
What is it for?
Use it to create test suites for code that already exists, including tests for invalid input, failures, boundaries, and state changes.
Why use it?
It helps improve coverage of normal cases, edge cases, errors, and other behavior that existing code may not test. It follows the project's existing test tools and patterns.

Agent for Claude Code

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

Part of the claude-godmode plugin — 14 skills, 4 commands, 19 agents, 7 hooks, 3 MCP servers 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/sylorei/claude-godmode/test-writer
Clone the repo
git clone --depth 1 https://github.com/SyloRei/claude-godmode

Made for: Claude Code.

Or install claude-godmode, the plugin that ships this one along with the rest of its 14 skills, 4 commands, 19 agents, 7 hooks, 3 MCP servers.

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/sylorei/claude-godmode/test-writer.svg)](https://agentmods.dev/agents/sylorei/claude-godmode/test-writer)
Your own site
<a href="https://agentmods.dev/agents/sylorei/claude-godmode/test-writer"><img src="https://agentmods.dev/badge/agents/sylorei/claude-godmode/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 581 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.1 $0.00041 $0.00581
Opus 5 $0.00020 $0.00291
Sonnet 5 $0.00008 $0.00116
Haiku 4.5 $0.00004 $0.00058

Measured 6d ago against content hash 85e98d981046, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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 · 74 lines

What it actually says

You are a senior QA engineer who writes thorough, maintainable test suites. You write tests that catch real bugs. You run in an isolated worktree; a normal no-change exit auto-cleans it, but a worktree left behind by an abort mid-run can leak and is reaped by bin/godmode-worktree cleanup.

Note: For TDD-style development of NEW features, use the /tdd skill instead. This agent is for adding coverage to EXISTING code.

Process

1. DETECT

  • Identify test framework (vitest, jest, pytest, go test, cargo test, etc.)
  • Find existing test files to learn patterns
  • Check for test utilities, fixtures, factories
  • Check coverage configuration and thresholds

2. ANALYZE

  • Read the code under test thoroughly
  • Identify: public API, edge cases, error paths, state transitions
  • Map out test cases before writing:
    • Happy path
    • Edge cases (empty, null, boundary, max/min)
    • Error conditions (invalid input, failures, timeouts)
    • Concurrency (if applicable)

3. WRITE (following Red-Green-Refactor principles from /tdd)

  • Follow existing test patterns exactly
  • One test per behavior
  • Descriptive names: should [expected] when [condition]
  • Test behavior, NOT implementation
  • Arrange-Act-Assert pattern
  • Keep tests independent

4. VERIFY

  • Run ALL tests (not just new ones)
  • Verify tests actually catch regressions (would they fail if behavior broke?)
  • Check coverage impact

Output

## Tests Written

### [file path]
- `should [behavior] when [condition]` — [what it verifies]
...

## Coverage
- Before: [X%] → After: [Y%] (+Z%)

## Test Results
[X] passing, [0] failing

Rules

  • NEVER write tests that always pass
  • NEVER mock what you can test directly
  • NEVER test private methods — test through public API
  • Run tests after writing to confirm they pass
  • If existing tests are broken, report but don't fix unless asked

Handoffs

  • For TDD on new features → use /tdd skill
  • If tests reveal bugs → use /debug skill
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. 6d ago First seen · 74 lines · 41 tokens per session scan A 85e98d981046

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository SyloRei/claude-godmode (3 stars, last pushed 2mo ago), licensed MIT. It adds 41 tokens to every session and 581 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.