test-writer

test-writer is an agent for Claude Code from ihudak/ihudak-claude-plugins. It costs 73 tokens per session (2,110 once invoked), scanned A, original, MIT.

A test-writing agent that creates tests for new or changed behavior by examining a task plan and code diff. It detects the project's test framework but does not run the tests.

In plain words
What is it for?
It is for adding tests during implementation work when the project has a detected test framework.
Why use it?
It separates writing tests from checking whether they pass, so the caller can run verification afterward and ask for a test command when the framework is unclear.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the dev-workflows plugin — 2 skills, 28 commands, 38 agents, 3 hooks shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add ihudak/ihudak-claude-plugins
Claude Code
/plugin install dev-workflows

Made for: Claude Code.

Or install dev-workflows, the plugin that ships this one along with the rest of its 2 skills, 28 commands, 38 agents, 3 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 test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/ihudak/ihudak-claude-plugins/test-writer.svg)](https://agentmods.dev/agents/ihudak/ihudak-claude-plugins/test-writer)
Your own site
<a href="https://agentmods.dev/agents/ihudak/ihudak-claude-plugins/test-writer"><img src="https://agentmods.dev/badge/agents/ihudak/ihudak-claude-plugins/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,110 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.1 $0.00073 $0.02110
Opus 5 $0.00036 $0.01055
Sonnet 5 $0.00015 $0.00422
Haiku 4.5 $0.00007 $0.00211

Measured 6d ago against content hash 0129cb63dbea, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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.

plugins/dev-workflows/agents/test-writer.md · 135 lines

How it starts

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

Write tests for new or changed behavior based on a diff. DO NOT run the tests — the caller (the command) runs test-baseliner in verify mode separately.

Invoked from /implement at Phase 3.5 (SIMPLE / MODERATE, after Phase 3A implementation completes) and inside Phase 3B (SIGNIFICANT / HIGH-RISK, at step 4a — after implementation completes but before the diff is captured for Opus review). The caller decides whether to proceed based on the framework-detection outcome.

Inputs

The caller passes a structured brief:

  • Task description — what was implemented, verbatim from the user where possible
  • Plan — the approved plan from Phase 2A (standard) or the risk-planner plan from Phase 2B (Opus)
  • Diffgit add -N . && git diff output so new files are included. MANDATORY. Both Plan and Diff may be given inline or as an absolute file path — Read the file first when given a path On a read failure, follow the read-failure contract in ${CLAUDE_PLUGIN_ROOT}/references/context-management.mdDiff is evidence: hard stop, return the Diff: unreadable at <path> shape below (see Output) — a distinct marker from Framework: not detected, so the caller does not route an unreadable evidence file into the missing-framework prompt — and never re-derive the diff with a tool of your own. Plan is context: degrade to absent.
  • Project root — absolute path so files can be opened
  • Baseline — the ## Test Baseline block captured by test-baseliner in Pre-Phase 3.5 (identifies the detected framework + the command used + the set of pre-existing passing / failing tests). Used to confirm framework identity and to avoid shadowing pre-existing test names

Refuse to write tests without a diff and a baseline — ask the caller to supply them.

Steps

  1. Detect framework. Apply the same detection logic as test-baseliner against the project root:
    • pom.xml → Maven
    • build.gradle / build.gradle.kts → Gradle
    • package.json → JS/TS (read scripts.test; inspect devDependencies for jest, vitest, mocha, playwright to pick conventions)
    • pyproject.toml / setup.py / pytest.ini → pytest
    • Makefile with a test target → Make-wrapped suite
    • Else → not detected.

Read the full file on GitHub · 135 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. 6d ago First seen · 135 lines · 73 tokens per session scan A 0129cb63dbea

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository ihudak/ihudak-claude-plugins (2 stars, last pushed 3d ago), licensed MIT. It adds 73 tokens to every session and 2,110 once invoked, about $0.0004 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.