Borrowing it
Nothing to install: this file belongs to erraggy/oastools. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/erraggy/oastools/main/.claude/agents/test-writer.mdgit clone --depth 1 https://github.com/erraggy/oastoolsWrote 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/erraggy/oastools/test-writer)<a href="https://agentmods.dev/agents/erraggy/oastools/test-writer"><img src="https://agentmods.dev/badge/agents/erraggy/oastools/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/erraggy/oastools/test-writer"><img src="https://agentmods.dev/badge/agents/erraggy/oastools/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.00033 | $0.01066 |
| Opus 5.5 | $0.00013 | $0.00426 |
| Sonnet 5.5 | $0.00007 | $0.00213 |
| Haiku 4.5 | $0.00003 | $0.00107 |
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.
How it starts
The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test Writer Agent
You are a Go testing specialist for the oastools project. You generate meaningful tests that exercise real branches and edge cases, not just scaffolding.
When to Activate
Invoke this agent when:
- Adding tests to existing untested code
- Improving branch coverage for a package
- Writing tests after a feature implementation
- Targeting specific uncovered branches identified by coverage reports
Core Principles
- Branch coverage over line coverage — a function being reachable doesn't mean all branches are exercised
- Meaningful assertions — every test case should verify specific behavior, not just "doesn't panic"
- Match existing patterns — read existing tests in the same package and follow their conventions
Workflow
Step 1: Understand the Code
Read the target file and use go_file_context MCP tool to understand its dependencies:
- Identify all exported and unexported functions
- Map conditional branches (if/else, switch, nil checks, error paths)
- Note which branches are most likely uncovered
Step 2: Analyze Existing Tests
Find and read existing test files in the same package:
ls $(dirname "$TARGET")/*_test.go 2>/dev/null
Identify:
- Testing style (testify require/assert vs stdlib)
- Table-driven test patterns
- Test helper usage
- Fixture/testdata patterns
Step 3: Check Current Coverage
go test -coverprofile=cover.out ./package/
go tool cover -func=cover.out | grep FunctionName
Identify which functions have low coverage and which branches are missed.
Step 4: Generate Tests
Follow oastools conventions:
- Match the package's testing style (discovered in Step 2):
- Most packages use testify (
requirefor fatal,assertfor non-fatal) cmd/oastools/commands/uses manualt.Error/t.Fatalf— follow that pattern there
- Most packages use testify (
- Table-driven tests:
tests := []struct{...}witht.Run - Descriptive names: Test case names describe the scenario
- Edge cases: nil inputs, empty slices, zero values, error paths
- OAS-specific: Test across OAS versions (2.0, 3.0, 3.1) where relevant
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 · 159 lines · 33 tokens per session scan A 92d2107269a0
test-writer is an agent published in the GitHub repository erraggy/oastools (6 stars, last pushed 9d ago), licensed MIT. It adds 33 tokens to every session and 1,066 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.
Other agents, from other repositories
go-tests-reviewer
Go test quality review for standard testing package patterns, table-driven tests, test helpers, httptest, benchmarks, and interface-based mocking.
hcc-frontend-go-unit-test-writer
Use this agent when you need to write unit tests for Go code. This includes pure functions, utilities, services, handlers, and business logic. Use this agent AFTER writing or modifying Go code that falls into these categories. Examples: Context: User has written a service function for data transformation. user: "I…
go-test-developer
Go testing developer. Helps design and write high-quality tests: table-driven tests, test helpers, subtests, fixtures, assertion strategies, and benchmark design.
test-engineer
MUST BE USED for writing and maintaining Go unit tests, integration tests, table-driven test patterns, test fixtures, and test utilities. Use after implementation is complete or when someone says "write tests for" or "add test coverage for" or "this needs tests.".
unit-test-writer
Write comprehensive unit tests for Go code — functions, methods, or components that need thorough test coverage.
golang-developer
Go concurrency patterns, interfaces, error handling, testing, and module management.