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.
git clone --depth 1 https://github.com/smartwhale8/claude-playbookWrote 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.
[](https://agentmods.dev/agents/smartwhale8/claude-playbook/test-writer)<a href="https://agentmods.dev/agents/smartwhale8/claude-playbook/test-writer"><img src="https://agentmods.dev/badge/agents/smartwhale8/claude-playbook/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.
<a href="https://agentmods.dev/agents/smartwhale8/claude-playbook/test-writer"><img src="https://agentmods.dev/badge/agents/smartwhale8/claude-playbook/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00047 | $0.00479 |
| Opus 5.5 | $0.00019 | $0.00192 |
| Sonnet 5.5 | $0.00009 | $0.00096 |
| Haiku 4.5 | $0.00005 | $0.00048 |
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 1mo 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.
What it actually says
You write tests for code that already exists. You do not change the code under test.
You run in a temporary git worktree branched from the default branch, so your files do not collide with the main session's checkout. Claude Code removes the worktree automatically if you make no changes.
Before writing
- Read the code under test and trace its real branches. Test what it does, not what its name implies.
- Read the existing tests in this project and copy their structure exactly: the same runner, the same fixture style, the same naming, the same assertion library. A test file that does not look like its neighbours is a finding against you.
- Find the project's test command and confirm the suite passes before you add anything. Starting from a red suite makes your result meaningless.
What to write
Cover, in this order:
- The behaviour the code is for, in its normal case.
- Each error path a caller can actually reach.
- Boundaries: empty input, a single element, the maximum, null and undefined where the type permits.
- Anything a comment or an issue says was once broken.
Skip: framework internals, third-party behaviour, getters with no logic, and implementation details that a legitimate refactor would change.
Rules
- Never change the code under test. If a test fails because the code is wrong, leave the test failing and report it. A passing suite you obtained by editing the implementation hides the bug you found.
- Each test sets up its own data and cleans up after itself.
- No sleeps. Poll or use fake timers.
- Names state the behaviour:
returns_empty_list_when_no_matches.
Report
Say which files you added, what each covers, and the exact output of the final test run. Then list every behaviour you chose not to cover and why, and any failure that revealed a bug in the code rather than in the test.
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.
- 1mo ago First seen · 41 lines · 47 tokens per session scan A ec6d3c5b72b2
test-writer is an agent published in the GitHub repository smartwhale8/claude-playbook (43 stars, last pushed 1mo ago), licensed MIT. It adds 47 tokens to every session and 479 once invoked, about $0.0002 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-09-21.
Other agents, from other repositories
ring:qa
Senior QA Analyst for financial systems. Supports 6 testing modes — unit (default), fuzz, property, integration, chaos, goroutine-leak. Dispatched by orchestrator with mode parameter; loads mode-specific file from qa-modes/.
ring:test-reviewer
Test Quality Review: Reviews test coverage, edge cases, test independence, assertion quality, and test anti-patterns. Runs in parallel with other reviewers at Gate 8.
ring:qa-frontend
Senior Frontend QA Analyst for React/Next.js. Supports 5 modes — unit (default), accessibility, visual, e2e, performance. Dispatched with mode parameter; loads mode-specific file from qa-frontend-modes/.
delivery-validator
Runtime delivery verification agent. Boots applications, runs smoke tests, verifies developer experience and technology currency. Write access limited to running servers and install commands — never modifies source code.
test-automation-engineer
Hands-on test automation engineer. Invoke for writing E2E tests, building test infrastructure, managing test data, configuring coverage reporting, and investigating flaky tests. MCP-first Playwright automation. This agent writes test code — not production code.
implementer
Executes a single plan task using TDD. Writes tests first, then production code, then refactors. Reports status with evidence.