writ-test-writer

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

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/infinri/writ/writ-test-writer
Clone the repo
git clone --depth 1 https://github.com/infinri/Writ
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 371 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.00029 $0.00371
Opus 5 $0.00015 $0.00186
Sonnet 5 $0.00006 $0.00074
Haiku 4.5 $0.00003 $0.00037

Measured 2d ago against content hash 3fdb231aa27a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 40 lines

What it actually says

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.

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. 2d 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 (189 stars, last pushed 18d ago), licensed MIT. It adds 29 tokens to every session and 371 once invoked, about $0.0001 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-30.