error-recovery
Skill94 starsChanged 7 months agoMITView on GitHub
Classify workflow failures and attempt automatic recovery. Use when sprint/feature fails during implementation to determine if auto-fix is possible or manual intervention required.
- Deletes or force-pushes
- Installs packages
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
- vshrinath/virtual-product-factorytheir own version, first seen Mar 17, 2026
- microsoft/Generative-AI-for-beginners-dotnettheir own version, first seen Mar 16, 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
- NoobyGains/godmode★ 107same 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 repository48 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/Agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- analysis-phaseSkill
- anti-duplicationSkill
- audit-claude-mdSkill
- breaking-change-detectorSkill
- caching-strategySkill
- clarification-phaseSkill
- create-agent-skillsSkill
- create-hooksSkill
- create-meta-promptsSkill
- create-slash-commandsSkill
- create-subagentsSkill
- debug-phaseSkill
- dependency-conflict-resolverSkill
- design-tokensSkill
- domain-memorySkill
- dry-runSkill
- epic-meta-promptingSkill
- epic-scopingSkill
- epic-sprintsSkill
- epic-walkthroughSkill
- finalize-phaseSkill
- git-workflow-enforcerSkill
- hallucination-detectorSkill
- implementation-phaseSkill
- mockup-extractionSkill
- multi-agent-votingSkill
- optimization-phaseSkill
- parallel-execution-optimizerSkill
- planning-phaseSkill
- production-deployment-phaseSkill
- project-initialization-phaseSkill
- regression-test-generatorSkill
- roadmap-integrationSkill
- session-boundarySkill
- shadcn-integrationSkill
- specification-phaseSkill
- staging-deployment-phaseSkill
- staging-validation-phaseSkill
- task-breakdown-phaseSkill
- task-status-syncSkill
- theme-consistencySkill
- ultrathinkSkill
- workflow-detectionSkill
- worktree-contextSkill
- x-announcementSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 10 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use this skill when:
- Distinctive: line 17
When a workflow component fails:
- Distinctive: line 21
If critical: Stop immediately, report to user
- Distinctive: line 22
If unknown: Treat as critical (safe default)
- Very specific: line 39
Action: Stop workflow, report error details, require /continue after manual fix.
- Distinctive: line 95
When: Test failures that aren't CI-related
- Distinctive: line 105
When: Import errors, module not found
- Distinctive: line 227
When escalating to user, provide structured report:
- Distinctive: line 260
Maximum 3 retry attempts: - Avoid infinite loops on persistent failures
- Distinctive: line 264
Respect auto-mode setting: - Only auto-fix when user opted in </constraints>
- Distinctive: line 268
After using this skill, verify:
“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
<objective>
Classify workflow failures into actionable categories and execute recovery strategies.Use this skill when:
- Sprint fails during /implement-epic
- Feature fails during /implement
- Quality gate blocks deployment
- Any workflow phase returns FAILED status
</objective>
<quick_start> When a workflow component fails:
- Classify the failure using the decision tree below
- If fixable: Execute auto-fix strategies (max 3 attempts)
- If critical: Stop immediately, report to user
- If unknown: Treat as critical (safe default)
Classification determines whether workflow can auto-recover or requires user intervention. </quick_start>
<failure_classification>
Critical Blockers (MUST STOP)
These failures require manual intervention - never auto-retry:
| Failure Type | Detection | Why Critical |
| CI Pipeline | ci_pipeline_failed: true in state.yaml | GitHub Actions/GitLab CI failed - indicates code issue |
| Security Scan | security_scan_failed: true | High/Critical CVEs found - security risk |
| Deployment | deployment_failed: true | Production/staging crashed - user-facing impact |
| Contract Violation | contract_violations > 0 | API contract broken - breaks consumers |
Action: Stop workflow, report error details, require /continue after manual fix.
Fixable Issues (CAN AUTO-RETRY)
These failures often resolve with automated fixes:
| Failure Type | Detection | Auto-Fix Strategies |
| Test Failures | tests_failed: true (no CI failure) | re-run-tests, check-dependencies |
| Build Failures | build_failed: true | clear-cache, reinstall-deps, rebuild |
| Dependency Issues | dependencies_failed: true | clean-install, clear-lockfile |
| Infrastructure | infrastructure_issues: true | restart-services, check-ports |
| Type Errors | type_check_failed: true | (manual fix usually required) |
Action: Attempt auto-fix strategies (max 3 attempts), then escalate if all fail.
Classification Decision Tree
Is CI pipeline failing?
├── Yes → CRITICAL (code issue, needs manual fix)
└── No → Continue...
Is security scan failing?
├── Yes → CRITICAL (security risk, needs review)
└── No → Continue...
Is deployment failing?
├── Yes → CRITICAL (production impact, needs rollback)
└── No → Continue...
Are tests failing (locally only)?
├── Yes → FIXABLE (try: re-run, check deps, clear cache)
└── No → Continue...
Is build failing?
├── Yes → FIXABLE (try: clear cache, reinstall, rebuild)
└── No → Continue...
Unknown failure?
└── CRITICAL (safe default - don't auto-retry unknown issues)</failure_classification>
<auto_fix_strategies>
Strategy Execution
Execute strategies in order until one succeeds. Progressive delays between attempts.
re-run-tests
# Tests may be flaky - simple re-run often works
cd "${SPRINT_DIR}" && npm test
# or: pytest, cargo test, etc.Timeout: 120s When: Test failures that aren't CI-related
check-dependencies
# Verify all dependencies installed
cd "${SPRINT_DIR}" && npm list --depth=0
# If missing deps found:
npm installTimeout: 120s When: Import errors, module not found
clear-cache
# Clear build/test caches
cd "${SPRINT_DIR}"
rm -rf .next .cache coverage node_modules/.cache dist build
npm run buildTimeout: 180s When: Stale cache causing build issues
clean-install
# Nuclear option for dependency issues
cd "${SPRINT_DIR}"
npm cache clean --force
rm -rf node_modules package-lock.json
npm installTimeout: 300s When: Corrupted node_modules, lockfile conflicts
rebuild
# Full rebuild from scratch
cd "${SPRINT_DIR}"
rm -rf dist build .next
npm run buildTimeout: 180s When: Build artifacts corrupted
restart-services
# Restart Docker/database services
docker-compose down
docker-compose up -d
sleep 10 # Wait for services to initializeTimeout: 150s When: Database connection failures, service unavailable
check-ports
# Kill processes blocking required ports
lsof -ti:3000,5432,6379 | xargs kill -9 2>/dev/null || trueTimeout: 30s When: Port already in use errors
Retry Logic
Attempt 1: Try all strategies in order
↓ (wait 5s)
Attempt 2: Try all strategies again
↓ (wait 10s)
Attempt 3: Final attempt
↓ (if still failing)
Escalate to user (all strategies exhausted)Maximum total retry time: ~15 minutes before escalation. </auto_fix_strategies>
<usage_in_commands>
How to Use This Skill
In implement-epic.md or implement.md:
When sprint/feature fails:
1. Load error-recovery skill:
Skill("error-recovery")
2. Classify failure:
- Read state.yaml for failure indicators
- Apply decision tree from skill
- Determine: CRITICAL or FIXABLE
3. If FIXABLE and auto-mode enabled:
- Execute strategies from skill (max 3 attempts)
- Re-check status after each attempt
- If recovered: continue workflow
- If exhausted: escalate
4. If CRITICAL or auto-fix exhausted:
- Stop workflow
- Report error with classification
- Instruct: "Fix manually, then /continue"Example Integration:
# After sprint execution returns failure
SPRINT_STATE=$(cat "${EPIC_DIR}/sprints/${SPRINT_ID}/state.yaml")
# Check for critical blockers first
if echo "$SPRINT_STATE" | grep -q "ci_pipeline_failed: true"; then
echo "CRITICAL: CI pipeline failed - manual fix required"
exit 1
fi
if echo "$SPRINT_STATE" | grep -q "security_scan_failed: true"; then
echo "CRITICAL: Security vulnerabilities detected - manual review required"
exit 1
fi
# Check for fixable issues
if echo "$SPRINT_STATE" | grep -q "tests_failed: true"; then
echo "FIXABLE: Tests failing - attempting auto-recovery..."
# Execute strategies from skill
fi</usage_in_commands>
<reporting>
## Error Reporting FormatWhen escalating to user, provide structured report:
═══════════════════════════════════════════════════════════════
❌ WORKFLOW FAILURE - Manual Intervention Required
═══════════════════════════════════════════════════════════════
Classification: CRITICAL | FIXABLE (exhausted)
Component: Sprint S01 | Feature F003 | Phase: optimize
Location: epics/001-auth/sprints/S01/state.yaml
Error Details:
Type: [ci_pipeline_failed | security_scan_failed | etc.]
Message: [Specific error message from logs]
Auto-Fix Attempts: 3/3 exhausted (if applicable)
- re-run-tests: Failed (timeout)
- clear-cache: Failed (build error persists)
- clean-install: Failed (same error)
Suggested Actions:
1. Review error logs in [path]
2. Fix the underlying issue
3. Run: /epic continue (or /feature continue)
═══════════════════════════════════════════════════════════════</reporting><constraints>
## Rules- Never auto-retry CRITICAL failures - These indicate real issues needing human judgment
- Maximum 3 retry attempts - Avoid infinite loops on persistent failures
- Progressive delays - 5s, 10s, 15s between attempts to avoid hammering
- Log all attempts - User needs visibility into what was tried
- Default to CRITICAL - Unknown failures should not be auto-retried
- Respect auto-mode setting - Only auto-fix when user opted in
</constraints>
<validation>
After using this skill, verify:- Failure was correctly classified (critical vs fixable)
- Auto-fix attempts logged with results
- User received clear error report if escalated
- Workflow state updated to reflect failure
- Recovery path documented (/continue instruction)
</validation>
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.

