tenacity async retry converter

    1

    Audits and converts blocking or hand-rolled Python retry logic into event-loop-friendly Tenacity async patterns.

    $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 async retry converter

    Example session with this skill installed

    Analyze the retries in ./services/downloader.py. The event loop seems to be lagging whenever the external API times out. Check if the retries are blocking.

    • Read your context and instructions
    • Compiled the tenacity async retry

    I have completed the audit of ./services/downloader.py. I found 2 high-severity issues where synchronous sleep calls and blocking network requests were stalling the event loop during retry backoffs.

    Tenacity Async Retry Audit

    Finding IDSeverityLocationIssue
    ASY-1-8a2fCriticaldownloader.py:42time.sleep used inside async retry blocks the event loop.
    ASY-2-4c1dHighdownloader.py:58Sync requests.get blocks loop; should use httpx.AsyncClient.

    Detail: ASY-1-8a2f

    The current implementation uses time.sleep(2) within a retry loop. In an asynchronous context, this stops all other concurrent tasks from executing. I have generated a patch to use tenacity.wait_exponential which correctly yields control back to the loop.

    
    # Patch for downloader.py:42
    from tenacity import AsyncRetrying, stop_after_attempt, wait_fixed
    
    async def download_resource(url):
        async for attempt in AsyncRetrying(
            stop=stop_after_attempt(5),
            wait=wait_fixed(2),
            reraise=True
        ):
            with attempt:
                # logic here
                pass
    

    Next steps

    1. Review the full report in ./output/tenacity-async-retry-converter-report.md.
    2. Apply the validated patches from ./output/patches/.
    3. Verify that httpx is installed for the recommended async network replacements.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Improper retry logic in asynchronous Python code often blocks the event loop, causing latency spikes or complete service stalls. Hand-rolled retry loops frequently mishandle asyncio.CancelledError, leading to tasks that cannot be stopped.

    What it does

    • Identifies blocking calls like time.sleep or requests inside retried async functions.
    • Converts manual while/try/except loops into proper AsyncRetrying contexts.
    • Audits exception filters to ensure cancellation signals are not swallowed by accident.
    • Detects unbounded fan-out where asyncio.gather and retries combine to overwhelm downstream services.
    • Generates syntax-validated patches using tenacity best practices.

    Frameworks & tools

    Built for Python asyncio environments utilizing tenacity, httpx, aiohttp, and trio/anyio.

    Why this beats prompting it yourself

    Generic LLMs often provide synchronous retry snippets that will freeze your async loop. This skill uses a systematic audit of six specific async-failure patterns and validates every generated patch against the Python AST to ensure zero syntax errors.

    Use cases

    • Refactoring legacy blocking retry loops during an httpx migration.
    • Fixing "zombie" tasks that refuse to cancel due to BaseException retry filters.
    • Stabilizing microservices that experience event loop lag under high load.

    Known limitations

    Does not modify source files directly, requires manual application of generated patches. Ignores non-UTF-8 files and Python versions 2.x.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Read-only analysis; patches must be applied manually. Caps at 10 findings per run. Does not support Python 2.x or non-UTF-8 files. Analysis limited to 5,000 files 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

    Network Access
    Listed2 months ago
    Updated1 month ago

    What's inside

    Frequently Asked Questions

    This skill identifies 'poison' patterns like time.sleep() or generic Exception filters in your async code and converts them into production-ready Tenacity async decorators or context managers that won't block your event loop.

    It is fully compatible with any AI agent or IDE extension capable of processing Python source code, including GitHub Copilot, Cursor, and custom LLM-based code review agents.

    No, this skill is designed for safety; it generates syntax-validated code patches that you can review and apply manually, ensuring no accidental overwrites of your critical business logic.

    The skill is optimized for modern Python 3.8+ environments using asyncio, Trio, or AnyIO, and specifically targets libraries like httpx, aiohttp, and the Tenacity retry framework.

    While it can identify blocking calls in standard loops, it is specifically tuned to convert logic into Tenacity patterns; you will need the Tenacity library installed in your project to use the generated patches.

    Unlike generic prompts, this skill performs a multi-step AST (Abstract Syntax Tree) audit to detect 'zombie tasks' and fan-out risks that standard LLMs typically miss or accidentally introduce.

    New in APIs & Backend