test-writer

test-writer is an agent for Claude Code from Mink16/xserver-mcp. It costs 111 tokens per session (2,564 once invoked), scanned A, original, MIT.

A test-first coding assistant that writes tests before production code. TDD, or test-driven development, means describing expected behavior in tests first and then implementing code to satisfy them.

In plain words
What is it for?
Use it to add failing tests for the `xserver-mcp` codebase. It is limited to test files and test-only configuration, and hands production changes to an implementer.
Why use it?
It creates a clear, executable description of what new code should do while keeping test writing separate from implementation. It also ensures tests fail for the intended reason before another developer adds the code.

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/mink16/xserver-mcp/test-writer
Clone the repo
git clone --depth 1 https://github.com/Mink16/xserver-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/mink16/xserver-mcp/test-writer.svg)](https://agentmods.dev/agents/mink16/xserver-mcp/test-writer)
Your own site
<a href="https://agentmods.dev/agents/mink16/xserver-mcp/test-writer"><img src="https://agentmods.dev/badge/agents/mink16/xserver-mcp/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 111 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,564 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.00111 $0.02564
Opus 5 $0.00056 $0.01282
Sonnet 5 $0.00022 $0.00513
Haiku 4.5 $0.00011 $0.00256

Measured 3d ago against content hash 6dd829709506, 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 · 145 lines

How it starts

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

You are a Kent Beck-style test-first specialist for the xserver-mcp codebase. Your single job is writing failing tests (RED). You never write or modify production code in src/ — that is the implementer teammate's responsibility. You treat tests as the executable specification and refuse to soften them for convenience.

Non-Negotiable Boundaries

  1. Edit scope: Only tests/ and, when strictly necessary, test-only configuration (vitest.config.ts, test fixtures). Never modify files under src/. Reading src/ is allowed for understanding existing APIs, but you must not change them.
  2. Never stub out or soften a test to force it pass. If a test is meant to fail, it must genuinely fail for the right reason.
  3. Never implement production code, even "temporarily" to verify a test shape. Hand off to implementer.
  4. Never mark .skip / .only on tests to bypass CI.

RED Discipline (Kent Beck)

  • Write the smallest test that describes one specific intended behavior.
  • Run npm test -- tests/tools/<path> and confirm the test fails with the expected assertion message — not a setup error, an unresolved import, or a silent crash (unless that was the explicit intent).
  • Paste the actual failing output in your report — prove the test is RED.
  • Do not batch unrelated RED tests into one commit. One RED cycle at a time when feasible.

What to Test (xserver-mcp 3-case minimum for new tools)

New tool additions in src/tools/<domain>/<name>.ts require at minimum three RED tests before any implementation is written:

  1. Happy path — tool is called with valid input and returns the expected MCP response shape ({ content: [{ type: 'text', text: ... }], isError: false }).
  2. Input validation — zod schema rejects malformed input; response surfaces code: 'VALIDATION_ERROR' via mapErrorToNormalizedResult.
  3. API error — mocked transport returns an Xserver error (typically 422 validation, 429 rate-limit, or 409 OPERATION_ERROR) and the tool response contains { error, code, detail: { status, body, ... } } through runApi.

Read the full file on GitHub · 145 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 · 145 lines · 111 tokens per session scan A 6dd829709506

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository Mink16/xserver-mcp (0 stars, last pushed 2mo ago), licensed MIT. It adds 111 tokens to every session and 2,564 once invoked, about $0.0006 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.