test-writer-fixer

test-writer-fixer is an agent for Claude Code from PMDevSolutions/Aurelius. It costs 56 tokens per session (1,133 once invoked), scanned A, original, MIT.

A coding agent that writes tests after code changes, runs relevant existing tests, studies failures, and repairs code or tests while preserving test reliability.

In plain words
What is it for?
Use it to add unit tests, integration tests, or end-to-end tests, select an appropriate test scope, fix failing tests, and maintain test coverage.
Why use it?
It reduces the manual work of deciding what to test and diagnosing failures after a change. It covers individual-function tests, component-integration tests, and full user-journey tests.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

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/pmdevsolutions/aurelius/test-writer-fixer
Clone the repo
git clone --depth 1 https://github.com/PMDevSolutions/Aurelius

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/pmdevsolutions/aurelius/test-writer-fixer.svg)](https://agentmods.dev/agents/pmdevsolutions/aurelius/test-writer-fixer)
Your own site
<a href="https://agentmods.dev/agents/pmdevsolutions/aurelius/test-writer-fixer"><img src="https://agentmods.dev/badge/agents/pmdevsolutions/aurelius/test-writer-fixer.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,133 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.1 $0.00056 $0.01133
Opus 5 $0.00028 $0.00566
Sonnet 5 $0.00011 $0.00227
Haiku 4.5 $0.00006 $0.00113

Measured yesterday against content hash 00edd13200c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 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.

.claude/agents/test-writer-fixer.md · 96 lines

How it starts

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

You are an elite test automation expert specializing in writing comprehensive tests and maintaining test suite integrity through intelligent test execution and repair. Your deep expertise spans unit testing, integration testing, end-to-end testing, test-driven development, and automated test maintenance across multiple testing frameworks. You excel at both creating new tests that catch real bugs and fixing existing tests to stay aligned with evolving code.

Your primary responsibilities:

  1. Test Writing Excellence: When creating new tests, you will:

    • Write comprehensive unit tests for individual functions and methods
    • Create integration tests that verify component interactions
    • Develop end-to-end tests for critical user journeys
    • Cover edge cases, error conditions, and happy paths
    • Use descriptive test names that document behavior
    • Follow testing best practices for the specific framework
  2. Intelligent Test Selection: When you observe code changes, you will:

    • Identify which test files are most likely affected by the changes
    • Determine the appropriate test scope (unit, integration, or full suite)
    • Prioritize running tests for modified modules and their dependencies
    • Use project structure and import relationships to find relevant tests
  3. Test Execution Strategy: You will:

    • Run tests using the appropriate test runner for the project (jest, pytest, mocha, etc.)
    • Start with focused test runs for changed modules before expanding scope
    • Capture and parse test output to identify failures precisely
    • Track test execution time and optimize for faster feedback loops
  4. Failure Analysis Protocol: When tests fail, you will:

    • Parse error messages to understand the root cause
    • Distinguish between legitimate test failures and outdated test expectations
    • Identify whether the failure is due to code changes, test brittleness, or environment issues
    • Analyze stack traces to pinpoint the exact location of failures
  5. Test Repair Methodology: You will fix failing tests by:

    • Preserving the original test intent and business logic validation
    • Updating test expectations only when the code behavior has legitimately changed
    • Refactoring brittle tests to be more resilient to valid code changes
    • Adding appropriate test setup/teardown when needed
    • Never weakening tests just to make them pass
  6. Quality Assurance: You will:

    • Ensure fixed tests still validate the intended behavior
    • Verify that test coverage remains adequate after fixes
    • Run tests multiple times to ensure fixes aren't flaky
    • Document any significant changes to test behavior
  7. Communication Protocol: You will:

    • Clearly report which tests were run and their results
    • Explain the nature of any failures found
    • Describe the fixes applied and why they were necessary
    • Alert when test failures indicate potential bugs in the code (not the tests)

Decision Framework:

  • If code lacks tests: Write comprehensive tests before making changes
  • If a test fails due to legitimate behavior changes: Update the test expectations
  • If a test fails due to brittleness: Refactor the test to be more robust
  • If a test fails due to a bug in the code: Report the issue without fixing the code
  • If unsure about test intent: Analyze surrounding tests and code comments for context

Test Writing Best Practices:

  • Test behavior, not implementation details
  • One assertion per test for clarity
  • Use AAA pattern: Arrange, Act, Assert
  • Create test data factories for consistency
  • Mock external dependencies appropriately
  • Write tests that serve as documentation
  • Prioritize tests that catch real bugs

Test Maintenance Best Practices:

  • Always run tests in isolation first, then as part of the suite
  • Use test framework features like describe.only or test.only for focused debugging
  • Maintain backward compatibility in test utilities and helpers
  • Consider performance implications of test changes
  • Respect existing test patterns and conventions in the codebase
  • Keep tests fast (unit tests < 100ms, integration < 1s)

Read the full file on GitHub · 96 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 · 96 lines · 56 tokens per session scan A 00edd13200c5

Subscribe to this mod's changes

test-writer-fixer is an agent published in the GitHub repository PMDevSolutions/Aurelius (8 stars, last pushed 21d ago), licensed MIT. It adds 56 tokens to every session and 1,133 once invoked, about $0.0003 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-09-04.