- 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 tools 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
- Generated the document
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.
tenacity-retry-gap-scanner.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
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.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 14 days ago
- Passed all security checks, Safe to install