Skip to main content
skill Claude Code CX Codex Cursor

rust-async-patterns — Claude Code skill: async Rust

A skill for building and debugging async Rust with Tokio, tasks, channels, streams, and error handling. Use it for concurrent services and async I/O.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install systems-programming@claude-code-workflows
Open on GitHub

What rust-async-patterns does

rust-async-patterns gives guidance for async Rust with Tokio. It covers the Future model, async fn, await, spawned tasks, and the runtime, then applies those ideas to channels, streams, and concurrent operations. It fits async applications, network services, and debugging work.

The starter setup uses tokio, futures, async-trait, anyhow, tracing, and tracing-subscriber in Cargo.toml. The skill also discusses tokio::select!, JoinSet, CancellationToken, semaphore limits, error propagation, and avoiding locks across await points. More worked patterns are in references/details.md.

Install it when your project uses Tokio or you need a clear way to reason about concurrent Rust. It is a poor fit for a purely synchronous Rust codebase.

What it helps with

  • set up a Tokio async application
  • reason about futures, await, and spawned tasks
  • coordinate work through channels
  • handle errors in concurrent Rust code
  • trace cancellation and blocking issues

Example prompts for the agent

  • Review this async Rust service and find locks held across await points.
  • Show how to replace shared state with channels and manage tasks with JoinSet.
  • Check error propagation and cancellation in this Tokio code.

How to install rust-async-patterns

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install systems-programming@claude-code-workflows

This installs the whole systems-programming plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill rust-async-patterns -a claude-code

3Manually: put the files in place

~/.claude/skills/rust-async-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/rust-async-patterns/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

containerize-aspnet-framework official github This skill prepares a Windows-container Dockerfile for an ASP.NET .NET Framework project. Use it when the image needs project-specific IIS, dependency, or build settings. GitHub Copilot 8,700installs ruby-mcp-server-generator official github Generates a Ruby MCP server project using the official SDK. Use it when you want tools, prompts, resources, and tests in the initial project. GitHub Copilot 8,600installs add-lang colbymchenry Adds a new language to codegraph through tree-sitter, tests the extractor, and measures extraction and retrieval on real repositories. Claude Code CX Codex Cursor +1 1,200installs tdd-rust rtk-ai Skill for RTK filter development using TDD. Write a test with real data, implement minimum code, verify token savings, lock the output format with insta snapshots. Claude Code CX Codex Cursor +1 1,400installs migrate-to-shoehorn Matt Pocock Replaces as type assertions in tests with helpers from @total-typescript/shoehorn. Use it when tests need partial objects or deliberately invalid data. Claude Code 475,388installs write-swift emilkowalski This skill guides Swift coding, reviews, and migrations using the language’s current practices. Use it to investigate concurrency errors, hangs, data races, or retain cycles. Claude Code CX Codex Cursor +1 117,500installs megacave JuliusBrussee Switches agent responses to Classical Chinese (wenyan) to reduce terminal output. Activated via /megacave or /caveman wenyan. Claude Code CX Codex Cursor +1 24,400installs find-docs upstash Pulls up-to-date documentation, API references and code examples for any library through the Context7 CLI. Useful when the model's training data lags behind the API. Claude Code CX Codex Cursor +1 9,400installs

Questions about rust-async-patterns

How do I install rust-async-patterns in Claude Code?

Run npx skills add wshobson/agents --skill rust-async-patterns -a claude-code. The skill is placed at ~/.claude/skills/rust-async-patterns/SKILL.md.

What does rust-async-patterns do?

It guides async Rust development with Tokio, including tasks, channels, streams, error handling, cancellation, and debugging patterns.

What dependencies do the rust-async-patterns examples use?

The starter Cargo.toml includes tokio, futures, async-trait, anyhow, tracing, and tracing-subscriber.

Source text

SKILL.md · MIT
---
name: rust-async-patterns
description: Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns. Use when building async Rust applications, implementing concurrent systems, or debugging async code.
---

# Rust Async Patterns

Production patterns for async Rust programming with Tokio runtime, including tasks, channels, streams, and error handling.

## When to Use This Skill

- Building async Rust applications
- Implementing concurrent network services
- Using Tokio for async I/O
- Handling async errors properly
- Debugging async code issues
- Optimizing async performance

## Core Concepts

### 1. Async Execution Model

```
Future (lazy) → poll() → Ready(value) | Pending
                ↑           ↓
              Waker ← Runtime schedules
```

### 2. Key Abstractions

| Concept    | Purpose                                  |
| ---------- | ---------------------------------------- |
| `Future`   | Lazy computation that may complete later |
| `async fn` | Function returning impl Future           |
| `await`    | Suspend until future completes           |
| `Task`     | Spawned future running concurrently      |
| `Runtime`  | Executor that polls futures              |

## Quick Start

```toml
# Cargo.toml
[dependencies]
tokio = { version = "1", features = ["full"] }
futures = "0.3"
async-trait = "0.1"
anyhow = "1.0"
tracing = "0.1"
tracing-subscriber = "0.3"
```

```rust
use tokio::time::{sleep, Duration};
use anyhow::Result;

#[tokio::main]
async fn main() -> Result<()> {
    // Initialize tracing
    tracing_subscriber::fmt::init();

    // Async operations
    let result = fetch_data("https://api.example.com").await?;
    println!("Got: {}", result);

    Ok(())
}

async fn fetch_data(url: &str) -> Result<String> {
    // Simulated async operation
    sleep(Duration::from_millis(100)).await;
    Ok(format!("Data from {}", url))
}
```

## Detailed patterns and worked examples

Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.

## Best Practices

### Do's

- **Use `tokio::select!`** - For racing futures
- **Prefer channels** - Over shared state when possible
- **Use `JoinSet`** - For managing multiple tasks
- **Instrument with tracing** - For debugging async code
- **Handle cancellation** - Check `CancellationToken`

### Don'ts

- **Don't block** - Never use `std::thread::sleep` in async
- **Don't hold locks across awaits** - Causes deadlocks
- **Don't spawn unboundedly** - Use semaphores for limits
- **Don't ignore errors** - Propagate with `?` or log
- **Don't forget Send bounds** - For spawned futures

© Seth Hobson · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor