error-recovery
Skill107 starsChanged 9 months agoMITView on GitHub
Use when repeated fix attempts fail, the agent appears stuck in a loop, or complexity is increasing without progress
11 other projects use a version of this.
Adopted by
Most recently taken up by
- microsoft/fsi-banking-payments-dispute-resolution-acceleratortheir own version, first seen Aug 14, 2026
- jnotsknab/mux-swarmtheir own version, first seen Jun 29, 2026
- microsoft/wazatheir own version, first seen Jun 15, 2026
- github/gh-awtheir own version, first seen May 27, 2026
- marcusgoll/Spec-Flowtheir own version, first seen Apr 23, 2026
- vshrinath/virtual-product-factorytheir own version, first seen Mar 17, 2026
Used with
Projects with it also use {skill-name}.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkill{skill-name}
{what this skill teaches agents}
Also in 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- github/gh-aw★ 5.3ksame name
- microsoft/Generative-AI-for-beginners-dotnet★ 3.1ksame name
- microsoft/waza★ 1.4ksame name
- Azure/fleet★ 226same name
- marcusgoll/Spec-Flow★ 94same name
- devsforge/orchestrator★ 38same name
- vshrinath/virtual-product-factory★ 16same name
- troykelly/claude-skills★ 11same name
- jnotsknab/mux-swarm★ 9same name
- Dragoon0x/product-skills★ 4same name
1 more not listed
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 repository35 other files it gives its agents.
- activationSkill
- agent-messagingSkill
- codebase-researchSkill
- completion-gateSkill
- comprehension-checkSkill
- delegated-executionSkill
- deployment-advisorSkill
- design-integrationSkill
- design-researchSkill
- environment-awarenessSkill
- fault-diagnosisSkill
- github-searchSkill
- intent-discoverySkill
- knowledge-captureSkill
- merge-protocolSkill
- parallel-executionSkill
- pattern-matchingSkill
- performance-tuningSkill
- project-bootstrapSkill
- protocol-authoringSkill
- quality-enforcementSkill
- quality-gateSkill
- rationaleSkill
- reference-engineSkill
- review-responseSkill
- security-protocolSkill
- specification-firstSkill
- system-designSkill
- task-planningSkill
- task-runnerSkill
- team-orchestrationSkill
- test-firstSkill
- ui-engineeringSkill
- ux-patternsSkill
- workspace-isolationSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 11 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
11
Distinctive
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 20
Before EVERY fix attempt, state: "This is attempt N of the current issue." If N >= 3, you are not authorized to continue without user …
- Distinctive: line 31
Test suite results getting worse, not better
- Distinctive: line 34
This skill overrides optimism: When triggered, it takes priority over whatever strategy is currently failing.
- Distinctive: line 61
If you cannot identify a different approach, escalate to Orange immediately
- Distinctive: line 80
Wait for user input before proceeding
- Distinctive: line 81
If the user says continue, reset to Yellow with the new direction
- Distinctive: line 115
When a fix fails, apply these in order:
- Distinctive: line 117
Re-read the actual error message: Not your interpretation of it -- the literal text.
- Distinctive: line 119
Try a fundamentally different approach: Not a variation. If you were editing config, try code.
- Distinctive: line 127
Rollback to last known-good state: If you have made things worse, undo all changes and return to where things last worked.
- Distinctive: line 158
STOP and activate this skill if you observe:
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Error Recovery
Overview
AI agents get stuck. They try the same approach repeatedly, add complexity to fix complexity, and rationalize "one more attempt" long past the point of diminishing returns. This skill detects stuck patterns proactively and forces recovery before wasted effort compounds.
Core principle: Track every failed attempt. Escalate at defined thresholds. Never allow unbounded retries.
The Prime Directive
NO CONTINUED ATTEMPTS WITHOUT ACKNOWLEDGING FAILURE COUNTBefore EVERY fix attempt, state: "This is attempt N of the current issue." If N >= 3, you are not authorized to continue without user direction.
When to Use
This skill activates automatically when any of these patterns appear:
- Same error message after 2+ attempted fixes
- A fix for problem A introduces problem B
- File edited 3+ times for the same issue without resolution
- Increasing line count or complexity with each attempt
- "Let me try one more thing" after 2+ failures
- Test suite results getting worse, not better
- Reverting a fix and trying a variation of the same approach
This skill overrides optimism. When triggered, it takes priority over whatever strategy is currently failing.
Failure Counter
You MUST maintain an internal failure counter for each distinct issue:
FAILURE LOG
Issue: [description]
Attempt 1: [what you tried] -> [result]
Attempt 2: [what you tried] -> [result]
Attempt 3: [what you tried] -> [result] <- STOP HERERules:
- Increment the counter for every attempted fix, including "small tweaks"
- A variation of the same approach counts as a new attempt
- Reverting and retrying counts as a new attempt
- The counter resets ONLY when the issue is resolved or the user explicitly resets scope
Severity Levels
Yellow -- 2 Failed Attempts
- Log the concern explicitly: "Two attempts have failed for [issue]."
- Identify what both attempts had in common
- Your next attempt MUST use a fundamentally different approach
- If you cannot identify a different approach, escalate to Orange immediately
Orange -- 3 Failed Attempts
- STOP all fix attempts.
- Step back completely. Re-read the original error from scratch
- Re-analyze the problem as if seeing it for the first time
- List what you know, what you assumed, and what you have not verified
- Formulate a new hypothesis that contradicts your previous assumptions
- Present the situation to the user: "Three attempts have failed. Here is my revised analysis."
Red -- 4+ Failed Attempts
- HALT. Do not continue without explicit user direction.
- Present an honest assessment:
- What you tried (all attempts, briefly)
- What you learned from each failure
- What you believe the actual problem might be
- What you recommend as next steps (including "I may not be able to solve this")
- Wait for user input before proceeding
- If the user says continue, reset to Yellow with the new direction
Escalation Flowchart
digraph recovery {
rankdir=TB
node [shape=box]
start [label="Fix attempt fails"]
count [label="Increment failure counter"]
check [label="How many failures?"]
yellow [label="YELLOW: Log concern\nTry fundamentally different approach"]
orange [label="ORANGE: STOP\nRe-analyze from scratch\nPresent revised analysis"]
red [label="RED: HALT\nPresent honest assessment\nWait for user direction"]
resolved [label="Issue resolved\nReset counter"]
user [label="User provides direction\nReset to Yellow"]
start -> count
count -> check
check -> yellow [label="2"]
check -> orange [label="3"]
check -> red [label="4+"]
yellow -> start [label="Next attempt fails"]
yellow -> resolved [label="Fix works"]
orange -> start [label="New hypothesis\nattempt fails"]
orange -> resolved [label="Fix works"]
red -> user [label="User responds"]
user -> start [label="New attempt"]
}Recovery Strategies
When a fix fails, apply these in order:
- Re-read the actual error message. Not your interpretation of it -- the literal text. Errors frequently contain the answer.
- Try a fundamentally different approach. Not a variation. If you were editing config, try code. If you were patching, try replacing. If you were adding, try removing.
- Simplify ruthlessly. Strip the problem to its smallest reproducible case. Remove everything non-essential. Test the simplest possible version.
- Verify your assumptions. Print values. Check types. Confirm the file you think you are editing is the one actually being executed. Confirm the function you think is being called is actually being called.
- Escalate with honesty. Tell the user: "I have tried N approaches. None worked. Here is what I know and what I recommend."
- Rollback to last known-good state. If you have made things worse, undo all changes and return to where things last worked. Start fresh from there.
Anti-Patterns to Block
These patterns indicate the agent is stuck and MUST trigger this skill:
| Anti-Pattern | What to Do Instead |
| "Let me try one more thing" (after 3+ failures) | STOP. You said that last time. Escalate. |
| Adding complexity to fix complexity | Simplify. Remove code. Reduce moving parts. |
| Ignoring the error message, trying random changes | Read the error. It is telling you something specific. |
| Blaming the environment ("must be a cache issue") | Verify the claim. Run a clean build. Check actually. |
| Widening scope instead of narrowing it | Focus on the smallest failing case, not the whole system. |
| Editing the same file repeatedly | Step back. The problem may not be in that file. |
| "It should work" without verifying | Run it. Check output. Trust evidence, not expectations. |
| Fixing the test instead of the code | The test is probably right. Fix what it is testing. |
Cognitive Traps
| Rationalization | Reality |
| "This is a different issue" | If it appeared while fixing the original, it is the same issue. Count it. |
| "I almost had it last time" | Almost does not count. Two near-misses is a pattern, not progress. |
| "The approach is right, just needs tweaking" | Three tweaks of the same approach is not three different attempts. |
| "I need to understand the whole system first" | You need to understand the failing part. Scope down, not up. |
| "Let me refactor first, then fix" | Refactoring while debugging creates two problems. Fix first. |
| "This is an edge case" | If it blocks completion, it is a primary case. |
| "One more log statement will reveal it" | If three log statements did not help, you are looking in the wrong place. |
Guardrails
STOP and activate this skill if you observe:
- You have edited the same file 3+ times for one issue
- Your fix introduced a new failure
- You are writing more code to handle an error than the original feature
- The test suite has more failures now than when you started
- You are suppressing errors or warnings instead of fixing them
- You are about to say "let me try" for the 3rd+ time
- Your solution is more complex than the original problem
- You have been working on the same error for more than 10 minutes of active attempts
Connections
- godmode:fault-diagnosis -- Error recovery activates when fault diagnosis is not converging. If Phase 4 has failed 3+ times, this skill takes over.
- godmode:completion-gate -- After recovery, use completion-gate to verify the fix actually holds. Prevents false "done" claims after a recovery sequence.
- godmode:test-first -- Recovery should include writing a test that reproduces the exact failure. A fix without a regression test is not complete.
- godmode:task-planning -- If recovery reveals the task was scoped wrong, return to task planning to re-scope before continuing.
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.

