test-writer

test-writer is an agent for Claude Code from ComputerSaysNull/claude-delegate-local-mcp. It costs 35 tokens per session (873 once invoked), scanned A, original, MIT.

A pytest test-writing agent for Python repositories. pytest is a tool for running automated Python checks.

In plain words
What is it for?
Adding tests after bug fixes, extending tests for new modules, and checking that validation rules or safeguards can actually detect failures.
Why use it?
It helps prevent tests from passing while checking the wrong thing by requiring tests to prove that a check fails when the guarded behavior is broken.

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/computersaysnull/claude-delegate-local-mcp/test-writer
Clone the repo
git clone --depth 1 https://github.com/ComputerSaysNull/claude-delegate-local-mcp

Made for: Claude Code.

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/computersaysnull/claude-delegate-local-mcp/test-writer.svg)](https://agentmods.dev/agents/computersaysnull/claude-delegate-local-mcp/test-writer)
Your own site
<a href="https://agentmods.dev/agents/computersaysnull/claude-delegate-local-mcp/test-writer"><img src="https://agentmods.dev/badge/agents/computersaysnull/claude-delegate-local-mcp/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 873 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.00035 $0.00873
Opus 5 $0.00017 $0.00436
Sonnet 5 $0.00007 $0.00175
Haiku 4.5 $0.00003 $0.00087

Measured 3d ago against content hash 31ec2cad77bd, 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 3d 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 · 78 lines

How it starts

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

You write tests for this repository. Mid tier because tests are mechanical in shape but correctness-sensitive in content: a test that passes for the wrong reason is worse than no test, because it converts an unknown into a false assurance.

The rule that matters most here

Assert that a check can fail, not merely that it passes.

Three checks in this repository were found unable to fail — reporting success while verifying nothing. One searched a file for the very reference it was validating, so it always found its own needle. One compared a document against a stale bytecode cache, so it validated code that no longer existed. One flagged the pattern list that defined it. All three had been "passing" since they were written.

So for anything that guards, gates or refuses, write the negative case first:

def test_supersede_pointing_at_a_nonexistent_adr_is_caught():
    """The bug: searching file text for "ADR-0099" always succeeded, because the
    heading being validated contains that string itself."""
    assert _adr_check(text_with_dangling_reference) == ["ADR-0001 -> ADR-0099"]

Then the positive case, so the check is not simply always-on.

Conventions

  • Regression tests go in tests/regression/, named after the bug, not the function: test_gate_self_defeating_checks.py, not test_gate.py.
  • The docstring states the failure the test prevents, in one or two sentences. Six months from now that sentence is the only thing explaining why the test exists.
  • Test names are sentences: test_workspace_roots_is_required_and_has_no_default, not test_config_1.
  • Anything needing the live cluster or a real bwrap gets @pytest.mark.integration and is skipped by default. The suite must pass with no cluster and no network.
  • Tests are hermetic. Use tmp_path. Never mutate a tracked file in place — a test that edits the repository will eventually lose a race and leave a dirty tree.
  • tests/conftest.py puts src/ on the path, so a bare clone with only pytest installed works. Do not add an install step.

Read the full file on GitHub · 78 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. 3d ago First seen · 78 lines · 35 tokens per session scan A 31ec2cad77bd

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository ComputerSaysNull/claude-delegate-local-mcp (0 stars, last pushed 3d ago), licensed MIT. It adds 35 tokens to every session and 873 once invoked, about $0.0002 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.

Related

Other agents, from other repositories

pydantic-ai-validator

Testing and validation specialist for Pydantic AI agents. USE AUTOMATICALLY after agent implementation to create comprehensive tests, validate functionality, and ensure readiness. Uses TestModel and FunctionModel for thorough validation.

coleam00/context-engineering-intro · 46 tokens

test-coverage-agent

Use this agent to analyse an entire module or directory for missing test coverage, then generate the missing tests. Invoke when the user asks to "add tests for this module", "find untested code", "improve test coverage across a service", or "write tests for all these files". Prefer this over the inline /test-gen…

kid-sid/claude-spellbook · 84 tokens

tester

Use this agent after chunk implementation to create comprehensive test suites, or when the user requests test generation. Creates unit, integration, and edge case tests to ensure code works correctly and provide shipping confidence. Context: All chunks are implemented, orchestrator invokes testing phase. user: "All…

drobins25/craft · 200 tokens

test-writer

Expert test writer for Go unit/integration tests. Generates comprehensive, maintainable tests. Use PROACTIVELY after code-writer completes.

nylas/cli · 32 tokens

phpt-author

Use to write new .phpt functional tests for the Matrix operators following this repository's conventions, and to verify the expected output is exactly right.

lisachenko/native-php-matrix · 33 tokens

test-writer

为已有行为新增或修复 Dart 单测、Flutter Widget 测试和集成测试;不补写缺失业务实现,也不负责原生端测试。触发词:缺测试、flaky、mocktail、testWidgets、integrationtest。.

bladeofgod/flutter-ai-harness · 59 tokens