python-resilience

Installation
Summary

Automatic retries, exponential backoff, timeouts, and fault-tolerant decorators for Python services.

  • Covers transient vs. permanent failure classification, exponential backoff with jitter, bounded retries, and timeout patterns using the tenacity library
  • Includes nine production patterns: basic retry, selective error handling, HTTP status code retries, combined exception and status retries, retry logging, timeout decorators, stacked decorators, dependency injection for testing, and fail-safe defaults
  • Provides best practices for retry strategy, including when to retry, duration caps, logging requirements, and graceful degradation for non-critical operations
  • All patterns use decorators to separate infrastructure concerns from business logic, enabling reusable, testable, and maintainable fault-tolerant code
SKILL.md

Python Resilience Patterns

Build fault-tolerant Python applications that gracefully handle transient failures, network issues, and service outages. Resilience patterns keep systems running when dependencies are unreliable.

When to Use This Skill

  • Adding retry logic to external service calls
  • Implementing timeouts for network operations
  • Building fault-tolerant microservices
  • Handling rate limiting and backpressure
  • Creating infrastructure decorators
  • Designing circuit breakers

Core Concepts

1. Transient vs Permanent Failures

Retry transient errors (network timeouts, temporary service issues). Don't retry permanent errors (invalid credentials, bad requests).

Related skills

More from wshobson/agents

Installs
6.0K
Repository
wshobson/agents
GitHub Stars
35.3K
First Seen
Jan 30, 2026