python-resilience

Implement retry, timeout, and backoff decorators for Python services.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/haxlys/skills --skill python-resilience-haxlys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-resilience
Source: https://github.com/haxlys/skills/tree/main/vendored/wshobson-agents/plugins/python-development/skills/python-resilience
Command: npx skills add https://github.com/haxlys/skills --skill python-resilience-haxlys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implement robust retry logic, timeouts, backoffs and fault-tolerant decorators to keep Python services resilient against transient failures.

Core Features & Use Cases

  • Resilient by design: automatic retries with exponential backoff and jitter to handle flaky dependencies.
  • Timeouts and resource guards: configurable operation timeouts to prevent hanging calls.
  • Decorator-driven composition: clean separation of business logic from infrastructure concerns via reusable decorators.
  • Use cases: API clients, microservices, data pipelines, and background workers facing intermittent errors.

Quick Start

Install tenacity and httpx, then annotate calls with retry and timeout strategies for immediate resilience.

Frequently Asked Questions about python-resilience

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?

Implement retry logic in Python using decorator-based composition to apply exponential backoff with jitter and bounded retries, cleanly separating infrastructure concerns from business logic for production-grade resilience.

What is the best way to handle transient failures in Python microservices?

Handle transient failures in Python microservices by applying resilience patterns like automatic retries, configurable timeouts, and circuit-breaker-like strategies across APIs, data stores, and message queues.

How do I add timeouts to Python API clients to prevent hanging calls?

Add timeouts to Python API clients using configurable operation timeouts as resource guards, preventing hanging calls and ensuring your distributed system remains responsive during dependency issues.

Can I use tenacity and httpx to build fault-tolerant Python apps?

Yes, you can use tenacity and httpx to build fault-tolerant Python apps by annotating calls with retry and timeout strategies, enabling immediate resilience for API clients and background workers.

When do I need circuit-breaker-like strategies in Python data pipelines?

You need circuit-breaker-like strategies in Python data pipelines when facing intermittent errors from flaky dependencies, applying bounded retries and backoff to maintain system stability.

Why should I use decorators for retry logic and timeouts in Python?

Use decorators for retry logic and timeouts in Python to achieve clean separation of concerns, enabling reusable, decorator-driven composition that keeps business logic separate from infrastructure resilience patterns.