Agent skill
async-programming-skill
This skill provides async/await patterns and best practices for concurrent programming
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/async-programming-skill
SKILL.md
Async Programming
Purpose
Async/await enables non-blocking concurrent operations. This skill documents patterns for safe async code.
When to Use
Use this skill when:
- Working with I/O operations
- Building concurrent systems
- Managing timeouts
- Implementing cancellation
Key Patterns
1. All I/O is Async
Never use blocking I/O:
# WRONG
with open(file) as f:
data = json.load(f)
# CORRECT
async with aiofiles.open(file) as f:
data = await f.read()
2. Timeout Protection
All async operations need timeouts:
try:
result = await asyncio.wait_for(operation(), timeout=30.0)
except asyncio.TimeoutError:
# Handle timeout
3. Error Handling
Async operations need proper error handling:
async def safe_operation():
try:
return await risky_operation()
except Exception as e:
logger.error(f"Operation failed: {e}")
raise TradingError(...) from e
See Also
- Python asyncio: https://docs.python.org/3/library/asyncio.html
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?