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
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
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
- When to Use This Skill
- Sync vs Async Decision Guide
- Core Concepts
- 1. Event Loop
- 2. Coroutines
- 3. Tasks
- 4. Futures
- 5. Async Context Managers
- 6. Async Iterators
- Quick Start
- Fundamental Patterns
- Pattern 1: Basic Async/Await
- Pattern 2: Concurrent Execution with gather()
- Pattern 3: Task Creation and Management
- Pattern 4: Error Handling in Async Code
- Pattern 5: Timeout Handling
Key facts
- Author
- wshobson
- Installs on skills.sh
- 18,453 as of 2026-11-02
- GitHub stars
- 42,081 for the whole wshobson/agents repo
- License
- MIT (as detected by GitHub)
- Last repo commit
- 2026-10-30
- skills.sh audits
- Gen Agent Trust Hub: pass; Socket: pass; Snyk: pass
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 guideEvent loop, coroutines, tasks, futures, context managers, iterators
Six short explanations of the building blocks of asyncio.
Read ·
Core conceptsBasics, 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 5In references/details.md
Async context managers, iterators and generators, producer-consumer queues, semaphores for rate limiting, and async locks.
Write ·
Patterns 6 to 10Scraping, database access, WebSocket server
Three worked examples: web scraping with aiohttp, async database operations and a WebSocket server.
Write ·
Real-world applicationsFour mistakes to avoid
Forgetting await, blocking the event loop, not handling cancellation, and mixing sync and async code.
Read ·
Common pitfallspytest-asyncio
Shows tests marked with pytest.mark.asyncio, including one for a timeout.
Write ·
Testing async codePools, 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
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- async-python-patterns SKILL.md · github.com
- wshobson/agents README · github.com
- async-python-patterns details.md · github.com
- async-python-patterns on skills.sh · skills.sh
- wshobson/agents · github.com