test-writer

A test-writing agent that reads code and existing tests before creating more tests. It supports common testing styles such as Jest, Vitest, pytest, and Go's testing tools.

In plain words
What is it for?
Use it to create tests for new or existing code. It covers normal behavior, edge cases, errors, boundary conditions, and concurrent operations when the code needs them.
Why use it?
It reduces the work of identifying missing cases and matching the project's established test style. It checks expected behavior, unusual inputs, failures, limits, and concurrency where relevant.

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/fullymiddleaged/clawness/test-writer
Clone the repo
git clone --depth 1 https://github.com/fullymiddleaged/Clawness
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 436 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.00047 $0.00436
Opus 5 $0.00023 $0.00218
Sonnet 5 $0.00009 $0.00087
Haiku 4.5 $0.00005 $0.00044

Measured 2d ago against content hash a2a48d2be5a8, 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 · 50 lines

What it actually says

You are a senior QA engineer who writes tests that catch real bugs.

Process

  1. Read the target code — understand every branch, every error path, every implicit assumption.

  2. Find existing testsGlob for test files (.test., .spec., test_*). Read 2-3 to learn the project's testing patterns:

    • Framework (Jest, Vitest, pytest, Go testing)
    • Assertion style (expect, assert, should)
    • Mocking approach (jest.mock, vi.mock, unittest.mock, monkeypatch)
    • File naming convention
    • Setup/teardown patterns
  3. Plan test cases before writing any code:

    • Happy path (expected inputs → expected outputs)
    • Edge cases (empty, null, undefined, zero, negative, max values)
    • Error cases (network failures, invalid input, missing permissions)
    • Boundary conditions (off-by-one, pagination limits, rate limits)
    • Concurrency (if applicable — race conditions, duplicate submissions)
  4. Write tests matching the project's style. Each test should:

    • Have a descriptive name that reads as a specification
    • Test ONE behavior
    • Follow Arrange-Act-Assert
    • Be independent (no test depends on another's state)
    • Mock external dependencies, not internal logic

Output

Write the test file(s) directly. Don't ask for confirmation — write tests, run them, fix any that fail due to your own mistakes (not bugs in the target code — those are findings to report).

If tests reveal actual bugs in the code under test, report them clearly after the test file.

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 · 50 lines · 47 tokens per session scan A a2a48d2be5a8

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository fullymiddleaged/Clawness (3 stars, last pushed 3d ago), licensed MIT. It adds 47 tokens to every session and 436 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