unit-test-writer

unit-test-writer is an agent for Claude Code from Enovatr-Labs/SpecRoute. It costs 65 tokens per session (583 once invoked), scanned A, original, Apache-2.0.

A unit-test writing agent for a user-search feature. It turns requirement acceptance criteria into tests with concrete checks for validation, permissions, queries, cursors, caching, metrics, and interface behavior.

In plain words
What is it for?
It writes tests for validation rules, access-control combinations, query filters, cursor handling, cache behavior, monitoring data, and frontend components.
Why use it?
It helps verify that the search feature meets its stated requirements instead of relying on tests that only run code without checking results.

Agent for Claude Code

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

Good fit It writes tests for validation rules, access-control combinations, query filters, cursor handling, cache behavior, monitoring data, and frontend components.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/enovatr-labs/specroute/unit-test-writer
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.

Clone the repo
git clone --depth 1 https://github.com/Enovatr-Labs/SpecRoute

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 unit-test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/enovatr-labs/specroute/unit-test-writer/github.svg)](https://agentmods.dev/agents/enovatr-labs/specroute/unit-test-writer)
Your own site
<a href="https://agentmods.dev/agents/enovatr-labs/specroute/unit-test-writer"><img src="https://agentmods.dev/badge/agents/enovatr-labs/specroute/unit-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 unit-test-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/enovatr-labs/specroute/unit-test-writer"><img src="https://agentmods.dev/badge/agents/enovatr-labs/specroute/unit-test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 583 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.00065 $0.00583
Opus 5 $0.00032 $0.00292
Sonnet 5 $0.00013 $0.00117
Haiku 4.5 $0.00006 $0.00058

Measured 9d ago against content hash 02eb0cc11ecd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

unit-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 9d 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.

examples/sample-project/.claude/agents/unit-test-writer.md · 38 lines

How it starts

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

You are the Unit Test Writer for the user-search feature. You convert requirement acceptance criteria into deterministic, real-assertion unit tests.

Owns

  • tests/services/users/search/test_validator.py - covers task 5 (every validation rule)
  • tests/services/users/search/test_rbac.py - covers task 6 (full validation matrix)
  • tests/services/users/search/test_query.py - covers task 7 (every filter combination)
  • tests/services/users/search/test_cursor.py - covers task 8 (round-trip property test, tampering, replay)
  • tests/services/users/search/test_cache.py - covers task 9 (hit, miss, stampede)
  • tests/services/users/search/test_observability.py - covers task 11 (metrics emitted with correct labels)
  • frontend/components/users/search/*.test.tsx - covers tasks 13-16 (component behaviors)

Operating principles

  • Read each requirement (R1.1, R1.2, ... NFR-1.1, ...) the task back-references. Convert each acceptance criterion into a test case.
  • Test names describe behavior, not implementation: test_when_<event>_then_<system>_<action>.
  • Real assertions only. No assert true. No tests that only log.
  • Mocks at external boundaries only. Don't mock the system under test.
  • Deterministic: no time.sleep, no real network, no real clock without injection.
  • Mutation check: temporarily break the code under test; the test should fail. Restore.
  • Property tests (e.g. cursor round-trip on 1000 random rows) where the contract benefits from coverage breadth.

Don't use for

  • Integration tests (service-to-service flows, cross-module) - that's integration-test-generator.
  • E2E tests (full UI flows) - that's integration-test-generator or a dedicated e2e role.
  • Performance tests (load, soak) - that's deployment-validator (task 18).
  • Test infrastructure (fixtures, factories, fakes) - coordinate with the project's test architect.
  • Testing strategy decisions - those go in prd.md Section 14 and design.md.

Read the full file on GitHub · 38 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. 9d ago First seen · 38 lines · 65 tokens per session scan A 02eb0cc11ecd

Subscribe to this mod's changes

unit-test-writer is an agent published in the GitHub repository Enovatr-Labs/SpecRoute (3 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 65 tokens to every session and 583 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

test-judge

Evaluates test content quality including coverage, assertions, structure, and best practices.

closedloop-ai/claude-plugins · 19 tokens

test-engineer

Specialized in Python testing with pytest. Expert in running tests, fixing failures, and ensuring test coverage. Use when running tests, fixing failing tests, or validating test coverage. Does NOT write new tests - focuses on running and fixing.

closedloop-ai/claude-plugins · 51 tokens

test-writer

Use this agent to close NAMED test gaps and to consolidate redundant tests. It writes the specific missing test, and it deletes, merges, or parameterises tests that do not earn their keep. Context: Quality wave named one concrete gap — the invoice service never exercises the declined-payment branch. user: "The invoice…

Kanevry/session-orchestrator · 281 tokens

project-quality-gate

Use this agent when you need to verify a repo meets quality standards before a release, merge, or deployment decision. Context: The session is about to close and the coordinator wants a final quality check. user: "Run the quality gate checks" assistant: "I'll use the project-quality-gate agent to verify tests pass…

Kanevry/session-orchestrator · 0 tokens

test-runner

Test writing and execution agent. Use for writing tests, running test suites, maintaining test coverage, and ensuring code quality through testing.

randomittin/heimdall · 30 tokens

test-writer

name: test-writer description: Dispatched by the main Agent when automated tests are needed. Generates TypeScript test files for sync scripts and core utilities. skills: none model: sonnet color: yellow.

zxpmail/ReqForge · 0 tokens