aiskillstore/marketplace / skills/0xdarkmatter/python-async-patterns
python-async-patterns
VerifiedPython asyncio patterns for concurrent programming. Triggers on: asyncio, async, await, coroutine, gather, semaphore, TaskGroup, event loop, aiohttp, concurrent.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.2 KB |
| assets/async-project-template.py | script | 3.6 KB |
| references/aiohttp-patterns.md | markdown | 6.1 KB |
| references/concurrency-patterns.md | markdown | 6.0 KB |
| references/debugging-async.md | markdown | 5.8 KB |
| references/error-handling.md | markdown | 11.9 KB |
| references/mixing-sync-async.md | markdown | 5.7 KB |
| references/performance.md | markdown | 10.1 KB |
| references/production-patterns.md | markdown | 10.0 KB |
| scripts/find-blocking-calls.sh | script | 1.4 KB |
| skill-report.json | config | 51.9 KB |
scripts/find-blocking-calls.sh
View on GitHub#!/bin/bash
# Find potentially blocking calls in async Python code
# Usage: ./find-blocking-calls.sh [directory]
DIR="${1:-.}"
echo "=== Scanning for blocking calls in async code ==="
echo "Directory: $DIR"
echo
# time.sleep() in async functions
echo "--- time.sleep() in async functions ---"
rg -n "async def" -A 20 "$DIR" | rg "time\.sleep\(" || echo "None found"
echo
# requests library (blocking HTTP)
echo "--- requests library usage ---"
rg -n "import requests|from requests" "$DIR" --type py || echo "None found"
echo
# Blocking file operations
echo "--- Blocking file operations in async ---"
rg -n "async def" -A 30 "$DIR" | rg "open\(|\.read\(\)|\.write\(" || echo "None found"
echo
# subprocess without asyncio
echo "--- Blocking subprocess calls ---"
rg -n "subprocess\.(run|call|check_output)" "$DIR" --type py || echo "None found"
echo
# socket operations
echo "--- Blocking socket operations ---"
rg -n "socket\.(socket|create_connection)" "$DIR" --type py || echo "None found"
echo
# input() calls
echo "--- Blocking input() calls ---"
rg -n "\binput\(" "$DIR" --type py || echo "None found"
echo
echo "=== Recommendations ==="
echo "- Replace time.sleep() with asyncio.sleep()"
echo "- Replace requests with aiohttp or httpx"
echo "- Replace open() with aiofiles"
echo "- Replace subprocess with asyncio.create_subprocess_exec()"
echo "- Use asyncio.get_event_loop().run_in_executor() for blocking code"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |