# Test Fix

> Diagnose, classify, and repair failing Vitest, Jest, or Playwright tests with minimal, safe patches.

Test Fix is a paid AI agent skill on Agensi by Rowin Luximon, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $9 (one-time purchase)
- Creator: [Rowin Luximon](https://www.agensi.io/creators/winsoftlabs30)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Version: 1.0
- Last updated: 2026-11-25
- Security: scan passed (2026-11-23); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/test-fix
- Tags: testing, vitest, jest, playwright, node-js, debugging

## About this skill

Debug and repair failing test suites without compromising code quality. This skill handles the cycle of identifying failures, isolating flakiness, and generating minimal patches for approval. It eliminates the tedious process of manually re-running tests to verify consistency and prevents the common mistake of weakening assertions just to make a suite green.

### What it does
- **Auto-detection** identifies Vitest, Jest, or Playwright runners from `package.json` automatically.
- **Flake classification** re-runs failing tests to distinguish between consistent bugs and intermittent flakes.
- **Root cause analysis** evaluates whether a failure stems from a production bug or an outdated test assertion.
- **Minimal patching** generates unified diffs for the smallest possible fix required to restore the suite.
- **Safety reporting** creates a patch registry with risk assessments and rationales before any code is modified.

### How it works
1. **Diagnose** by running the test suite via the provided Node scripts to capture a JSON snapshot of all failures.
2. **Classify** by re-executing failing files to separate `consistent` failures from `flaky` ones.
3. **Judge** each failure by reviewing source code and documentation to determine if the bug is in the code or the test.
4. **Propose** fixes by writing unified diffs and risk levels to a local `patches/` directory.
5. **Report** the verdict and wait for explicit user approval before applying any specific patch.

### Frameworks & tools
Built for Node 22.6+ environments. Supported runners include Vitest, Jest, and Playwright. The skill uses custom TypeScript scripts for test execution and classification.

### Why this beats prompting it yourself
Standard prompts often "hallucinate" passes by simply skipping tests or adding arbitrary timeouts. This skill enforces a strict diagnostic workflow that requires proof before changing an assertion and explicitly forbids weakening the test suite.

### Use cases
- Stabilizing a CI/CD pipeline plagued by intermittent test failures.
- Resolving regressions after a major dependency update or refactor.
- Cleaning up a legacy test suite with inherited technical debt.

### Known limitations
Requires Node 22.6 or higher for optimized script execution. Cannot automatically fix flaky tests; these are reported for manual review to avoid masking race conditions.

## Requires

- Node.js 22.6+
- A project using Vitest, Jest or Playwright
- vitest
- jest

A free manual edition (workflow and rules, no scripts) is public under MIT-0: github.com/WinSoftLabs30/test-fix-skill. This paid edition adds the two tested scripts and their suite.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Test Fix skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Which testing frameworks and environments is Test Fix compatible with?

This skill supports Node.js environments (version 22.6+) and is compatible with the Vitest, Jest, and Playwright testing frameworks. It automatically detects your runner by analyzing your package.json file during the diagnostic phase.

### How does this skill prevent 'hallucinations' or the weakening of my test assertions?

Unlike simple prompts that might delete failing tests to "fix" them, Test Fix follows a strict diagnostic workflow. It classifies failures as consistent or flaky and generates minimal, safe patches that preserve test integrity rather than just making the suite turn green.

### Will Test Fix automatically apply changes to my code?

No, the skill never modifies your source code without permission. It generates a unified diff and a risk assessment for each fix in a local directory, requiring your explicit approval before any patches are applied to your codebase.

### Does this skill automatically repair flaky tests?

Test Fix handles flaky tests by isolating and reporting them rather than attempting a 'blind' fix. This ensures that underlying race conditions or environmental issues are brought to your attention for manual review instead of being masked by arbitrary timeouts.

### What is included in the purchase of the Test Fix skill?

You will receive the full suite of custom TypeScript diagnostic scripts, the AI agent workflow for root cause analysis, and a comprehensive guide for integrating the skill into your local development or CI/CD environment.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
