The m07-concurrency skill guides developers through Rust's concurrency and async patterns by mapping errors to underlying design questions about workload type, data sharing models, and thread safety requirements. It serves Rust developers encountering Send/Sync errors, deadlocks, or race conditions, helping them diagnose whether problems stem from incorrect primitive choice (threads vs. async), sharing strategy (channels vs. Mutex), or domain-specific constraints. The skill prioritizes tracing errors upward to domain context (web APIs, fintech, CLI) before applying fixes, preventing misuse of concurrency primitives like Rc in thread-safe contexts.

skills.sh installs
844
GitHub stars
1.3K
last updated
Jul 14, 2026

Install

$ npx -y skills add zhanghandong/rust-skills --skill m07-concurrency --agent claude-code

Installs into .claude/skills of the current project.

Files

Concurrency

Layer 1: Language Mechanics

Core Question

Is this CPU-bound or I/O-bound, and what's the sharing model?

Before choosing concurrency primitives:

  • What's the workload type?
  • What data needs to be shared?
  • What's the thread safety requirement?

Error → Design Question

ErrorDon't Just SayAsk Instead
E0277 Send"Add Send bound"Should this type cross threads?
E0277 Sync"Wrap in Mutex"Is shared access really needed?
Future not Send"Use spawn_local"Is async the right choice?
Deadlock"Reorder locks"Is the locking design correct?

Thinking Prompt

Before adding concurrency:

  1. What's the workload?

    • CPU-bound → threads (std::thread, rayon)
    • I/O-bound → async (tokio, async-std)
    • Mixed → hybrid approach
  2. What's the sharing model?

    • No sharing → message passing (channels)
    • Immutable sharing → Arc
    • Mutable sharing → Arc<Mutex> or Arc<RwLock>
  3. What are the Send/Sync requirements?

    • Cross-thread ownership → Send
    • Cross-thread references → Sync
    • Single-thread async → spawn_local

Sponsors

Details

Repository
github.com/zhanghandong/rust-skills
Category
Rust

More from zhanghandong/rust-skills

All 34

Recommended

More Rust
1zhanghandong avatarm06-error-handlingzhanghandong/rust-skillsm06 error handling827skills.sh installs
2zhanghandong avatarm04-zero-costzhanghandong/rust-skillsm04 zero cost789skills.sh installs
3zhanghandong avatarm05-type-drivenzhanghandong/rust-skillsm05 type driven786skills.sh installs
4zhanghandong avatarm13-domain-errorzhanghandong/rust-skillsm13 domain error738skills.sh installs
5zhanghandong avatardomain-clizhanghandong/rust-skillsdomain cli709skills.sh installs
6zhanghandong avatardomain-cloud-nativezhanghandong/rust-skillsdomain cloud native596skills.sh installs