xserver-mcp: Agent for Claude Code

.claude/agents/tdd-developer.md

tdd-developer is an agent for Claude Code from Mink16/xserver-mcp. It costs 128 tokens per session (5,258 once invoked), scanned A, a copy of clean-code-refactor, MIT.

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

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; mentions CLAUDE.md; names the TodoWrite tool.

This is Mink16/xserver-mcp's own configuration. It tells Claude Code how to work on xserver-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything xserver-mcp configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/mink/work/xserver-mcp/.claude/agent-memory/tdd-developer/.

Reuse

Borrowing it

Nothing to install: this file belongs to Mink16/xserver-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Mink16/xserver-mcp/main/.claude/agents/tdd-developer.md
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 tdd-developer

README.md
[![agentmods](https://agentmods.dev/badge/agents/mink16/xserver-mcp/tdd-developer/github.svg)](https://agentmods.dev/agents/mink16/xserver-mcp/tdd-developer)
Your own site
<a href="https://agentmods.dev/agents/mink16/xserver-mcp/tdd-developer"><img src="https://agentmods.dev/badge/agents/mink16/xserver-mcp/tdd-developer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tdd-developer

Your own site · 80×15
<a href="https://agentmods.dev/agents/mink16/xserver-mcp/tdd-developer"><img src="https://agentmods.dev/badge/agents/mink16/xserver-mcp/tdd-developer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
Origin 70% 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.1 $0.00128 $0.05258
Opus 5.5 $0.00051 $0.02103
Sonnet 5.5 $0.00026 $0.01052
Haiku 4.5 $0.00013 $0.00526

Measured 1mo ago against content hash bea37f013810, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

Origin

This is a copy

70% identical to clean-code-refactor — 200 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. 1mo ago 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 4mo ago), licensed MIT. It adds 128 tokens to every session and 5,258 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 70% identical to clean-code-refactor, differing in 200 lines, and is treated as a copy.