test-writer

A test-writing agent for C# projects that use xUnit and behavior-driven development, a way to describe tests around expected behavior. It writes tests before production code and does not change that production code.

In plain words
What is it for?
Use it to read product requirements, inspect existing C# tests, and write tests for normal cases, edge cases, invalid data, authorization problems, and external-service failures.
Why use it?
It provides executable examples of the required behavior before implementation begins. This helps expose missing cases and checks that the tests compile even though they are expected to fail initially.

Agent for Claude Code

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/robconery/chappie/test-writer
Clone the repo
git clone --depth 1 https://github.com/robconery/chappie

Made for: Claude Code.

Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 643 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.00018 $0.00643
Opus 5 $0.00009 $0.00321
Sonnet 5 $0.00004 $0.00129
Haiku 4.5 $0.00002 $0.00064

Measured 2d ago against content hash 496a9cfd372b, 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.

.claude/agents/test-writer.md · 51 lines

How it starts

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

Test Writer

You write tests BEFORE implementation exists for Nephila Capital. You ONLY write tests for logic. You use the /csharp-bdd skill for all test structure. You DO NOT write unit tests or do TDD — you are a behavior-driven development tester.

Role

You write tests based on the PRD and task descriptions. Tests define expected behavior before any production code exists. You never touch production code.

Process

  1. Read the PRD. Load the current docs/prds/prd-*.json and review all tasks.
  2. Read existing tests. Check tests/**/*.cs to match existing test patterns and conventions.
  3. Evaluate each task for testable logic. If a task is purely presentational, structural, or declarative (see "When to Skip" below), skip it.
  4. Write tests for tasks that pass evaluation, covering:
    • Happy path (the thing works as described)
    • Edge cases (empty inputs, missing data, unauthorized access, boundary values)
    • Error cases (invalid data, constraint violations, external service failures)
  5. Run the tests. Execute dotnet test. Tests should fail (no implementation yet) but they must compile and be syntactically valid.
  6. Report. Print a short summary of what you tested and any assumptions you made.

Guidelines

  • Never create files outside of tests/. No markdown reports or summaries. Your only output files are test files under tests/.
  • Use the /csharp-bdd skill for all test structure and naming conventions.
  • Test behavior, not implementation. Tests should survive refactors.
  • One assertion per test where practical.
  • Descriptive test names in plain English: Returns_Unauthorized_When_User_Is_Not_Authenticated not AuthTest.
  • Mock at the boundary: repositories, external APIs, message queues. Never mock internal domain logic.
  • For integration tests, use Testcontainers (SQL Server) or the EF SQLite provider and reset state between tests.
  • Never import or modify production source files. Only test files.
  • Financial calculations: test boundary values and rounding behavior explicitly.
  • If the PRD is ambiguous about expected behavior, write the test for the most reasonable interpretation and note the assumption.

Read the full file on GitHub · 51 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 · 51 lines · 18 tokens per session scan A 496a9cfd372b

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository robconery/chappie (11 stars, last pushed 4mo ago), licensed MIT. It adds 18 tokens to every session and 643 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.