microsoft/error-recovery
Standard recovery patterns for all squad agents. When something fails, adapt — don't just report the failure.
This is a copy. The original lives at microsoft/generative-ai-for-beginners-dotnet-error-recovery.
npx skills add https://github.com/microsoft/waza --skill error-recovery
Standard recovery patterns for all squad agents. When something fails, adapt — don't just report the failure.
When: Transient failures — API timeouts, rate limits, network errors, temporary service unavailability.
Pattern:
Example: API call returns 429 Too Many Requests → wait 2s → retry → wait 4s → retry → wait 8s → retry → escalate if still failing.
When: Primary tool or approach fails and an alternative exists.
Pattern:
Example: Primary CLI tool fails → fall back to direct API call for the same operation.
When: Build failures, test failures, linting errors — structured errors with actionable output.
Pattern:
Example: Build fails with a type error → check for missing import → add it → rebuild.
When: Recovery attempts have been exhausted, or the failure requires human judgment.
Pattern:
Example: After 3 failed build attempts → "Build fails on line 42 with null reference. Tried X, Y, Z. Likely a design issue in the Foo module. Recommend the code owner review."
When: A non-critical step fails but the overall task can still deliver value.
Pattern:
Example: Generating a report with 5 sections — section 3 data source is unavailable → produce the report with 4 sections, note that section 3 was skipped and why.
Each agent should reference these patterns in their charter's ## Error Recovery section, tailored to their domain. The charter should list the agent's most common failure modes and map each to the appropriate pattern above.
Selection guide:
| Failure Type | Primary Pattern | Fallback Pattern |
|---|---|---|
| Network/API transient | Retry with Backoff | Escalate with Context |
| Tool/dependency missing | Fallback Alternatives | Escalate with Context |
| Build/test error | Diagnose-and-Fix | Escalate with Context |
| Auth/permissions | Retry with Backoff | Escalate with Context |
| Non-critical data missing | Graceful Degradation | — |
| Unknown/novel error | Escalate with Context | — |
Take microsoft/error-recovery from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.