test-fix
Skill4 starsChanged 16 days agoMITView on GitHub
Automatically invoke when any test run produces failures: FAIL output, test errors, or assertion failures in unit or E2E suites. Do NOT wait for the user to ask. Hard limit of 3 fix attempts per failure, then stops and escalates. Trigger on: "tests are failing", "fix the tests", "tests are broken".
3 other projects use a version of this.
Adopted by
Most recently taken up by
- drobins25/crafttheir own version, first seen Oct 11, 2026
- liferay/liferay-portaltheir own version, first seen Oct 8, 2026
- tlzmw001/aitest-kittheir own version, first seen Aug 13, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- liferay/liferay-portal★ 2.3ksame name
- drobins25/craft★ 73same name
- tlzmw001/aitest-kit★ 13same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- abstraction-finderSkill
- analyze-issueSkill
- backlog-routingSkill
- band-aid-finderSkill
- browser-debugger-cliSkill
- ci-fix-with-memorySkill
- code-health-auditSkill
- comment-reaperSkill
- cyoaSkill
- dead-code-cleanupSkill
- doc-rotSkill
- drupal-mental-modelSkill
- ds-guardSkill
- evidence-checkSkill
- github-screenshotSkill
- issue-maintenanceSkill
- kissSkill
- plain-language-auditSkill
- post-mergeSkill
- prioritize-issuesSkill
- project-bootstrapSkill
- project-pulseSkill
- pr-review-fix-pipelineSkill
- routeSkill
- ship-issueSkill
- skill-paritySkill
- tdd-implementSkill
- test-reaperSkill
- test-workflowSkill
- update-routingSkill
- visual-crawlSkill
- visual-qa-pipelineSkill
- worktree-enhancedSkill
- wrap-it-upSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 20 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Do NOT invoke for: build errors, type errors, lint failures — those are not test failures.
- Distinctive: line 23
Use this skill when:
- Distinctive: line 31
Maximum 3 fix attempts per test: After 3 failures, STOP and present options to the user.
- Distinctive: line 45
Read the error message carefully
- Distinctive: line 47
Check if the test expects specific DOM state
- Distinctive: line 51
Add necessary waits for async operations
- Distinctive: line 52
Update assertions to match current behavior (if behavior is correct)
- Distinctive: line 55
Run ONLY this test, not the full suite
- Distinctive: line 56
Document the result: PASS or FAIL (with error)
- Distinctive: line 65
Look for race conditions or state dependencies
- Distinctive: line 74
Update test to handle async state changes
- Distinctive: line 153
If any attempt succeeds (test passes):
- Distinctive: line 161
If multiple tests are failing:
- Distinctive: line 164
Don't let failures from one test influence approach to others
- Distinctive: line 165
If 2+ tests fail after 3 attempts each, suggest grouping the summary
- Distinctive: line 171
Run commands that would stop the dev server
- Distinctive: line 172
Start a new dev server if one is already running
- Distinctive: line 175
Verify dev server is running before running tests
- Distinctive: line 176
Run tests in a separate process from the dev server
- Distinctive: line 177
Ask user if you need to start the dev server
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
When to invoke (auto-trigger)
Invoke automatically whenever:
- A test run outputs one or more FAIL results
npm test,jest, orplaywrightexits 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
- Read the test file
- Understand what the test is checking
- Identify all selectors, assertions, and expectations
- Note any timing assumptions (waits, animations, async operations)
- 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
- Apply the most obvious fix
- Fix broken selectors
- Add necessary waits for async operations
- Update assertions to match current behavior (if behavior is correct)
- 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:
- Read related component source code
- Find the component(s) being tested
- Trace selectors to their definitions
- Look for race conditions or state dependencies
- 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?
- 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
- Run the test again
- Document the result: PASS or FAIL (with error)
Attempt 3: Verify Assumptions
If Attempt 2 failed:
- Question your assumptions
- Is the test checking the right thing?
- Has the component behavior changed legitimately?
- Is the test environment set up correctly?
- Try alternative approach
- Different selector strategy
- Different waiting strategy
- Different assertion method
- Run the test one final time
- Document the result: PASS or FAIL (with error)
After 3 Failed Attempts
STOP. Do not attempt a 4th fix.
Present this summary to the user:
## Test Fix Summary: [TEST_NAME]
### Attempts Made
1. **Attempt 1**: [What you tried]
- Result: FAIL - [error message]
- Theory: [What you thought was wrong]
2. **Attempt 2**: [What you tried]
- Result: FAIL - [error message]
- Theory: [What you thought was wrong]
3. **Attempt 3**: [What you tried]
- Result: FAIL - [error message]
- Theory: [What you thought was wrong]
### Root Cause Hypothesis
[Your best understanding of why this test is failing]
### Options for Next Steps
**(a) Skip the test with a TODO**
- Add `.skip` to the test
- Add TODO comment explaining the issue
- Create a GitHub issue to track fixing it later
- Allows PR to move forward
**(b) Rewrite the test with a different approach**
- Current test may have flawed assumptions
- Could use different testing strategy
- Need your input on what approach to take
**(c) Debug manually (what I'd need from you)**
- [Specific information you could provide]
- Browser DevTools output
- Component state inspection
- Manual test of the flow
- [Specific actions you could take]
- Run test with headed browser
- Add debug logging to component
- Verify test environment
### Recommendation
[Which option (a), (b), or (c) seems most appropriate and why]Then wait for the user's decision.
Success Case
If any attempt succeeds (test passes):
- Report success
- Explain what the issue was
- Explain what fixed it
- Suggest running the full test suite to check for regressions
Multiple Failing Tests
If multiple tests are failing:
- Work on them one at a time
- Each test gets its own 3-attempt budget
- Don't let failures from one test influence approach to others
- If 2+ tests fail after 3 attempts each, suggest grouping the summary
Dev Server Protection
NEVER:
- Kill or restart the dev server during test debugging
- Run commands that would stop the dev server
- Start a new dev server if one is already running
ALWAYS:
- Verify dev server is running before running tests
- Run tests in a separate process from the dev server
- Ask user if you need to start the dev server
Notes
- This skill is based on the user's experience with 10+ iteration spirals on E2E tests
- The 3-attempt limit forces acknowledgment when the approach isn't working
- Presenting options lets the user pick the next step
- Skipping a test is a valid outcome - it's better than wasting hours
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

