Token导航 LogoToken导航

Agent Skill · 开发

asyncio-programming(异步编程)

asyncio-programming 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

asyncio-programming 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 1,680。

总安装 25,282周安装 727GitHub Stars 5下载 7,558核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:asyncio-programming(异步编程)
来源仓库:https://github.com/pluginagentmarketplace/custom-plugin-python
仓库路径:skills/asyncio-programming
安装命令:
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-python --skill 'Asyncio Programming'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-python --skill 'Asyncio Programming'

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于处理 GitHub 仓库状态、Issue、Pull Request 及代码协作事项,适合在 Codex、Claude、Cursor、Gemini CLI 中围绕项目变更进行信息整理与流程跟踪。

它提供异步编程基础与高级用法,涵盖 async/await 语法、事件循环管理和并发任务调度,适用于 I/O 密集型应用开发。使用时可结合具体任务调用相关命令,但需注意权限范围,避免触发不必要的网络或系统操作;建议先检查仓库维护状态和 API 限制。

安装前应确认是否具备 GitHub 访问权限,并评估是否会引入外部依赖或执行敏感命令,防止意外修改或数据泄露。asyncio-programming 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/asyncio-programming

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/pluginagentmarketplace/custom-plugin-python --…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

asyncio-programming 怎么安装?

在终端执行 npx skills add https://github.com/pluginagentmarketplace/custom-plugin-python --skill 'Asy…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

asyncio-programming 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

asyncio-programming 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

asyncio-programming 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

asyncio-programming 用的人多吗?

公开数据是累计安装 25,282 次,近一周安装 727 次,下载 7,558 次,GitHub 5 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

asyncio-programming 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
asyncio-programming

异步编程 · 本页

25,2825需要联网MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Asyncio Programming

Overview

Master asynchronous programming in Python with asyncio. Learn to write concurrent code that efficiently handles I/O-bound operations, build async web applications, and understand the async/await paradigm.

Learning Objectives

  • Understand asynchronous programming concepts
  • Write async functions with async/await syntax
  • Manage concurrent operations with asyncio
  • Build async web applications
  • Handle async I/O operations efficiently
  • Debug and test async code

Core Topics

1. Async/Await Basics

  • Understanding coroutines
  • async/await syntax
  • Event loop fundamentals
  • Running async functions
  • Async vs sync execution
  • Common pitfalls

Code Example:

import asyncio
import time

# Synchronous version (slow)
def fetch_data_sync(url):
    print(f"Fetching {url}...")
    time.sleep(2)  # Simulating network delay
    return f"Data from {url}"

def main_sync():
    urls = ['url1', 'url2', 'url3']
    results = []
    for url in urls:
        data = fetch_data_sync(url)
        results.append(data)
    return results

# Takes 6 seconds (2 * 3)
start = time.time()
main_sync()
print(f"Sync took: {time.time() - start:.2f}s")

# Asynchronous version (fast)
async def fetch_data_async(url):
    print(f"Fetching {url}...")
    await asyncio.sleep(2)  # Non-blocking sleep
    return f"Data from {url}"

async def main_async():
    urls = ['url1', 'url2', 'url3']
    # Create tasks and run concurrently
    tasks = [fetch_data_async(url) for url in urls]
    results = await asyncio.gather(*tasks)
    return results

# Takes 2 seconds (concurrent execution)
start = time.time()
asyncio.run(main_async())
print(f"Async took: {time.time() - start:.2f}s")

2. Asyncio Tasks & Coroutines

  • Creating and managing tasks
  • asyncio.gather() vs asyncio.wait()
  • Task cancellation
  • Task groups (Python 3.11+)
  • Exception handling in tasks
  • Timeouts

Code Example:

import asyncio

async def process_item(item_id, delay):
    print(f"Processing item {item_id}")
    await asyncio.sleep(delay)
    if item_id == 3:
        raise ValueError(f"Item {item_id} failed!")
    return f"Result {item_id}"

async def main():
    # Method 1: gather (returns results in order)
    tasks = [
        process_item(1, 1),
        process_item(2, 2),
        process_item(3, 1),
    ]
    try:
        results = await asyncio.gather(*tasks, return_exceptions=True)
        for i, result in enumerate(results):
            if isinstance(result, Exception):
                print(f"Task {i} failed: {result}")
            else:
                print(f"Task {i} result: {result}")
    except Exception as e:
        print(f"Error: {e}")

    # Method 2: wait (returns done/pending sets)
    tasks = [
        asyncio.create_task(process_item(i, i))
        for i in range(1, 4)
    ]
    done, pending = await asyncio.wait(tasks, timeout=2.5)

    print(f"Completed: {len(done)}, Pending: {len(pending)}")

    # Cancel pending tasks
    for task in pending:
        task.cancel()

    # Method 3: Task groups (Python 3.11+)
    async with asyncio.TaskGroup() as tg:
        for i in range(1, 4):
            tg.create_task(process_item(i, 1))
    # All tasks completed or exception raised

asyncio.run(main())

3. Async I/O Operations

  • Async file operations (aiofiles)
  • Async HTTP requests (aiohttp)
  • Async database operations (asyncpg, motor)
  • Async messaging (aio-pika)
  • Streams and protocols

Code Example:

import asyncio
import aiohttp
import aiofiles
from typing import List

# Async HTTP requests
async def fetch_url(session, url):
    async with session.get(url) as response:
        return await response.text()

async def fetch_multiple_urls(urls: List[str]):
    async with aiohttp.ClientSession() as session:
        tasks = [fetch_url(session, url) for url in urls]
        results = await asyncio.gather(*tasks)
        return results

# Async file operations
async def read_file_async(filepath):
    async with aiofiles.open(filepath, 'r') as f:
        content = await f.read()
        return content

async def write_file_async(filepath, content):
    async with aiofiles.open(filepath, 'w') as f:
        await f.write(content)

# Async database operations (example with asyncpg)
import asyncpg

async def fetch_users():
    conn = await asyncpg.connect(
        user='user',
        password='password',
        database='mydb',
        host='localhost'
    )
    try:
        rows = await conn.fetch('SELECT * FROM users')
        return rows
    finally:
        await conn.close()

# Usage
async def main():
    # Fetch URLs concurrently
    urls = [
        'https://api.example.com/data1',
        'https://api.example.com/data2',
        'https://api.example.com/data3',
    ]
    results = await fetch_multiple_urls(urls)

    # Read/write files
    content = await read_file_async('input.txt')
    await write_file_async('output.txt', content.upper())

    # Database operations
    users = await fetch_users()
    print(f"Found {len(users)} users")

asyncio.run(main())

4. Async Web Frameworks

  • FastAPI async routes
  • aiohttp web server
  • WebSocket handling
  • Background tasks
  • Middleware and dependencies

Code Example:

# FastAPI async example
from fastapi import FastAPI, BackgroundTasks
import asyncio

app = FastAPI()

# Async route
@app.get("/users/{user_id}")
async def get_user(user_id: int):
    # Async database call
    user = await fetch_user_from_db(user_id)
    return user

# Background task
async def send_notification(email: str, message: str):
    await asyncio.sleep(2)  # Simulate email sending
    print(f"Sent email to {email}: {message}")

@app.post("/orders/")
async def create_order(order_data: dict, background_tasks: BackgroundTasks):
    # Process order synchronously
    order_id = save_order(order_data)

    # Send notification in background
    background_tasks.add_task(
        send_notification,
        order_data['customer_email'],
        f"Order #{order_id} created"
    )

    return {"order_id": order_id}

# aiohttp web server
from aiohttp import web

async def handle_request(request):
    name = request.match_info.get('name', 'Anonymous')
    await asyncio.sleep(1)  # Async operation
    return web.json_response({'message': f'Hello {name}'})

app = web.Application()
app.add_routes([web.get('/{name}', handle_request)])

# WebSocket example
async def websocket_handler(request):
    ws = web.WebSocketResponse()
    await ws.prepare(request)

    async for msg in ws:
        if msg.type == web.WSMsgType.TEXT:
            await ws.send_str(f"Echo: {msg.data}")
        elif msg.type == web.WSMsgType.ERROR:
            print(f'Error: {ws.exception()}')

    return ws

app.add_routes([web.get('/ws', websocket_handler)])

Hands-On Practice

Project 1: Async Web Scraper

Build a concurrent web scraper with rate limiting.

Requirements:

  • Scrape multiple websites concurrently
  • Implement rate limiting
  • Handle errors gracefully
  • Save results to async database
  • Progress tracking
  • Retry failed requests

Key Skills: aiohttp, async I/O, error handling

Project 2: Real-time Chat Server

Create a WebSocket-based chat application.

Requirements:

  • WebSocket server with aiohttp
  • Multiple chat rooms
  • User authentication
  • Message broadcasting
  • Connection management
  • Message history persistence

Key Skills: WebSockets, async server, state management

Project 3: Async Task Queue

Build a distributed task processing system.

Requirements:

  • Task queue with Redis/RabbitMQ
  • Worker pool management
  • Task prioritization
  • Result caching
  • Progress monitoring
  • Graceful shutdown

Key Skills: Message queues, concurrent workers, cleanup

Assessment Criteria

  • Understand async/await semantics
  • Write efficient concurrent code
  • Handle async exceptions properly
  • Use asyncio tasks effectively
  • Build async web applications
  • Debug async code
  • Manage async resources (cleanup)

Resources

Official Documentation

Learning Platforms

Tools

Next Steps

After mastering asyncio, explore:

  • Multiprocessing - CPU-bound parallelism
  • Celery - Distributed task queue
  • gRPC - Async RPC framework
  • Kafka - Async event streaming

平台分布

Claude Code

27.69%
按下载量换算2,093

Antigravity

22.49%
按下载量换算1,700

OpenCode

18.32%
按下载量换算1,385

Gemini CLI

12.83%
按下载量换算970

trae

6.61%
按下载量换算500

Cursor

3.43%
按下载量换算259

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills