- Home
- Skills
- Agents & Orchestration
- tenacity retry gap scanner
tenacity retry gap scanner
Finds unprotected outbound Python calls and generates production-ready Tenacity retry snippets.
$10
Works with the AI Agents you already use
tenacity retry gap scanner
Example session with this skill installed
Scan ./services/payments for missing retries and generate fixes.
- Read your context and instructions
- Compiled the tenacity retry gap
I have completed the resilience audit of the ./services/payments directory. I scanned 14 Python files and identified 3 high-risk gaps where outbound calls lack transient failure protection.
Tenacity Retry Gap Report
| ID | Severity | Location | Issue |
|---|---|---|---|
| GAP-1-a8f2 | High | services/payments/client.py:42 | Unprotected httpx.post call to Stripe API |
| GAP-3-b9c1 | Medium | services/payments/db.py:88 | sqlalchemy commit without deadlock retry |
| GAP-2-e4d5 | High | services/payments/notifier.py:15 | boto3.client('sns').publish missing retry config |
Recommended Fix: GAP-1-a8f2 (Stripe API)
The following snippet has been generated in ./output/patches/GAP-1-a8f2.py. It uses tenacity to handle transient network errors and 429/5xx status codes specifically for the httpx library.
import logging
import httpx
from tenacity import (retry, retry_if_exception, stop_after_attempt,
stop_after_delay, wait_exponential_jitter, before_sleep_log)
log = logging.getLogger(__name__)
_TRANSIENT_STATUS = {408, 429, 500, 502, 503, 504}
def _is_transient(exc: BaseException) -> bool:
if isinstance(exc, (httpx.TimeoutException, httpx.NetworkError)):
return True
return isinstance(exc, httpx.HTTPStatusError) and exc.response.status_code in _TRANSIENT_STATUS
@retry(
retry=retry_if_exception(_is_transient),
stop=stop_after_attempt(3) | stop_after_delay(15),
wait=wait_exponential_jitter(initial=1, max=10),
before_sleep=before_sleep_log(log, logging.WARNING),
reraise=True,
)
def post_transaction(client: httpx.Client, payload: dict):
# Wrapped to handle transient Stripe connection issues
resp = client.post("https://api.stripe.com/v1/charges", json=payload)
resp.raise_for_status()
return resp.json()
Next steps
- Review the full report at
./output/tenacity-retry-gap-scanner-report.md. - Apply the generated patches in
./output/patches/to your source files. - Ensure
tenacityis added to yourrequirements.txtorpyproject.toml.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Network calls to external APIs, databases, and cloud SDKs often fail due to transient issues. Without proper retry logic, these blips lead to avoidable production incidents, data inconsistency, and degraded user experiences.
What it does
- Identifies unprotected outbound calls in Python code, including
requests,httpx,boto3, andpsycopg. - Calculates a retry coverage ratio to benchmark your application's resilience.
- Generates syntax-checked
tenacity@retry snippets tailored to specific library exception hierarchies. - Ranks findings by severity, prioritizing user-facing request paths and high-blast-radius calls.
- Detects existing library-level retry configurations to prevent redundant nested retry layers.
Frameworks & tools
Python, Tenacity, HTTPX, Requests, Aiohttp, Boto3, SQLAlchemy, Redis, Pika, and Stripe SDK.
Why this beats prompting it yourself
Manual audits are prone to missing deeply nested SDK calls or subtle library-level configurations already in place. This skill enforces a consistent, production-ready retry pattern with exponential backoff and jitter, preventing the common mistake of wrapping non-idempotent operations or permanent 4xx errors.
Use cases
- Hardening a microservice before a high-traffic launch.
- Auditing a legacy codebase for transient failure points.
- Standardizing resilience patterns across a distributed team.
- Reducing Sentry/Datadog noise caused by flaky third-party APIs.
Known limitations
Only analyzes Python codebases. Cannot resolve client types for dynamically injected attributes, which may result in lower confidence findings.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Supports Python code only. Cannot resolve dynamically typed client objects. Does not modify source files directly. Max 10 findings per run.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
- Software
Python
Permissions
No special permissions declared or detected