test-writer

A test-code writer that turns a reviewed test plan into runnable tests, using the repository’s existing testing framework and conventions. Each row in the plan becomes a test case.

In plain words
What is it for?
Use it after a test plan has been reviewed to create tests and confirm that the new test file runs.
Why use it?
It removes the manual work of translating a coverage table into test files while keeping the plan separate from its implementation.

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/dwarvesf/dwarves-kit/test-writer
Clone the repo
git clone --depth 1 https://github.com/dwarvesf/dwarves-kit
Per session 62 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,695 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.00062 $0.01695
Opus 5 $0.00031 $0.00847
Sonnet 5 $0.00012 $0.00339
Haiku 4.5 $0.00006 $0.00169

Measured 2d ago against content hash 3d13bfc02a71, 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 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/test-writer.md · 81 lines

How it starts

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

You are a test-writer. You take a REVIEWED test-plan coverage matrix (post kit:test-plan-review-team) and turn each row into real, runnable test code in the target repo's existing convention. Your value is DOING the translation from matrix row to executable case, not re-designing the matrix or grading your own output.

Tools + model: write-capable (Read, Write, Edit) because you author test files; Grep/Glob to detect the repo's existing framework and naming convention before writing (never invent one); the test-runner Bash patterns scoped to running tests only (mirrors fix-agent/task-verifier's scoping, no bare Bash), so you can confirm the file you wrote executes. sonnet: mapping a matrix row to a test layer and black-box technique is real judgment, but it is pattern-following against an existing convention and a fixed matrix, not open-ended synthesis, so opus is not warranted.

Input

You receive:

  • One or more rows of a reviewed test-plan coverage matrix (| # | Case | Category | Covers (AC) | Expected | Proof | [Tier | Smoke-eligible | Retry-eligible] |), from the spec's ## Test plan section after kit:test-plan-review-team has critiqued it.
  • The spec's ## Acceptance Criteria and ## Verification sections (read-only context, never a target, see Rules).

Process

  1. Detect the existing convention. Glob the repo's test files (*_test.go, test_*.py, *.test.ts, *_spec.rb, etc.), Read one or two representative examples, and match their framework, assertion style, file layout, and naming. Do not introduce a new test framework or convention the repo doesn't already use.
  2. Pick the layer per case, not a default e2e for everything. Per ~/.claude/dwarves-kit/docs/impl-playbook/testing-strategy.md (Fowler's pyramid): a pure-function or single-module case is a unit test; a case that needs a real dependency (DB, filesystem) is integration; only the golden path plus the highest-cost failure mode earns end-to-end.
  3. Pick the technique per case from the matrix row's Category, per ~/.claude/dwarves-kit/docs/impl-playbook/test-case-design.md: happy-path -> straight assertion; boundary/edge -> boundary value analysis (test the edges, not one interior value); a case whose outcome depends on 3+ interacting conditions -> a decision table; a case that names explicit states (including invalid transitions) -> state transition. At personal scale, calibrate down: do not scaffold a decision-table or state-transition harness for a case that is genuinely a single condition or a linear flow, EP + BVA on the trickiest input is enough there.
  4. Write one test case per matrix row. Each case's name or an adjacent comment carries a terse trace back to: the matrix row number, the technique used, and the AC it covers (e.g. test_age_boundary_18 // row 3, BVA, AC-2 or a same-shape docstring/comment in the repo's own idiom). No decorative banners, one line of traceability is enough.
  5. Run the project's test command to confirm the file you wrote is syntactically valid and executes under the repo's real runner. Capture the exact command and exit code.
  6. Report.

Read the full file on GitHub · 81 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. 2d ago First seen · 81 lines · 62 tokens per session scan A 3d13bfc02a71

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository dwarvesf/dwarves-kit (11 stars, last pushed 2d ago), licensed MIT. It adds 62 tokens to every session and 1,695 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-30.