
M07 Concurrency
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-codeInstalls 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
| Error | Don't Just Say | Ask 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:
-
What's the workload?
- CPU-bound → threads (std::thread, rayon)
- I/O-bound → async (tokio, async-std)
- Mixed → hybrid approach
-
What's the sharing model?
- No sharing → message passing (channels)
- Immutable sharing → Arc
- Mutable sharing → Arc<Mutex> or Arc<RwLock>
-
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- M06 Error Handling827
- Rust Refactor Helper821
- M01 Ownership809
- M04 Zero Cost789
- M05 Type Driven786
- M02 Resource783
- M03 Mutability773
- M12 Lifecycle764
- M14 Mental Model751
- M09 Domain750
- M11 Ecosystem747
- M13 Domain Error738
- Rust Trait Explorer731
- Rust Code Navigator728
- Unsafe Checker726
- Domain Cli709
- Rust Symbol Analyzer702
- Rust Call Graph699
- Rust Router698
- Rust Learner688
- Rust Deps Visualizer684
- Rust Skill Creator670
- Domain Web648
- Meta Cognition Parallel635