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

    30-day refund guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+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
    • Generated the document

    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.

    tenacity-async-retry-converter.pdf

    PDF · document

    Generated

    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

    Convert manual async retry loops to Tenacity AsyncRetrying contexts.Identify blocking time.sleep calls within asynchronous retry blocks.Prevent asyncio.CancelledError from being swallowed by broad retry filters.Add semaphores to retried async tasks to prevent unbounded fan-out.

    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.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

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

    Listed14 days ago

    What's inside

    Frequently Asked Questions