Error Recovery Patterns Skill

Implements retry, circuit breaker, fallback, and rollback patterns for application error recovery.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/fabioc-aloha/AlexAgent --skill error-recovery-patterns-skill-fabioc-aloha
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Error Recovery Patterns Skill
Source: https://github.com/fabioc-aloha/AlexAgent/tree/main/plugin/skills/error-recovery-patterns
Command: npx skills add https://github.com/fabioc-aloha/AlexAgent --skill error-recovery-patterns-skill-fabioc-aloha

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Applications fail in production due to network timeouts, rate limits, and server errors, and without structured recovery logic these failures cascade into outages. This Skill provides concrete patterns for deciding when to retry, when to fall back, and how to roll back safely. ## Core Features & Use Cases - Retry Decision Rules: Distinguishes retryable failures (timeouts, 429, 5xx) from non-retryable ones (400, 401, 404, business logic errors) to avoid wasted attempts. - Backoff and Circuit Breakers: Provides exponential backoff with jitter formulas and the CLOSED/OPEN/HALF-OPEN circuit breaker state machine. - Fallback and Rollback Patterns: Covers default values, cached responses, degraded service modes, database transactions, sagas, and feature flags. - Use Case: When an API call to a payment service starts timing out, apply the retry-with-backoff pattern for transient failures, trip a circuit breaker after repeated failures, and serve a cached fallback response instead of crashing the checkout flow. ## Quick Start Ask the agent to load the error-recovery-patterns skill and design retry and fallback logic for your failing API integration.

Frequently Asked Questions about Error Recovery Patterns Skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement retry with exponential backoff in TypeScript?▼

Calculate delay as baseDelay multiplied by 2 raised to (attempt - 1), then add random jitter up to 30% of the delay to avoid thundering herd. Await a sleep of delay plus jitter between attempts.

Which HTTP errors should I retry and which should I not?▼

Retry network timeouts, rate limits (429), server errors (5xx), and connection refused. Do not retry validation errors (400), auth failures (401, 403), not found (404), or business logic errors, since retrying those will fail identically.

How does a circuit breaker pattern work?▼

A circuit breaker starts CLOSED, opens when failures exceed a threshold, then transitions to HALF-OPEN after a timeout to test recovery. A successful call in HALF-OPEN closes the circuit again, preventing repeated calls to a failing service.

What fallback pattern should I use when an API call fails?▼

Use a default value for configuration loading, a cached value for data fetch failures, or a degraded service mode for non-critical features. In code, chain the fallback with primary().catch(() => fallback()).

When should I use a saga instead of a database transaction for rollback?▼

Use database transactions for atomic operations within a single database. Use sagas with compensating actions for distributed transactions spanning multiple services, and feature flags when you need instant rollback of a deployed change.