test-fix

test-fix is a skill for Claude Code from jerseycheese/agent-skills. It costs 91 tokens per session (1,336 once invoked), scanned A, original, MIT.

An automatic workflow for fixing failed software tests, including unit tests and end-to-end tests. Test-driven debugging means reading the failure, finding its cause, and trying a focused fix.

In plain words
What is it for?
Use it when tests fail after a change, when end-to-end checks break, or when tests are flaky or intermittently failing.
Why use it?
It prevents repeated, unfocused debugging by limiting work on each failure to three attempts before asking for a decision. It separates test failures from build, type, and lint errors.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the workflow-skills plugin — 31 skills shipped together

Good fit Use it when tests fail after a change, when end-to-end checks break, or when tests are flaky or intermittently failing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jerseycheese/agent-skills/test-fix
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.

Any agent
npx skills add jerseycheese/agent-skills --skill test-fix
Clone the repo
git clone --depth 1 https://github.com/jerseycheese/agent-skills

Made for: Claude Code.

Or install workflow-skills, the plugin that ships this one along with the rest of its 31 skills.

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-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/jerseycheese/agent-skills/test-fix.svg)](https://agentmods.dev/skills/jerseycheese/agent-skills/test-fix)
Your own site
<a href="https://agentmods.dev/skills/jerseycheese/agent-skills/test-fix"><img src="https://agentmods.dev/badge/skills/jerseycheese/agent-skills/test-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,336 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00091 $0.01336
Opus 5 $0.00046 $0.00668
Sonnet 5 $0.00018 $0.00267
Haiku 4.5 $0.00009 $0.00134

Measured 7d ago against content hash fc0ff2908459, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

test-fix 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 7d 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.

skills/test-fix/SKILL.md · 186 lines

How it starts

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

When to invoke (auto-trigger)

Invoke automatically whenever:

  • A test run outputs one or more FAIL results
  • npm test, jest, or playwright exits with a non-zero code due to test failures (not config errors)
  • The user says tests are broken or a CI check is red on tests

Do NOT invoke for: build errors, type errors, lint failures — those are not test failures. Hard stop at 3 attempts; do not loop.

Test Fix with Attempt Budget

When to Use This Skill

Use this skill when:

  • E2E tests are failing
  • Unit tests are failing after code changes
  • Tests are flaky or intermittent
  • Previous fix attempts haven't worked

Critical Rule

Maximum 3 fix attempts per test. After 3 failures, STOP and present options to the user.

Fix Attempt Checklist

For each failing test, follow this process:

Attempt 1: Understand and Fix Obvious Issues

  1. Read the test file

    • Understand what the test is checking
    • Identify all selectors, assertions, and expectations
    • Note any timing assumptions (waits, animations, async operations)
  2. Identify the failure

    • Read the error message carefully
    • Determine if it's a selector issue, timing issue, or logic issue
    • Check if the test expects specific DOM state
  3. Apply the most obvious fix

    • Fix broken selectors
    • Add necessary waits for async operations
    • Update assertions to match current behavior (if behavior is correct)
  4. Run the test

    • Run ONLY this test, not the full suite
    • Document the result: PASS or FAIL (with error)

Attempt 2: Investigate Deeper

If Attempt 1 failed:

  1. Read related component source code

    • Find the component(s) being tested
    • Trace selectors to their definitions
    • Look for race conditions or state dependencies
  2. Check for environmental issues

    • Is the dev server running? (don't restart it)
    • Are there dependencies on other tests?
    • Are there timing issues with animations or transitions?
  3. Apply the fix addressing root cause

    • Fix race conditions with proper waits
    • Update test to handle async state changes
    • Fix component code if bug is there, not in test

Read the full file on GitHub · 186 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. 7d ago First seen · 186 lines · 91 tokens per session scan A fc0ff2908459

Subscribe to this mod's changes

test-fix is a skill published in the GitHub repository jerseycheese/agent-skills (1 stars, last pushed 6d ago), licensed MIT. It adds 91 tokens to every session and 1,336 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

test-master

Generates test files, creates mocking strategies, analyzes code coverage, designs test architectures, and produces test plans and defect reports across functional, performance, and security testing disciplines. Use when writing unit tests, integration tests, or E2E tests; creating test strategies or automation…

eric861129/SKILLS_All-in-one · 104 tokens

prodtest

Senior-QA test pass on a newly implemented feature. Detects the project's real test stack, writes unit and functional/integration tests, then drives the running app with Playwright for end-to-end coverage, saving screenshots to a gitignored folder for human review. Asks upfront whether found bugs should be fixed or…

nazmulnahid-git/Ai-Stack · 90 tokens

test-agent

You are the Test agent for this project. You own unit, component, integration, and E2E tests, plus test fixtures and test infrastructure.

machbuilds/atom · 0 tokens

tdd-workflow

Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.

pm-bhatt/everything-gemini-cli · 43 tokens

memstack-development-test-writer

Use this skill when the user says 'write tests', 'add tests', 'test coverage', 'unit tests', 'integration tests', 'component tests', 'mocking', 'edge cases', or needs to generate tests with proper mocking and edge case coverage. Do NOT use for refactoring plans or database migrations.

cwinvestments/memstack · 70 tokens

testing-blocks

Use this when you have made AEM Edge Delivery Services code changes to blocks, scripts, or styles and need to validate them before opening a pull request. Covers unit testing for utilities and logic, browser testing with Playwright, linting, and guidance on what to test and how.

adobe/skills · 61 tokens