# m07-concurrency

Guides Rust concurrency and async decisions, from Send/Sync errors to locks and channels. Use it when spawned tasks, shared state, or deadlocks need design review.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3500 installs · ★ 1545
- Author: actionbook
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/actionbook/rust-skills/tree/HEAD/skills/m07-concurrency/SKILL.md
- Updated: 2026-08-23
- HTML: https://affpapa.org/en/nevibecode/skills/m07-concurrency

## What it does

This skill guides Rust concurrency and async work by separating CPU-bound work from I/O-bound work, then checking how data is shared. It points CPU parallelism toward `std::thread` or `rayon`, while I/O concurrency uses `async/await` with `tokio` or `async-std`.

It helps select `Arc<T>` for immutable sharing, `Arc<Mutex<T>>` or `Arc<RwLock<T>>` for mutable state, channels for message passing, and atomic types for simple operations. It also covers `E0277`, a `future is not Send`, lock ordering, and a `MutexGuard` that remains alive across `await`.

The skill asks whether a type should cross thread boundaries before adding `Send` or wrapping it in a lock. Holding a lock across `await` can hold up other tasks, so that is a reason to tighten the guard's scope.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m07-concurrency -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/m07-concurrency/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/m07-concurrency/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m07-concurrency -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/m07-concurrency/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m07-concurrency -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/m07-concurrency/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install actionbook/rust-skills m07-concurrency
```

2. **Manually: put the files in place**
- File: `.github/skills/m07-concurrency/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m07-concurrency -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/actionbook/rust-skills --path skills/m07-concurrency
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/m07-concurrency/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m07-concurrency -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/actionbook/rust-skills/tree/HEAD/skills/m07-concurrency/SKILL.md

## When to use it
- diagnose an `E0277` `Send` or `Sync` error
- choose threads or `async/await` for Rust work
- share state across threads with channels
- keep `MutexGuard` out of an `await` scope
- trace a deadlock to lock ordering

## Example prompts
- Analyse this `E0277` error: my type cannot be sent between threads.
- I need parallel CPU work in Rust. Should this use `std::thread` or `rayon`?
- Check why this `future is not Send` after `await` in `tokio::spawn`.

## Similar
- [rust-async-patterns](https://affpapa.org/en/nevibecode/skills/rust-async-patterns.md) — skill · 20625 installs
- [csharp-concurrency-patterns](https://affpapa.org/en/nevibecode/skills/csharp-concurrency-patterns.md) — skill · 1600 installs
- [asyncio-concurrency-patterns](https://affpapa.org/en/nevibecode/skills/asyncio-concurrency-patterns.md) — skill · 489 installs
- [rust-engineer](https://affpapa.org/en/nevibecode/skills/rust-engineer.md) — skill · 6300 installs
- [rust](https://affpapa.org/en/nevibecode/skills/mindrally-rust.md) — skill · 778 installs
- [rust-async-internals](https://affpapa.org/en/nevibecode/skills/rust-async-internals.md) — skill · 467 installs

From the same set: [actionbook/rust-skills](https://affpapa.org/en/nevibecode/by/actionbook/rust-skills.md) — 35 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
