- Home
- Skills
- Testing & Debugging
- Test Fix
Works with the AI Agents you already use
Test Fix
Diagnose, classify, and repair failing Vitest, Jest, or Playwright tests with minimal, safe patches.
$9
Test Fix
Example session with this skill installed
Fix the failing tests in the current directory and make the suite green.
- Read your context and instructions
- Compiled the test fix
I have analyzed the test suite. The diagnostic run identified 3 failures across the Vitest suite. After re-running the failing files, I classified one as a flake and two as consistent bugs requiring patches.
Verdict: 3 failures: 1 source bug, 1 wrong test, 1 flaky — patches in patches/, nothing applied yet.
Test Failure Analysis
| Failure | Cause | Risk | Patch File |
|---|---|---|---|
auth.service.spec.ts > login() | source bug | Low | patches/01.md |
ui.component.spec.ts > render() | wrong test | Med | patches/02.md |
api.integration.ts > fetch() | flaky | N/A | Reported only |
Proposed Patch: patches/01.md
--- src/services/auth.service.ts
+++ src/services/auth.service.ts
@@ -42,1 +42,1 @@
- if (user.attempts > 5) return false;
+ if (user.attempts >= 5) return false;
Rationale: The auth service allowed 6 attempts due to an off-by-one error, while the specification requires a lockout at the 5th attempt.
Risk: Low.
Proposed Patch: patches/02.md
--- src/components/ui.component.spec.ts
+++ src/components/ui.component.spec.ts
@@ -12,1 +12,1 @@
- expect(label).toBe('Submit');
+ expect(label).toBe('Send');
Rationale: The test expected 'Submit', but the updated design docs and production code correctly use 'Send'.
Risk: Medium.
Next steps
- Review
patches/01.mdand approve to fix the auth service logic. - Review
patches/02.mdto confirm the UI label change matches the new spec. - Investigate the
api.integration.tsflake manually as it may indicate a network race condition.
Connects securely to your tools. The creator never sees your data.
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.jsonautomatically. - 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
- Diagnose by running the test suite via the provided Node scripts to capture a JSON snapshot of all failures.
- Classify by re-executing failing files to separate
consistentfailures fromflakyones. - Judge each failure by reviewing source code and documentation to determine if the bug is in the code or the test.
- Propose fixes by writing unified diffs and risk levels to a local
patches/directory. - 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.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 11 days ago
- Software
Node.js 22.6+
A project using Vitest, JestorPlaywrightvitestjest
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.
Permissions
File Scopes
Shell runs your project's own test commands. Writes are limited to the JSON report path and proposed patches. The scripts make no network calls and send no telemetry; npx may install your own runner if it is not installed yet.
What's inside
Frequently Asked Questions
New in Testing & Debugging
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.