PlugWiki

async-python-patterns Skill (wshobson) for Claude Code

Teaches your agent Python asyncio patterns: when to use async, gather and tasks, timeouts, locks, queues, common pitfalls and tests.

Installs
18.5K
on skills.sh
Stars
42.1K
on GitHub
Files
1
besides SKILL.md
Updated
Oct 2026
last repo commit

The skill is a guide to Python asyncio for I/O-heavy programs. It opens with a table for choosing between sync, asyncio, thread pools and multiprocessing, with the key rule to stay fully sync or fully async within a call path. It explains six core concepts and then shows five basic patterns: async/await, gather, tasks, error handling and timeouts.

A second file holds five advanced patterns, three real-world examples and performance advice. It also lists four common pitfalls and shows how to test with pytest-asyncio. It bundles no scripts.

Good for

  • Python developers building async APIs with FastAPI or aiohttp
  • Developers writing concurrent scrapers or WebSocket servers
  • Anyone fixing blocking calls or forgotten awaits in async code

Install async-python-patterns

Claude Code

  1. 1

    Copy this prompt.

    Install the async-python-patterns skill in Claude Code. Run this command:
    
    npx skills add https://github.com/wshobson/agents --skill async-python-patterns
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Master Python asyncio, concurrent programming, and async/await patterns for high-performance applications. Use when building async APIs, concurrent systems, or I/O-bound applications requiring non-blocking operations.

Sections in SKILL.md

  1. When to Use This Skill
  2. Sync vs Async Decision Guide
  3. Core Concepts
  4. 1. Event Loop
  5. 2. Coroutines
  6. 3. Tasks
  7. 4. Futures
  8. 5. Async Context Managers
  9. 6. Async Iterators
  10. Quick Start
  11. Fundamental Patterns
  12. Pattern 1: Basic Async/Await
  13. Pattern 2: Concurrent Execution with gather()
  14. Pattern 3: Task Creation and Management
  15. Pattern 4: Error Handling in Async Code
  16. Pattern 5: Timeout Handling

Key facts

Author
wshobson
Installs on skills.sh
18,453 as of 2026-11-02
Last repo commit
2026-10-30

What it includes

  • Pick the right concurrency tool

    Many network or database calls suit asyncio, CPU-heavy work suits multiprocessing or a thread pool, and mixed work offloads CPU parts with asyncio.to_thread().

    Read · Sync vs async decision guide

  • Event loop, coroutines, tasks, futures, context managers, iterators

    Six short explanations of the building blocks of asyncio.

    Read · Core concepts

  • Basics, gather, tasks, error handling, timeouts

    Worked code for async/await, running calls concurrently with gather(), creating and managing tasks, handling errors and timeouts.

    Write · Patterns 1 to 5

  • In references/details.md

    Async context managers, iterators and generators, producer-consumer queues, semaphores for rate limiting, and async locks.

    Write · Patterns 6 to 10

  • Scraping, database access, WebSocket server

    Three worked examples: web scraping with aiohttp, async database operations and a WebSocket server.

    Write · Real-world applications

  • Four mistakes to avoid

    Forgetting await, blocking the event loop, not handling cancellation, and mixing sync and async code.

    Read · Common pitfalls

  • pytest-asyncio

    Shows tests marked with pytest.mark.asyncio, including one for a timeout.

    Write · Testing async code

  • Pools, batching, no blocking calls

    Use connection pools, batch operations, and async-native libraries such as httpx instead of blocking ones.

    Read · Performance best practices

From the official docs

Questions

What does async-python-patterns do?

It teaches your agent how to write and debug Python asyncio code. It covers when async is worth it, the core patterns, common pitfalls and testing.

How do I install it?

Use the install box at the top of this page for this one skill. The wshobson/agents README also describes plugin routes, which install a whole plugin with its agents and commands.

Does it need an API key or a package?

No API key. The examples use asyncio, plus aiohttp, httpx and pytest-asyncio in some of them, which you install in your own project.

Is it only for web servers?

No. The use list names async web APIs, concurrent database, file and network I/O, scrapers, WebSocket servers, microservices and background task queues. It also says to stay with sync code for simple scripts with few connections.

Which Python version does it assume?

Its Quick Start marks the basic async/await pattern as Python 3.7 or newer. It does not state a minimum for the other patterns.

Is it safe?

It bundles no scripts and only guides how your agent writes code. Review the code it writes before you run it.

Information

updated Nov 2, 2026

Repository
wshobson/agents
Folder
plugins/python-development/skills/async-python-patterns

wshobson/agentsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 5
  1. async-python-patterns SKILL.md · github.com
  2. wshobson/agents README · github.com
  3. async-python-patterns details.md · github.com
  4. async-python-patterns on skills.sh · skills.sh
  5. wshobson/agents · github.com

Updated Nov 2, 2026.