Agent skill
Error Recovery Patterns Skill
What to do when things break.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/error-recovery-patterns
SKILL.md
Error Recovery Patterns Skill
What to do when things break.
Recovery Hierarchy
Prevent → Detect → Contain → Recover → Learn
Retry Rules
| Retry | Don't Retry |
|---|---|
| Network timeouts | Validation errors (400) |
| Rate limits (429) | Auth failures (401, 403) |
| Server errors (5xx) | Not found (404) |
| Connection refused | Business logic errors |
Retry with Backoff
const delay = baseDelay * Math.pow(2, attempt - 1);
const jitter = Math.random() * 0.3 * delay;
await sleep(delay + jitter);
Circuit Breaker States
CLOSED → (failures > threshold) → OPEN → (timeout) → HALF-OPEN → (success) → CLOSED
Fallback Patterns
| Pattern | Use Case |
|---|---|
| Default value | Config loading |
| Cached value | Data fetch failure |
| Degraded service | Non-critical features |
const result = await primary().catch(() => fallback());
Rollback Patterns
| Pattern | Use Case |
|---|---|
| DB transaction | Atomic operations |
| Saga (compensate) | Distributed transactions |
| Feature flag | Instant rollback |
Error Boundaries
Contain failures to prevent cascade. Catch at component boundaries, log, show fallback UI.
Synapses
See synapses.json for connections.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?