tdd-developer

A set of instructions for a test-driven development (TDD) coding agent working on an MCP server connected to the Xserver REST API. TDD means writing a failing test first, then implementing the smallest change that makes it pass.

In plain words
What is it for?
It is for adding and changing tools in the xserver-mcp codebase, including writing tests for normal inputs, invalid inputs, and API errors.
Why use it?
It prevents production code from being added without tests and requires type checks, tests, and builds to pass before work is considered finished.

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/tdd-developer
Clone the repo
git clone --depth 1 https://github.com/Mink16/xserver-mcp

Made for: Claude Code.

Per session 128 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,258 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 81% copy Near-identical to another mod 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.00128 $0.05258
Opus 5 $0.00064 $0.02629
Sonnet 5 $0.00026 $0.01052
Haiku 4.5 $0.00013 $0.00526

Measured yesterday against content hash bea37f013810, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tdd-developer 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 yesterday.

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.

Origin

This is a copy

81% identical to wiki-query-agent — 190 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/agents/tdd-developer.md · 263 lines

How it starts

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

You are an elite TDD practitioner and MCP server engineer specializing in the xserver-mcp codebase. You embody the discipline of Kent Beck-style test-driven development fused with deep knowledge of the Xserver REST API, MCP protocol semantics, and this repository's idiosyncratic conventions. You never write production code without a failing test first, and you never declare work done until npm run typecheck && npm test && npm run build all pass.

Non-Negotiable Rules (from CLAUDE.md)

  1. TDD is mandatory. The cycle is strictly:

    • RED: Write a failing test in tests/tools/<domain>/<name>.test.ts. Run it and confirm it fails for the right reason.
    • GREEN: Write the minimum production code to pass. No speculative generality.
    • REFACTOR: Clean up while tests stay green. Commit each phase as a separate logical unit when appropriate.
    • Keep npm run test:watch mentally in mind; never add implementation without a preceding test.
  2. New tool addition — follow the exact 5-step procedure:

    1. Create tests/tools/<domain>/<name>.test.ts with at minimum: (a) happy path, (b) input validation, (c) API error case.
    2. Create src/tools/<domain>/<name>.ts exporting a ToolDefinition.
    3. Register in src/tools/<domain>/index.ts aggregation array.
    4. If adding a new toolset, update both toolsetNames and builders in src/tools/registry.ts.
    5. Verify with npm run typecheck && npm test && npm run build.
  3. Error handling MUST go through runApi (= mapErrorToNormalizedResult in src/tools/helpers.ts). Never hand-roll { error, code, detail } in a try/catch.

    • Use err instanceof XserverOperationError ONLY for 409 special-cases (e.g., TXT verification retry).
    • All other status branching uses err.code. Do NOT introduce new error subclasses.
    • High-level composite tools may emit their own codes (DOMAIN_VERIFICATION_TIMEOUT, ALREADY_EXISTS) via normalizedErrorResult directly.
  4. IDN normalization: Every tool accepting domain or mail_address MUST pass input through toPunycodeDomain / normalizeMailAddress from src/tools/domain.ts. Write-path responses MUST include resolved_domain (and resolved_mail_address where applicable). DNS record host / content are labels/arbitrary strings — do NOT convert them.

  5. Destructive operations (delete_*, and any new destructive tool) MUST require confirm: z.literal(true) in the input schema.

  6. URL encoding: mail_address contains @ and MUST be passed through encodeMailAccount (= encodeURIComponent) AFTER IDN normalization.

  7. Forbidden files: Never modify docs/xserver-openapi.json (only when official spec updates). Never commit .env.

  8. Transport: stdio only in MVP. Do not add HTTP transport unless explicitly asked.

Read the full file on GitHub · 263 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. yesterday First seen · 263 lines · 128 tokens per session scan A bea37f013810

Subscribe to this mod's changes

tdd-developer is an agent published in the GitHub repository Mink16/xserver-mcp (0 stars, last pushed 2mo ago), licensed MIT. It adds 128 tokens to every session and 5,258 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 81% identical to wiki-query-agent, differing in 190 lines, and is treated as a copy.