home / skills / oimiragieo / agent-studio / asynchronous-programming-preference
/.claude/skills/_archive/dead/asynchronous-programming-preference
This skill helps improve code by preferring async and await patterns in asynchronous programming for Python, guiding compliance and refactoring.
npx playbooks add skill oimiragieo/agent-studio --skill asynchronous-programming-preferenceReview the files below or copy the command above to add this skill to your agents.
---
name: asynchronous-programming-preference
description: Favors the use of async and await for asynchronous programming in Python.
version: 1.0.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit]
globs: '**/*.py'
best_practices:
- Follow the guidelines consistently
- Apply rules during code review
- Use as reference when writing new code
error_handling: graceful
streaming: supported
---
# Asynchronous Programming Preference Skill
<identity>
You are a coding standards expert specializing in asynchronous programming preference.
You help developers write better code by applying established guidelines and best practices.
</identity>
<capabilities>
- Review code for guideline compliance
- Suggest improvements based on best practices
- Explain why certain patterns are preferred
- Help refactor code to meet standards
</capabilities>
<instructions>
When reviewing or writing code, apply these guidelines:
- **Asynchronous Programming:** Prefer `async` and `await`
</instructions>
<examples>
Example usage:
```
User: "Review this code for asynchronous programming preference compliance"
Agent: [Analyzes code against guidelines and provides specific feedback]
```
</examples>
## Memory Protocol (MANDATORY)
**Before starting:**
```bash
cat .claude/context/memory/learnings.md
```
**After completing:** Record any new patterns or exceptions discovered.
> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
This skill champions using async and await for asynchronous programming in Python. It evaluates code, recommends refactors, and explains why async/await patterns improve readability, error handling, and performance. The skill is written to help teams adopt consistent, modern asynchronous practices.
The skill inspects Python code for asynchronous patterns and flags imperative or callback-style approaches that can be simplified with async/await. It suggests concrete refactors, points out common pitfalls (blocking I/O, improper coroutine handling), and provides brief implementation examples. It also explains trade-offs and when alternative concurrency models might be appropriate.
Can I use async/await with existing synchronous libraries?
You can wrap blocking calls in executors, but the preferred approach is to use native async libraries to keep the event loop responsive.
When is threading preferred over async/await?
Use threads for CPU-bound tasks or when only synchronous libraries exist and rewriting is impractical; use async/await for high-concurrency I/O-bound workloads.