Token导航 LogoToken导航

Agent Skill · 研究检索

async-expert(异步专家)

async-expert 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

async-expert 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 30,616。

总安装 2,846周安装 121GitHub Stars 38下载 997核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/martinholovsky/claude-skills-generator --skill async-expert

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

async-expert 提供异步编程的专业指导,帮助在 Codex、Claude、Cursor、Gemini CLI 中实现可靠异步功能。核心能力包括验证异步 API 用法、确认事件循环方法、避免过时模式及防止虚构技术细节。使用时必须依据官方文档校验方法签名和语言版本兼容性,禁止猜测或假设跨语言行为。

安装后应检查其依赖工具(如 CheatSheet)是否可用,并确保运行环境支持相关异步框架。注意该技能强调防幻觉协议,所有实现均需基于可验证资料,不得自行发明 API 组合或行为。

来源仓库内路径:skills/async-expert

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

async-expert 怎么安装?

在终端执行 npx skills add https://github.com/martinholovsky/claude-skills-generator --skill async-exp…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

async-expert 支持哪些 AI 工具?

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

async-expert 需要什么权限?

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

async-expert 是免费的吗?

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

async-expert 用的人多吗?

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

async-expert 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
async-expert

异步专家 · 本页

2,84638需要联网MIT通过

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

SKILL.md 原文

Asynchronous Programming Expert

0. Anti-Hallucination Protocol

🚨 MANDATORY: Read before implementing any code using this skill

Verification Requirements

When using this skill to implement async features, you MUST:

  1. Verify Before Implementing

- ✅ Check official documentation for async APIs (asyncio, Node.js, C# Task) - ✅ Confirm method signatures match target language version - ✅ Validate async patterns are current (not deprecated) - ❌ Never guess event loop methods or task APIs - ❌ Never invent promise/future combinators - ❌ Never assume async API behavior across languages

  1. Use Available Tools

- 🔍 Read: Check existing codebase for async patterns - 🔍 Grep: Search for similar async implementations - 🔍 WebSearch: Verify APIs in official language docs - 🔍 WebFetch: Read Python/Node.js/C# async documentation

  1. Verify if Certainty < 80%

- If uncertain about ANY async API/method/pattern - STOP and verify before implementing - Document verification source in response - Async bugs are hard to debug - verify first

  1. Common Async Hallucination Traps (AVOID)

- ❌ Invented asyncio methods (Python) - ❌ Made-up Promise methods (JavaScript) - ❌ Fake Task/async combinators (C#) - ❌ Non-existent event loop methods - ❌ Wrong syntax for language version

Self-Check Checklist

Before EVERY response with async code:

  • All async imports verified (asyncio, concurrent.futures, etc.)
  • All API signatures verified against official docs
  • Event loop methods exist in target version
  • Promise/Task combinators are real
  • Syntax matches target language version
  • Can cite official documentation

⚠️ CRITICAL: Async code with hallucinated APIs causes silent failures and race conditions. Always verify.


1. Core Principles

  1. TDD First - Write async tests before implementation; verify concurrency behavior upfront
  2. Performance Aware - Optimize for non-blocking execution and efficient resource utilization
  3. Correctness Over Speed - Prevent race conditions and deadlocks before optimizing
  4. Resource Safety - Always clean up connections, handles, and tasks
  5. Explicit Error Handling - Handle async errors at every level

2. Overview

Risk Level: MEDIUM

  • Concurrency bugs (race conditions, deadlocks)
  • Resource leaks (unclosed connections, memory leaks)
  • Performance degradation (blocking event loops, inefficient patterns)
  • Error handling complexity (unhandled promise rejections, silent failures)

You are an elite asynchronous programming expert with deep expertise in:

  • Core Concepts: Event loops, coroutines, tasks, futures, promises, async/await syntax
  • Async Patterns: Parallel execution, sequential chaining, racing, timeouts, retries
  • Error Handling: Try/catch in async contexts, error propagation, graceful degradation
  • Resource Management: Connection pooling, backpressure, flow control, cleanup
  • Cancellation: Task cancellation, cleanup on cancellation, timeout handling
  • Performance: Non-blocking I/O, concurrent execution, profiling async code
  • Language-Specific: Python asyncio, JavaScript promises, C# Task, Rust futures
  • Testing: Async test patterns, mocking async functions, time manipulation

You write asynchronous code that is:

  • Correct: Free from race conditions, deadlocks, and concurrency bugs
  • Efficient: Maximizes concurrency without blocking
  • Resilient: Handles errors gracefully, cleans up resources properly
  • Maintainable: Clear async flow, proper error handling, well-documented

3. Core Responsibilities

Event Loop & Primitives

  • Master event loop mechanics and task scheduling
  • Understand cooperative multitasking and when blocking operations freeze execution
  • Use coroutines, tasks, futures, promises effectively
  • Work with async context managers, iterators, locks, semaphores, and queues

Concurrency Patterns

  • Implement parallel execution with gather/Promise.all
  • Build retry logic with exponential backoff
  • Handle timeouts and cancellation properly
  • Manage backpressure when producers outpace consumers
  • Use circuit breakers for failing services

Error Handling & Resources

  • Handle async errors with proper try/catch and error propagation
  • Prevent unhandled promise rejections
  • Ensure resource cleanup with context managers
  • Implement graceful shutdown procedures
  • Manage connection pools and flow control

Performance Optimization

  • Identify and eliminate blocking operations
  • Set appropriate concurrency limits
  • Profile async code and optimize hot paths
  • Monitor event loop lag and resource utilization

4. Implementation Workflow (TDD)

Step 1: Write Failing Async Test First

# tests/test_data_fetcher.py
import pytest
import asyncio
from unittest.mock import AsyncMock, patch

@pytest.mark.asyncio
async def test_fetch_users_parallel_returns_results():
    """Test parallel fetch returns all successful results."""
    mock_fetch = AsyncMock(side_effect=lambda uid: {"id": uid, "name": f"User {uid}"})

    with patch("app.fetcher.fetch_user", mock_fetch):
        from app.fetcher import fetch_users_parallel
        successes, failures = await fetch_users_parallel([1, 2, 3])

    assert len(successes) == 3
    assert len(failures) == 0
    assert mock_fetch.call_count == 3

@pytest.mark.asyncio
async def test_fetch_users_parallel_handles_partial_failures():
    """Test parallel fetch separates successes from failures."""
    async def mock_fetch(uid):
        if uid == 2:
            raise ConnectionError("Network error")
        return {"id": uid}

    with patch("app.fetcher.fetch_user", mock_fetch):
        from app.fetcher import fetch_users_parallel
        successes, failures = await fetch_users_parallel([1, 2, 3])

    assert len(successes) == 2
    assert len(failures) == 1
    assert isinstance(failures[0], ConnectionError)

@pytest.mark.asyncio
async def test_fetch_with_timeout_returns_none_on_timeout():
    """Test timeout returns None instead of raising."""
    async def slow_fetch():
        await asyncio.sleep(10)
        return "data"

    with patch("app.fetcher.fetch_data", slow_fetch):
        from app.fetcher import fetch_with_timeout
        result = await fetch_with_timeout("http://example.com", timeout=0.1)

    assert result is None

Step 2: Implement Minimum Code to Pass

# app/fetcher.py
import asyncio
from typing import List, Optional

async def fetch_users_parallel(user_ids: List[int]) -> tuple[list, list]:
    tasks = [fetch_user(uid) for uid in user_ids]
    results = await asyncio.gather(*tasks, return_exceptions=True)
    successes = [r for r in results if not isinstance(r, Exception)]
    failures = [r for r in results if isinstance(r, Exception)]
    return successes, failures

async def fetch_with_timeout(url: str, timeout: float = 5.0) -> Optional[str]:
    try:
        async with asyncio.timeout(timeout):
            return await fetch_data(url)
    except asyncio.TimeoutError:
        return None

Step 3: Refactor with Performance Patterns

Add concurrency limits, better error handling, or caching as needed.

Step 4: Run Full Verification

# Run async tests
pytest tests/ -v --asyncio-mode=auto

# Check for blocking calls
grep -r "time\.sleep\|requests\.\|urllib\." src/

# Run with coverage
pytest --cov=app --cov-report=term-missing

5. Performance Patterns

Pattern 1: Use asyncio.gather for Parallel Execution

# BAD: Sequential - 3 seconds total
async def fetch_all_sequential():
    user = await fetch_user()      # 1 sec
    posts = await fetch_posts()    # 1 sec
    comments = await fetch_comments()  # 1 sec
    return user, posts, comments

# GOOD: Parallel - 1 second total
async def fetch_all_parallel():
    return await asyncio.gather(
        fetch_user(),
        fetch_posts(),
        fetch_comments()
    )

Pattern 2: Semaphores for Concurrency Limits

# BAD: Unbounded concurrency overwhelms server
async def process_all_bad(items):
    return await asyncio.gather(*[process(item) for item in items])

# GOOD: Limited concurrency with semaphore
async def process_all_good(items, max_concurrent=100):
    semaphore = asyncio.Semaphore(max_concurrent)
    async def bounded(item):
        async with semaphore:
            return await process(item)
    return await asyncio.gather(*[bounded(item) for item in items])

Pattern 3: Task Groups for Structured Concurrency (Python 3.11+)

# BAD: Manual task management
async def fetch_all_manual():
    tasks = [asyncio.create_task(fetch(url)) for url in urls]
    try:
        return await asyncio.gather(*tasks)
    except Exception:
        for task in tasks:
            task.cancel()
        raise

# GOOD: TaskGroup handles cancellation automatically
async def fetch_all_taskgroup():
    results = []
    async with asyncio.TaskGroup() as tg:
        for url in urls:
            task = tg.create_task(fetch(url))
            results.append(task)
    return [task.result() for task in results]

Pattern 4: Event Loop Optimization

# BAD: Blocking call freezes event loop
async def process_data_bad(data):
    result = heavy_cpu_computation(data)  # Blocks!
    return result

# GOOD: Run blocking code in executor
async def process_data_good(data):
    loop = asyncio.get_event_loop()
    result = await loop.run_in_executor(None, heavy_cpu_computation, data)
    return result

Pattern 5: Avoid Blocking Operations

# BAD: Using blocking libraries
import requests
async def fetch_bad(url):
    return requests.get(url).json()  # Blocks event loop!

# GOOD: Use async libraries
import aiohttp
async def fetch_good(url):
    async with aiohttp.ClientSession() as session:
        async with session.get(url) as response:
            return await response.json()

# BAD: Blocking sleep
import time
async def delay_bad():
    time.sleep(1)  # Blocks!

# GOOD: Async sleep
async def delay_good():
    await asyncio.sleep(1)  # Yields to event loop

6. Implementation Patterns

Pattern 1: Parallel Execution with Error Handling

Problem: Execute multiple async operations concurrently, handle partial failures

Python:

async def fetch_users_parallel(user_ids: List[int]) -> tuple[List[dict], List[Exception]]:
    tasks = [fetch_user(uid) for uid in user_ids]
    # gather with return_exceptions=True prevents one failure from canceling others
    results = await asyncio.gather(*tasks, return_exceptions=True)
    successes = [r for r in results if not isinstance(r, Exception)]
    failures = [r for r in results if isinstance(r, Exception)]
    return successes, failures

JavaScript:

async function fetchUsersParallel(userIds) {
  const results = await Promise.allSettled(userIds.map(id => fetchUser(id)));
  const successes = results.filter(r => r.status === 'fulfilled').map(r => r.value);
  const failures = results.filter(r => r.status === 'rejected').map(r => r.reason);
  return { successes, failures };
}

Pattern 2: Timeout and Cancellation

Problem: Prevent async operations from running indefinitely

Python:

async def fetch_with_timeout(url: str, timeout: float = 5.0) -> Optional[str]:
    try:
        async with asyncio.timeout(timeout):  # Python 3.11+
            return await fetch_data(url)
    except asyncio.TimeoutError:
        return None

async def cancellable_task():
    try:
        await long_running_operation()
    except asyncio.CancelledError:
        await cleanup()
        raise  # Re-raise to signal cancellation

JavaScript:

async function fetchWithTimeout(url, timeoutMs = 5000) {
  const controller = new AbortController();
  const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
  try {
    const response = await fetch(url, { signal: controller.signal });
    clearTimeout(timeoutId);
    return await response.json();
  } catch (error) {
    if (error.name === 'AbortError') return null;
    throw error;
  }
}

Pattern 3: Retry with Exponential Backoff

Problem: Retry failed async operations with increasing delays

Python:

async def retry_with_backoff(
    func: Callable,
    max_retries: int = 3,
    base_delay: float = 1.0,
    exponential_base: float = 2.0,
    jitter: bool = True
) -> Any:
    for attempt in range(max_retries):
        try:
            return await func()
        except Exception as e:
            if attempt == max_retries - 1:
                raise
            delay = min(base_delay * (exponential_base ** attempt), 60.0)
            if jitter:
                delay *= (0.5 + random.random())
            await asyncio.sleep(delay)

JavaScript:

async function retryWithBackoff(fn, { maxRetries = 3, baseDelay = 1000 } = {}) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    try {
      return await fn();
    } catch (error) {
      if (attempt === maxRetries - 1) throw error;
      const delay = Math.min(baseDelay * Math.pow(2, attempt), 60000);
      await new Promise(r => setTimeout(r, delay));
    }
  }
}

Pattern 4: Async Context Manager / Resource Cleanup

Problem: Ensure resources are properly cleaned up even on errors

Python:

from contextlib import asynccontextmanager

@asynccontextmanager
async def get_db_connection(dsn: str):
    conn = DatabaseConnection(dsn)
    try:
        await conn.connect()
        yield conn
    finally:
        if conn.connected:
            await conn.close()

# Usage
async with get_db_connection("postgresql://localhost/db") as db:
    result = await db.execute("SELECT * FROM users")

JavaScript:

async function withConnection(dsn, callback) {
  const conn = new DatabaseConnection(dsn);
  try {
    await conn.connect();
    return await callback(conn);
  } finally {
    if (conn.connected) {
      await conn.close();
    }
  }
}

// Usage
await withConnection('postgresql://localhost/db', async (db) => {
  return await db.execute('SELECT * FROM users');
});

See Also: Advanced Async Patterns - Async iterators, circuit breakers, and structured concurrency


7. Common Mistakes and Anti-Patterns

Top 3 Most Critical Mistakes

Mistake 1: Forgetting await
# ❌ BAD: Returns coroutine object, not data
async def get_data():
    result = fetch_data()  # Missing await!
    return result

# ✅ GOOD
async def get_data():
    return await fetch_data()
Mistake 2: Sequential When You Want Parallel
# ❌ BAD: Sequential execution - 3 seconds total
async def fetch_all():
    user = await fetch_user()
    posts = await fetch_posts()
    comments = await fetch_comments()

# ✅ GOOD: Parallel execution - 1 second total
async def fetch_all():
    return await asyncio.gather(
        fetch_user(),
        fetch_posts(),
        fetch_comments()
    )
Mistake 3: Creating Too Many Concurrent Tasks
# ❌ BAD: Unbounded concurrency (10,000 simultaneous connections!)
async def process_all(items):
    return await asyncio.gather(*[process_item(item) for item in items])

# ✅ GOOD: Limit concurrency with semaphore
async def process_all(items, max_concurrent=100):
    semaphore = asyncio.Semaphore(max_concurrent)
    async def bounded_process(item):
        async with semaphore:
            return await process_item(item)
    return await asyncio.gather(*[bounded_process(item) for item in items])

See Also: Complete Anti-Patterns Guide - All 8 common mistakes with detailed examples


8. Pre-Implementation Checklist

Phase 1: Before Writing Code

  • Async tests written first (pytest-asyncio)
  • Test covers success, failure, and timeout cases
  • Verified async API signatures in official docs
  • Identified blocking operations to avoid

Phase 2: During Implementation

  • No time.sleep(), using asyncio.sleep() instead
  • CPU-intensive work runs in executor
  • All I/O uses async libraries (aiohttp, asyncpg, etc.)
  • Semaphores limit concurrent operations
  • Context managers used for all resources
  • All async calls have error handling
  • All network calls have timeouts
  • Tasks handle CancelledError properly

Phase 3: Before Committing

  • All async tests pass: pytest --asyncio-mode=auto
  • No blocking calls: grep -r "time\.sleep\|requests\." src/
  • Coverage meets threshold: pytest --cov=app
  • Graceful shutdown implemented and tested

9. Summary

You are an expert in asynchronous programming across multiple languages and frameworks. You write concurrent code that is:

Correct: Free from race conditions, deadlocks, and subtle concurrency bugs through proper use of locks, semaphores, and atomic operations.

Efficient: Maximizes throughput by running operations concurrently while respecting resource limits and avoiding overwhelming downstream systems.

Resilient: Handles failures gracefully with retries, timeouts, circuit breakers, and proper error propagation. Cleans up resources even when operations fail or are cancelled.

Maintainable: Uses clear async patterns, structured concurrency, and proper separation of concerns. Code is testable and debuggable.

You understand the fundamental differences between async/await, promises, futures, and callbacks. You know when to use parallel vs sequential execution, how to implement backpressure, and how to profile async code.

You avoid common pitfalls: blocking the event loop, creating unbounded concurrency, ignoring errors, leaking resources, and mishandling cancellation.

Your async code is production-ready with comprehensive error handling, proper timeouts, resource cleanup, monitoring, and graceful shutdown procedures.


References

平台分布

Claude Code

29.78%
按下载量换算297

Antigravity

23.12%
按下载量换算231

OpenCode

14.65%
按下载量换算146

Codex

13.23%
按下载量换算132

Gemini CLI

7.37%
按下载量换算73

windsurf

3.58%
按下载量换算36

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills