error-handling-skill

Generates retry logic, circuit breakers, dead-letter queues, and graceful degradation patterns for Python services.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/tendercoconut174/ai-agent-platform --skill error-handling-skill-tendercoconut174
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: error-handling-skill
Source: https://github.com/tendercoconut174/ai-agent-platform/tree/main/.cursor/skills/error-handling-skill
Command: npx skills add https://github.com/tendercoconut174/ai-agent-platform --skill error-handling-skill-tendercoconut174

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building resilient distributed systems requires consistent failure-handling patterns, and this Skill generates retry logic, circuit breakers, dead-letter queues, and graceful degradation code so transient and permanent failures are handled correctly instead of crashing workers or silently dropping tasks. ## Core Features & Use Cases - Retry Logic with Backoff: Generates retry wrappers using exponential backoff with jitter, max-attempt limits, and idempotency checks for transient failures like ConnectionError and TimeoutError. - Circuit Breakers: Implements open/half-open/closed circuit breaker states for external API calls, with guidance on libraries like tenacity and circuitbreaker. - Dead-Letter Queues & Graceful Degradation: Routes permanently failed tasks to dead-letter queues for inspection and returns structured errors or fallback responses (e.g., 503 from gateways) instead of crashing. - Use Case: When building a worker queue that calls external APIs, use this Skill to generate a retry wrapper with backoff, a circuit breaker for the API client, and dead-letter handling so no failed task is silently lost. ## Quick Start Generate retry logic with exponential backoff and a circuit breaker for my Python worker that calls an external API.

Frequently Asked Questions about error-handling-skill

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

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

Wrap the operation in a retry function that catches transient exceptions like ConnectionError and TimeoutError, waits with exponentially increasing delays plus jitter, and stops after a max attempt count. Only retry idempotent operations and log each attempt with context.

What is a circuit breaker pattern for external API calls?▼

A circuit breaker opens after N consecutive failures to stop calling a failing API, enters a half-open state to allow one test request, and closes again after success or timeout. Python libraries like tenacity or circuitbreaker can implement this pattern.

How do I handle failed tasks in a worker queue?▼

Retry failed tasks up to N times, then move them to a dead-letter queue for manual inspection instead of silently dropping them. On permanent failure, return a structured error to the gateway so callers receive a clear response.

When should I not retry a failed operation?▼

Do not retry non-idempotent operations, since repeating them can cause duplicate side effects. Also avoid retrying permanent failures, and always cap retries with a max attempt limit to prevent infinite loops.

How do I implement graceful degradation when workers are unavailable?▼

Have the gateway return a 503 status when workers are unavailable, and have workers catch agent errors and return an error result instead of crashing. Provide fallback responses such as a service-unavailable message and log errors with full context.