tenacity retry gap scanner

    1

    Finds unprotected outbound Python calls and generates production-ready Tenacity retry snippets.

    $10

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    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

    IDSeverityLocationIssue
    GAP-1-a8f2Highservices/payments/client.py:42Unprotected httpx.post call to Stripe API
    GAP-3-b9c1Mediumservices/payments/db.py:88sqlalchemy commit without deadlock retry
    GAP-2-e4d5Highservices/payments/notifier.py:15boto3.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

    1. Review the full report at ./output/tenacity-retry-gap-scanner-report.md.
    2. Apply the generated patches in ./output/patches/ to your source files.
    3. Ensure tenacity is added to your requirements.txt or pyproject.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, and psycopg.
    • 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Listed2 months ago
    Updated1 month ago

    What's inside

    Frequently Asked Questions

    The scanner identifies unprotected outbound Python calls (like HTTP requests or database queries) and generates specific Tenacity retry decorators to handle transient failures automatically.

    It supports common libraries including Requests, HTTPX, Boto3, SQLAlchemy, Redis, and Stripe, specifically detecting if these calls are wrapped in appropriate error-handling logic.

    Unlike a basic prompt, this skill performs a deep audit to detect existing library-level retry settings, preventing 'retry storms' caused by redundant nested layers.

    The scanner provides a resilience coverage ratio, a prioritized list of unprotected calls, and ready-to-paste Tenacity code snippets using best practices like exponential backoff and jitter.

    This skill is designed to work with any AI agent capable of file-system access or code analysis, such as AutoGPT, BabyAGI, or custom LangChain-based development agents.

    Yes, the skill is specifically programmed to recognize non-idempotent operations and permanent 4xx errors to ensure you don't accidentally retry calls that should stay failed.

    New in Agents & Orchestration