oastools: Agent for Claude Code

.claude/agents/test-writer.md

test-writer is an agent for Claude Code from erraggy/oastools. It costs 33 tokens per session (1,066 once invoked), scanned A, original, MIT.

A Go testing agent that writes tests with specific checks for behavior and alternative code paths.

In plain words
What is it for?
Use it to add tests to existing code, improve coverage, test new features, or target branches identified as untested.
Why use it?
It focuses on meaningful branch coverage, so tests check error cases and decisions instead of merely confirming that code runs.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is erraggy/oastools's own configuration. It tells Claude Code how to work on oastools itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything oastools configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go test -coverprofile=cover.out ./package/.

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/erraggy/oastools/main/.claude/agents/test-writer.md
Clone the repo
git clone --depth 1 https://github.com/erraggy/oastools

Made for: Claude Code.

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/erraggy/oastools/test-writer/github.svg)](https://agentmods.dev/agents/erraggy/oastools/test-writer)
Your own site
<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.

agentmods 80×15 button for test-writer

Your own site · 80×15
<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>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,066 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.00033 $0.01066
Opus 5.5 $0.00013 $0.00426
Sonnet 5.5 $0.00007 $0.00213
Haiku 4.5 $0.00003 $0.00107

Measured 1mo ago against content hash 92d2107269a0, 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 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.

.claude/agents/test-writer.md · 159 lines

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

  1. Branch coverage over line coverage — a function being reachable doesn't mean all branches are exercised
  2. Meaningful assertions — every test case should verify specific behavior, not just "doesn't panic"
  3. 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 (require for fatal, assert for non-fatal)
    • cmd/oastools/commands/ uses manual t.Error/t.Fatalf — follow that pattern there
  • Table-driven tests: tests := []struct{...} with t.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

Read the full file on GitHub · 159 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. 1mo ago First seen · 159 lines · 33 tokens per session scan A 92d2107269a0

Subscribe to this mod's changes

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.

Related

Other agents, from other repositories