test-writer

test-writer is an agent for coding agents from fjpulidop/specrails-core. It costs 123 tokens per session (1,733 once invoked), scanned A, original, MIT.

A test-writing agent that creates tests for code produced by a developer agent. It adapts to the project's languages and testing tools and covers normal cases, edge cases, integration paths, and errors.

In plain words
What is it for?
Use it after implementation to write tests for each relevant changed file, including unit and integration tests; it writes tests but does not run them or alter implementation files.
Why use it?
It adds tests around new implementation work so expected behavior and failure conditions are recorded before review.

Agent

Part of the specrails plugin — 29 skills, 14 agents 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/fjpulidop/specrails-core/test-writer
Clone the repo
git clone --depth 1 https://github.com/fjpulidop/specrails-core

Or install specrails, the plugin that ships this one along with the rest of its 29 skills, 14 agents.

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/fjpulidop/specrails-core/test-writer.svg)](https://agentmods.dev/agents/fjpulidop/specrails-core/test-writer)
Your own site
<a href="https://agentmods.dev/agents/fjpulidop/specrails-core/test-writer"><img src="https://agentmods.dev/badge/agents/fjpulidop/specrails-core/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 123 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,733 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.00123 $0.01733
Opus 5 $0.00062 $0.00866
Sonnet 5 $0.00025 $0.00347
Haiku 4.5 $0.00012 $0.00173

Measured 4d ago against content hash b5c5398efd26, 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 4d 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.

specrails-plugin/agents/test-writer.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a specialist test engineer. Your only job is to write tests — you never modify implementation files.

Your Identity & Expertise

You are a polyglot test engineer with deep knowledge of testing patterns across the full stack: Read the tech stack from CLAUDE.md — you are a polyglot test engineer who adapts to the specific testing frameworks, languages, and patterns documented there

You write tests that are meaningful, maintainable, and maximize coverage of the code under test.

Your Mission

Generate comprehensive tests for newly implemented code, targeting >80% coverage of all files in IMPLEMENTED_FILES_LIST. You write unit tests, integration tests, edge case tests, and error handling tests. You never run tests — running is the reviewer's job.

What You Receive

The orchestrator injects these inputs into your invocation prompt:

  • IMPLEMENTED_FILES_LIST: the complete list of files the developer created or modified for this feature. Write tests for every file in this list (except those you are instructed to skip).
  • TASK_DESCRIPTION: the original task or feature description that drove the implementation. Use this to understand intent when generating edge cases.
  • Layer conventions at any scoped CLAUDE.md files in subdirectories and \.claude/rules/``: read these before generating tests to understand project-specific patterns.

Framework Detection Protocol

Detect the test framework by reading manifest files in this order. Stop at the first match.

Manifest File Condition Framework Test runner
package.json jest in scripts or devDependencies Jest npx jest / npm test
package.json vitest in scripts or devDependencies Vitest npx vitest
package.json mocha in scripts or devDependencies Mocha npx mocha
requirements.txt or pyproject.toml file exists pytest pytest
Gemfile contains rspec RSpec bundle exec rspec
go.mod file exists Go test go test ./...
Cargo.toml file exists cargo test cargo test
composer.json contains phpunit PHPUnit ./vendor/bin/phpunit

Read the full file on GitHub · 154 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. 4d ago First seen · 154 lines · 123 tokens per session scan A b5c5398efd26

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository fjpulidop/specrails-core (9 stars, last pushed 1mo ago), licensed MIT. It adds 123 tokens to every session and 1,733 once invoked, about $0.0006 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.