Agent skill

Async Python

by cohen-liel in cohen-liel/hivemind

Python asyncio patterns for high-performance async code. An agent skill from cohen-liel/hivemind.

Apache-2.0Auto-check passedDevelopment

Install Async Python

skills CLI
$ npx skills add cohen-liel/hivemind --skill async-python -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cohen-liel/hivemind async-python --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cohen-liel/hivemind.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/async-python .claude/skills/async-python && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
async-python
GitHub stars
110
Token cost
~992 tokens
SKILL.md length
103 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
Apache-2.0

At a glance

Python asyncio patterns for high-performance async code. An agent skill from cohen-liel/hivemind.

  • Writing async functions
  • SKILL.md covers Core Concepts, Concurrency Patterns, Event Loop Management and Common Mistakes to Avoid, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Managing concurrency

What it does

Async Python is an agent skill from cohen-liel/hivemind. Python asyncio patterns for high-performance async code. Use when writing async functions, managing concurrency, working with aiohttp, asyncpg, or any async I/O in Python.

Its SKILL.md is about 990 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Async programming. It works with Python. The repository describes itself as: One prompt. A full AI engineering team. Go lie on the couch. 🧠. The licence is Apache-2.0.

When your agent uses it

  • Writing async functions
  • Managing concurrency
  • Working with aiohttp
  • Any async I/O in Python

Example prompts

  • “/async-python”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 918dd9b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Async Python loads about 992 tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 103 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~992

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cohen-liel/hivemind at commit 918dd9b, republished under its Apache-2.0 licence (© cohen-liel). 103 words, ~992 tokens.

Download SKILL.mdSave it as .claude/skills/async-python/SKILL.md (or your agent's skills folder).
name
async-python
description
Python asyncio patterns for high-performance async code. Use when writing async functions, managing concurrency, working with aiohttp, asyncpg, or any async I/O in Python.

Async Python Patterns

Core Concepts

python
import asyncio

# Basic async function
async def fetch_user(user_id: int) -> User:
    async with aiohttp.ClientSession() as session:
        async with session.get(f"/users/{user_id}") as resp:
            return await resp.json()

# Run from sync context
user = asyncio.run(fetch_user(123))

Concurrency Patterns

Run tasks in parallel (gather)
python
# All run at the same time — total time = slowest task
users, posts, comments = await asyncio.gather(
    fetch_user(user_id),
    fetch_posts(user_id),
    fetch_comments(user_id),
)

# With error handling — return exceptions instead of raising
results = await asyncio.gather(
    fetch_user(user_id),
    fetch_posts(user_id),
    return_exceptions=True,
)
for result in results:
    if isinstance(result, Exception):
        logger.error(f"Task failed: {result}")
Limit concurrency (Semaphore)
python
# Process 100 items but max 10 at a time
sem = asyncio.Semaphore(10)

async def process_with_limit(item):
    async with sem:
        return await process(item)

results = await asyncio.gather(*[process_with_limit(i) for i in items])
Timeout
python
try:
    result = await asyncio.wait_for(fetch_data(), timeout=10.0)
except asyncio.TimeoutError:
    logger.warning("Fetch timed out after 10s")
    result = None
Background tasks (fire and forget)
python
async def main():
    # Don't await — runs in background
    task = asyncio.create_task(send_notification(user_id))

    # But keep reference so GC doesn't kill it
    background_tasks = set()
    background_tasks.add(task)
    task.add_done_callback(background_tasks.discard)
Async context manager
python
class DatabasePool:
    async def __aenter__(self):
        self.pool = await asyncpg.create_pool(dsn)
        return self

    async def __aexit__(self, *args):
        await self.pool.close()

async with DatabasePool() as db:
    await db.pool.fetchrow("SELECT * FROM users WHERE id = $1", 1)
Async generator
python
async def stream_records(table: str):
    async with db.pool.acquire() as conn:
        async for record in conn.cursor(f"SELECT * FROM {table}"):
            yield dict(record)

async for record in stream_records("large_table"):
    await process(record)  # Never loads all into memory

Event Loop Management

python
# FastAPI: use lifespan for startup/shutdown
@asynccontextmanager
async def lifespan(app: FastAPI):
    # startup
    app.state.db = await create_pool()
    app.state.redis = await aioredis.from_url(REDIS_URL)
    yield
    # shutdown
    await app.state.db.close()
    await app.state.redis.close()

Common Mistakes to Avoid

python
# ❌ WRONG: blocking call in async function kills concurrency
async def bad():
    time.sleep(1)         # Blocks entire event loop!
    requests.get(url)     # Blocking HTTP call

# ✅ RIGHT: use async equivalents
async def good():
    await asyncio.sleep(1)
    async with aiohttp.ClientSession() as s:
        await s.get(url)

# ❌ WRONG: creating event loop manually in library code
loop = asyncio.get_event_loop()
loop.run_until_complete(coro())

# ✅ RIGHT
asyncio.run(coro())  # Creates and closes loop properly

Rules

  • NEVER use time.sleep, requests, or any blocking I/O in async functions
  • Use asyncio.gather() for parallel work — sequential awaits waste time
  • Use Semaphore to limit concurrency for rate-limited APIs or DB pools
  • Always await asyncio.wait_for() for external calls (never hang forever)
  • Keep strong references to background tasks (set pattern above)
  • Use asyncpg for PostgreSQL, aioredis for Redis, aiohttp for HTTP
  • asyncio.run() at the top level only — never inside async functions

© cohen-liel, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/async-python of cohen-liel/hivemind.

Open the folder on GitHubat commit 918dd9b

Compare with similar skills

Async Python next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Async Python compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Async Python this skillcohen-liel/hivemind110—~992Automated safety check: PassApache-2.0
Mirage VFS Adapter Authoringstrukto-ai/mirage3.7k—~2.5kAutomated safety check: PassApache-2.0
Blocking IO Guardbytedance/deer-flow83k—~1.7kAutomated safety check: PassMIT
ContributingGoogleCloudPlatform/race-condition234—~930Automated safety check: PassCustom licence
cmux Swift Package Architecturemanaflow-ai/cmux28k1 repos~4.2kAutomated safety check: PassCustom licence
Code Reviewgetsentry/warden414—~1.9kAutomated safety check: PassCustom licence

Similar skills

  • Builds or extends a custom Mirage virtual filesystem adapter for an API, database, object store or app data, with a working mount configuration and filesystem tests.

    3.7k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Blocking IO Guard

    bytedance/deer-flow

    Adds a runtime test anchor for backend async code that could block the asyncio event loop, and proves the anchor fails when the blocking call returns.

    83k GitHub stars~1.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Contributing

    GoogleCloudPlatform/race-condition

    Guides the developer workflow for contributing to Race Condition.

    234 GitHub stars~930 tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Architecture rules for cmux's move to Swift Packages: acyclic whole-domain packages, minimal public API, group folders, Xcode project wiring and Swift 6 concurrency.

    28k GitHub starsUsed in 1 repo~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review

    getsentry/warden

    Official

    Finds real correctness bugs in code changes. An agent skill from getsentry/warden.

    414 GitHub stars~1.9k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Getting Started

    GoogleCloudPlatform/race-condition

    Guides setup of the Race Condition project from clone to running simulation.

    234 GitHub stars~1k tokensUpdated 3 days ago
    DevelopmentAuto-check: notes

More from cohen-liel/hivemind

All 33 skills in this repo
  • API Design

    cohen-liel/hivemind

    REST API design principles and best practices. An agent skill from cohen-liel/hivemind.

    110 GitHub starsUsed in 1 repo~857 tokens
    Auto-check passed
  • Graphql API

    cohen-liel/hivemind

    GraphQL API design and implementation patterns. An agent skill from cohen-liel/hivemind.

    110 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Celery Tasks

    cohen-liel/hivemind

    Celery background task patterns for Python apps. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • Docker Deployment

    cohen-liel/hivemind

    Docker, docker-compose, and deployment configuration best practices.

    110 GitHub stars~674 tokensUpdated 5 mo ago
    Auto-check passed
  • E2E Testing

    cohen-liel/hivemind

    End-to-end testing patterns with Playwright. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Article Writing

    cohen-liel/hivemind

    Write articles, guides, blog posts, tutorials, newsletter issues, and other long-form content in a distinctive voice derived from supplied examples or brand guidance.

    110 GitHub starsUsed in 8 repos~786 tokens
    Auto-check passed

Works with

Categories

Questions about Async Python

What does Async Python do?

Python asyncio patterns for high-performance async code. An agent skill from cohen-liel/hivemind. Async Python is an agent skill from cohen-liel/hivemind. Python asyncio patterns for high-performance async code.

When should I use Async Python?

Async Python fits situations like: writing async functions; managing concurrency; working with aiohttp; any async I/O in Python.

How do I install Async Python in Claude Code?

Run `npx skills add cohen-liel/hivemind --skill async-python -a claude-code`. Or copy the skill folder (.claude/skills/async-python in cohen-liel/hivemind) into .claude/skills/async-python in your project. Claude Code loads it when a task matches its description.

How do I install Async Python in Codex?

Run `npx skills add cohen-liel/hivemind --skill async-python -a codex`. Or copy the skill folder (.claude/skills/async-python in cohen-liel/hivemind) into .agents/skills/async-python in your project. Codex loads it when a task matches its description.

Can I use Async Python in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cohen-liel/hivemind --skill async-python -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/async-python, .gemini/skills/async-python, .github/skills/async-python and .opencode/skills/async-python in your project.

What does Async Python need to run?

SKILL.md names no scripts, command-line tools or credentials: Async Python is instructions for the agent only. Our summary lists: Python 3.

Does Async Python access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Async Python safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Async Python use?

Async Python is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Async Python use?

About 992 tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Async Python?

Skills that share tags, products or a category with Async Python: Mirage VFS Adapter Authoring (strukto-ai/mirage, 3.7k stars), Blocking IO Guard (bytedance/deer-flow, 83k stars), Contributing (GoogleCloudPlatform/race-condition, 234 stars) and cmux Swift Package Architecture (manaflow-ai/cmux, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Async Python?

cohen-liel (a GitHub user) maintains it in cohen-liel/hivemind, which has 110 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on April 18, 2026.

Source: cohen-liel/hivemind on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.