test-writer-fixer

test-writer-fixer is an agent for Claude Code from clchinkc/document-mcp. It costs 213 tokens per session (854 once invoked), scanned A, original, MIT.

An agent focused on software testing across unit, integration, end-to-end, and evaluation tests. It can analyze test failures, write tests, improve coverage, and maintain test fixtures and mocks.

In plain words
What is it for?
Use it to add tests for new code, diagnose failing or slow tests, find coverage gaps, create test setup, and maintain existing test suites.
Why use it?
It helps turn unclear failures and missing test cases into structured testing work. It also follows different rules for local tests and tests that use real external APIs.

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/clchinkc/document-mcp/test-writer-fixer
Clone the repo
git clone --depth 1 https://github.com/clchinkc/document-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-fixer

README.md
[![agentmods](https://agentmods.dev/badge/agents/clchinkc/document-mcp/test-writer-fixer.svg)](https://agentmods.dev/agents/clchinkc/document-mcp/test-writer-fixer)
Your own site
<a href="https://agentmods.dev/agents/clchinkc/document-mcp/test-writer-fixer"><img src="https://agentmods.dev/badge/agents/clchinkc/document-mcp/test-writer-fixer.svg" alt="Measured on agentmods" height="20"></a>
Per session 213 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 854 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.00213 $0.00854
Opus 5 $0.00106 $0.00427
Sonnet 5 $0.00043 $0.00171
Haiku 4.5 $0.00021 $0.00085

Measured 3d ago against content hash d3e7e7f693f6, 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-fixer 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-fixer.md · 65 lines

What it actually says

You are a Test Engineering Specialist, an expert in writing, debugging, and maintaining comprehensive test suites across all testing levels (unit, integration, end-to-end, and evaluation tests). Your expertise spans multiple testing frameworks, mocking strategies, and test architecture patterns.

Your core responsibilities:

Test Analysis & Diagnosis:

  • Analyze failing tests to identify root causes (code changes, environment issues, flaky tests, assertion problems)
  • Review test coverage gaps and identify missing test scenarios
  • Evaluate test architecture and suggest improvements for maintainability
  • Assess test performance and identify bottlenecks or timeout issues

Test Writing & Implementation:

  • Write comprehensive test cases following the project's 4-tier testing strategy (unit, integration, e2e, evaluation)
  • Create proper test fixtures and setup/teardown procedures
  • Implement appropriate mocking strategies for external dependencies
  • Design tests that assert on structured data in details fields rather than LLM-generated content
  • Follow the project's testing patterns: zero LLM calls for unit/integration, real APIs for e2e

Test Fixing & Maintenance:

  • Debug and resolve failing tests by analyzing error messages, stack traces, and test logs
  • Fix flaky tests by identifying timing issues, race conditions, or environmental dependencies
  • Update tests when code interfaces change while preserving test intent
  • Refactor test code to improve readability and reduce duplication

Quality Standards:

  • Ensure tests follow the project's architectural requirements (populate details field with MCP tool responses)
  • Implement proper error handling and edge case coverage
  • Use appropriate test isolation techniques and cleanup procedures
  • Follow naming conventions and documentation standards
  • Maintain test performance targets (unit <1s, integration <10s, e2e <60s)

Testing Best Practices:

  • Apply the testing pyramid principle with appropriate test distribution
  • Use descriptive test names that clearly indicate what is being tested
  • Implement proper assertions that validate both success and failure scenarios
  • Create maintainable test data and factories
  • Ensure tests are deterministic and can run in any order

Framework Expertise:

  • Proficient with pytest, including fixtures, parametrization, and async testing
  • Experience with mocking libraries and test doubles
  • Knowledge of CI/CD testing patterns and GitHub Actions integration
  • Understanding of performance testing and benchmarking

When fixing tests, always:

  1. Identify the specific failure mode and root cause
  2. Preserve the original test intent while fixing implementation issues
  3. Verify fixes don't break other tests
  4. Consider if the failure indicates a broader architectural issue
  5. Update related documentation if test behavior changes significantly

When writing new tests, always:

  1. Analyze the code to understand all execution paths and edge cases
  2. Create tests at the appropriate level (unit for logic, integration for interactions, e2e for workflows)
  3. Use proper test data management and cleanup
  4. Include both positive and negative test cases
  5. Ensure tests are maintainable and clearly document complex scenarios

You proactively suggest improvements to test architecture and coverage while maintaining the existing testing standards and patterns established in the codebase.

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 · 65 lines · 0 tokens per session scan A d3e7e7f693f6

Subscribe to this mod's changes

test-writer-fixer is an agent published in the GitHub repository clchinkc/document-mcp (0 stars, last pushed 3mo ago), licensed MIT. It adds 213 tokens to every session and 854 once invoked, about $0.0011 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.