async-python-patterns
Python asyncio and concurrent programming patterns for high-performance applications.
Skill by NickCrew
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/nickcrew-async-python-patterns
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/async-python-patterns
What's inside
- Skill name
async-python-patterns- Description
- Python asyncio and concurrent programming patterns for high-performance applications. Use when building async APIs, concurrent systems, or I/O-bound applications requiring non-blocking operations.
- License
- MIT
- Instructions
- 442 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Async Python Patterns
Expert guidance for implementing asynchronous Python applications using asyncio, concurrent programming patterns, and async/await for building high-performance, non-blocking systems.
## When to Use This Skill
- Building async web APIs (FastAPI, aiohttp, Sanic)
- Implementing concurrent I/O operations (database, file, network)
- Creating web scrapers with concurrent requests
- Developing real-time applications (WebSocket servers, chat systems)
- Processing multiple independent tasks simultaneously
- Optimizing I/O-bound workloads requiring parallelism
- Implementing async background tasks and task queues
## Core Patterns
### 1. Basic Async/Await
**Foundation for all async operations:**
```python
import asyncio
async def fetch_data(url: str) -> dict:
"""Fetch data asynchronously."""
await asyncio.sleep(1) # Simulate I/O
return {"url": url, "data": "result"}
async def main():
result = await fetch_data("https://api.example.com")
print(result)
asyncio.run(main())
```
**Key concepts:**
- `async def` defines coroutines (pausable functions)
- `await` yields control back to event loop
- `asyncio.run()` is the entry point (Python 3.7+)
- Single-threaded cooperative multitasking
### 2. Concurrent Execution with gather()
**Execute multiple operations simultaneously:**
```python
import asyncio
from typing import List
async def fetch_user(user_id: int) -> dict:
await asyncio.sleep(0.5)
return {"id": user_id, "name": f"User {user_id}"}
async def fetch_all_users(user_ids: List[int]) -> List[dict]:
"""Fetch multiple users concurrently."""
tasks = [fetch_user(uid) for uid in user_ids]
results = await asyncio.gather(*tasks)
return results
# Speed: Sequential = 5s, Concurrent = 0.5s for 10 users
```
**When to use:**
- Independent operations that can run in parallel
- I/O-bound tasks (API calls, database queries)
- Need all results before proceeding
- Use `return_exceptions=True` to handle partial failures
### 3. Task Creation and Management
**Background tasks that run independently:**
```python
import asyncio
async def background_task(name: str, delay: int):
print(f"{name} started")
await asyncio.sleep(delay)
return f"Result from {name}"
async def main():
# Create tasks (starts execution immediately)
task1 = asyncio.create_task(background_task("Task 1", 2))
task2 = asyncio.create_task(background_task("Task 2", 1))
# Do other work while tasks run
print("Doing other work")
await asyncio.sleep(0.5)
# Wait for results when needed
result1, result2 = await task1, await task2
```
**Differences:**
- `await coroutine()` - Waits immediately
- `asyncio.create_task()` - Starts background execution
- Tasks can be cancelled with `task.cancel()`
### 4. Error Handling
**Robust error handling for concurrent operations:**
```python
import asyncio
from typing import List, Optional
async def safe_operation(item_id: int) -> Optional[dict]:
try:
await asyncio.sleep(0.1)
if item_id % 3 == 0:
raise ValueError(f"Item {item_id} failed")
return {"id": item_id, "status": "success"}
except ValueError as e:
print(f"Error: {e}")
return None
async def process_items(item_ids: List[int]):
# gather with return_exceptions=True continues on errors
results = await asyncio.gather(
*[safe_operation(iid) for iid in item_ids],
return_exceptions=True
)From NickCrew/Claude-Cortex, MIT.
More from NickCrew/Claude-Cortex
- 0.581score
dev-workflows
NickCrew
Use when running builds, executing tests, or improving developer experience workflows - provides structured guidance for build/test execution and DX…
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
codex-code-review
NickCrew
Automate code review remediation loops with the codex CLI.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
cqrs-event-sourcing
NickCrew
CQRS and Event Sourcing patterns for scalable, auditable systems with separated read/write models.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
design-journey-review
NickCrew
Combined visual design and user journey review: color systems, typography, spacing, information density, visual hierarchy, workflow stages, emotional curve…
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
build-optimization
NickCrew
Build system optimization covering compilation, caching, incremental builds, and developer tooling.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
backlog-md
NickCrew
Task tracking system for agents via Backlog.md CLI.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
api-gateway-patterns
NickCrew
API Gateway patterns for routing, authentication, rate limiting, and service composition in microservices architectures.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
compliance-audit
NickCrew
Regulatory compliance auditing across GDPR, HIPAA, PCI DSS, SOC 2, and ISO frameworks with automated evidence collection and gap analysis.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
database-design-patterns
NickCrew
Database schema design patterns and optimization strategies for relational and NoSQL databases.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
code-explanation
NickCrew
Use when explaining code, concepts, or system behavior to a specific audience level - provides a structured explanation workflow with depth control and…
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
development-estimation
NickCrew
Use when estimating time, effort, or complexity for features or projects - provides structured estimation workflows with breakdowns, risks, and confidence…
SkillCFreshness: C★ 61Claude Code +9 - 0.577score
architectural-analysis
NickCrew
User-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI…
SkillCFreshness: C★ 61Claude Code +9
Signals
- Stars
- 61
- Forks
- 15
- Open issues
- 3
- Last commit (this folder)
- Apr 23, 2026 (6 months ago)
- Last release
- Jun 2, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/NickCrew/Claude-Cortex
- Website
- cortex.atlascrew.dev/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from NickCrew
- 0.581score
code-explanation
NickCrew
Use when explaining code, concepts, or system behavior to a specific audience level - provides a structured explanation workflow with depth control and…
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
cqrs-event-sourcing
NickCrew
CQRS and Event Sourcing patterns for scalable, auditable systems with separated read/write models.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
api-gateway-patterns
NickCrew
API Gateway patterns for routing, authentication, rate limiting, and service composition in microservices architectures.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
backlog-md
NickCrew
Task tracking system for agents via Backlog.md CLI.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
compliance-audit
NickCrew
Regulatory compliance auditing across GDPR, HIPAA, PCI DSS, SOC 2, and ISO frameworks with automated evidence collection and gap analysis.
SkillCFreshness: C★ 61Claude Code +9 - 0.581score
database-design-patterns
NickCrew
Database schema design patterns and optimization strategies for relational and NoSQL databases.
SkillCFreshness: C★ 61Claude Code +9
Cite this page
async-python-patterns skill. Agent Mart. https://agentmart.dev/skills/nickcrew-async-python-patterns (last updated 2026-10-24)