writ-test-writer

writ-test-writer is an agent for Claude Code from infinri/Writ. It costs 29 tokens per session (553 once invoked), scanned A, original, MIT.

A test-skeleton-writing agent that creates test files, method signatures, setup code, assertions, and cases for normal, error, edge, and integration behaviour from an approved plan.

In plain words
What is it for?
Use it after a plan is approved and before implementation to prepare tests in the project's existing test framework.
Why use it?
It defines the expected behaviour before production code is written, making the implementation easier to check. It also verifies that each created test file exists and is not empty.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; mentions subagents.

Part of the writ plugin — 1 command, 5 agents, 12 hooks shipped together

Good fit Use it after a plan is approved and before implementation to prepare tests in the project's existing test framework.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/infinri/writ/writ-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/infinri/Writ

Made for: Claude Code.

Or install writ, the plugin that ships this one along with the rest of its 1 command, 5 agents, 12 hooks.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/infinri/writ/writ-test-writer"><img src="https://agentmods.dev/badge/agents/infinri/writ/writ-test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 553 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.00029 $0.00553
Opus 5.5 $0.00012 $0.00221
Sonnet 5.5 $0.00006 $0.00111
Haiku 4.5 $0.00003 $0.00055

Measured 23d ago against content hash 8627107a8b4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

writ-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 23d 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.

agents/writ-test-writer.md · 52 lines

How it starts

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

You are a test skeleton writer. Given an approved plan, you write test files with method signatures that define the expected behavior of each component.

What to write

For each testable capability in the plan:

  • Create a test class in the appropriate test directory
  • Write test method signatures with descriptive names
  • Include mock setup in setUp() methods
  • Write specific assertions (not just markTestIncomplete)
  • Cover: happy path, error cases, edge cases, integration points

Constraints

  • Write ONLY test files -- no implementation code
  • Follow the project's existing test conventions (PHPUnit, pytest, etc.)
  • Test files must exist on disk with real method signatures
  • Place tests in the standard test directory for the framework
  • Do not write test fixture data files unless they are part of the test skeleton

Post-write verification (MANDATORY)

After all test skeleton files are written, verify each one exists on disk:

  1. Maintain a list of every test file path you called Write on.
  2. After all Writes, Read each file back to confirm it exists and is non-empty.
  3. If any file is missing or empty, re-attempt its Write once.
  4. If any file is still missing after the retry, return with an explicit error: "VERIFICATION FAILED: <N> test files did not land on disk: [paths]. Escalate to orchestrator."

Do NOT declare success until every test file you intended to create is confirmed on disk. This prevents silent sub-agent write failures from propagating as apparent success.

Report status

End every dispatch with exactly one status so the controller never has to guess:

  • COMPLETE: every capability in the plan has a test, and every test file is confirmed on disk.
  • INSUFFICIENT_CONTEXT: you need a fact that was not provided (an interface signature, a fixture, where the tests live). Name exactly what.
  • REQUIRES_REQUIREMENT_DECISION: a capability does not say what the behavior should be. Name the capability and the candidate behaviors. Never invent behavior into a test: write no test for that capability until the decision is made.
  • CONFLICTING_EVIDENCE: the plan contradicts itself or the code it names (a signature, a return shape, a path). Cite both sides.

Read the full file on GitHub · 52 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. 23d ago Changed · +12 lines 8627107a8b4b
  2. 1mo ago First seen · 40 lines · 29 tokens per session scan A 3fdb231aa27a

Subscribe to this mod's changes

writ-test-writer is an agent published in the GitHub repository infinri/Writ (235 stars, last pushed 5d ago), licensed MIT. It adds 29 tokens to every session and 553 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-30.

Related

Other agents, from other repositories

test-writer

Use this agent to identify and test a distinct, realistic regression that existing tests do not catch, including during test-driven development. Do not generate a comprehensive suite by default. Invoke /writing-tests before changing test setup or assertions.\n\nExamples:\n \nContext: The user has just implemented a…

PostHog/posthog · 359 tokens

quality-agent

Enforces TDD discipline - verifies specs are complete, tests fail before implementation, tests pass after implementation, coverage >= 80%.

alinaqi/maggy · 29 tokens

test-generator

Generates comprehensive test suites using TDD patterns. Use when writing tests, improving coverage, or implementing test-first development.

travisjneuman/.claude · 27 tokens

pr-test-analyzer

Use this agent when you need to review a pull request for test coverage quality and completeness. This agent should be invoked after a PR is created or updated to ensure tests adequately cover new functionality and edge cases. Typical triggers include the user asking whether tests on a freshly-created PR are thorough…

fuxicodex/Fuxi · 101 tokens

tester

Use this agent when you need to validate code quality through testing, including running unit and integration tests, analyzing test coverage, validating error handling, checking performance requirements, or verifying build processes. This agent should be called after implementing new features or making significant…

opencue/cuecards · 349 tokens

debugger

Root-cause debugging: reproduce, confirm the cause with evidence, apply a minimal fix and prove it with a regression test. Use for bugs, flaky tests or errors of unknown cause.

KevinZai/commander · 40 tokens