# test-writer-fixer

test-writer-fixer creates missing test suites, runs test runners after code changes, and updates failing checks. It keeps your test suite aligned with refactored logic.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 2003 repo stars
- Author: Community
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/composio-community/awesome-claude-plugins/tree/HEAD/test-writer-fixer/agents/test-writer-fixer.md
- Updated: 2026-07-26
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/test-writer-fixer

## What it does

This subagent handles test workflows after feature additions or refactoring. It determines affected test files, targets the needed scope, and runs test runners like `jest` or `pytest`. Terminal output and stack traces are analyzed to locate the root cause of each failure.

Test repair follows strict rules. When application behavior intentionally changes, the subagent updates test assertions. For fragile assertions, it restructures the test using the Arrange-Act-Assert pattern. If an actual defect in the application code causes the failure, the agent reports the bug instead of modifying the source code.

Suites run in isolation before running the entire suite to filter out flaky behavior. The agent follows explicit execution targets: under 100ms for unit tests and under 1s for integration runs.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add composio-community/awesome-claude-plugins
```
In the agent chat (not a shell):
```text
/plugin install test-writer-fixer@awesome-claude-plugins
```

2. **Manually: put the files in place**
- File: `.claude/agents/test-writer-fixer.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/test-writer-fixer.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/test-writer-fixer.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/composio-community/awesome-claude-plugins/tree/HEAD/test-writer-fixer/agents/test-writer-fixer.md

## When to use it
- generate unit and integration suites for untested modules
- detect breaking regressions after refactoring function signatures
- diagnose failure root causes from stack traces and runner output
- adjust obsolete assertions when code behavior changes intentionally
- refactor fragile test cases without lowering assertion strictness

## Example prompts
- I updated the authentication module to OAuth, run test-writer-fixer to catch regressions
- Our payment processing module has no tests, create unit tests for edge cases and errors
- Several tests failed after async refactoring, analyze the errors and update the assertions

## Similar
- [agent-5-test-writer](https://affpapa.org/en/nevibecode/agents/agent-5-test-writer.md) — subagent · ★ 138 repo stars
- [unit-testing-framework](https://affpapa.org/en/nevibecode/skills/unit-testing-framework.md) — skill · 633 installs
- [test-generate](https://affpapa.org/en/nevibecode/commands/test-generate.md) — command · ★ 42780 repo stars
- [test-generator](https://affpapa.org/en/nevibecode/skills/test-generator.md) — skill · ★ 788 repo stars
- [test-guard](https://affpapa.org/en/nevibecode/skills/test-guard.md) — skill · 4400 installs
- [test-driven-development](https://affpapa.org/en/nevibecode/skills/bobmatnyc-test-driven-development.md) — skill · 409 installs

From the same set: [composio-community/awesome-claude-plugins](https://affpapa.org/en/nevibecode/by/composio-community/awesome-claude-plugins.md) — 68 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
