rust-concurrency

Detect Rust concurrency bugs and anti-patterns across threads and async contexts.

Updated May 26, 2026
One-click install
npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill rust-concurrency-adelabdelgawad
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-concurrency
Source: https://github.com/adelabdelgawad/rust-fullstack-agents/tree/main/plugins/rusty/skills/rust-concurrency
Command: npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill rust-concurrency-adelabdelgawad

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust's safe concurrency model helps prevent data races, but real-world code still suffers from deadlocks, poisoned mutexes, and misuse of non-thread-safe types across threads and async tasks. This skill guides detection and remediation by outlining common anti-patterns, safe patterns, and review techniques to keep Rust code reliable under concurrency.

Core Features & Use Cases

  • Identify patterns that break Send/Sync guarantees, such as holding a MutexGuard across await, using Rc/RefCell across thread or task boundaries, or spawning non-Send futures.
  • Propose safe replacements and best practices for Arc<Mutex<T>>, Arc<RwLock<T>>, and blocking operations in async contexts (e.g., spawn_blocking) to avoid starving executors.
  • Apply during code reviews, audits, and onboarding to improve reliability and correctness of multi-threaded Rust applications.

Quick Start

Audit a Rust codebase to surface concurrency pitfalls and propose safe replacements for shared state and async boundaries.

Frequently Asked Questions about rust-concurrency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find Rust concurrency bugs related to Arc<Mutex<T>> and Send/Sync violations?

To find Rust concurrency bugs, audit code for anti-patterns like holding MutexGuard across .await, using Rc/RefCell across spawn boundaries, and spawning non-Send futures. This skill identifies Send/Sync violations and proposes safe replacements like tokio::sync::Mutex.

Why does holding a MutexGuard across an await point cause issues in async Rust?

Holding a MutexGuard across an await point can cause deadlocks and block async executors. This skill detects this anti-pattern and requires safe replacements such as tokio::sync::Mutex or tokio::spawn_blocking to maintain async concurrency safety.

How do I prevent deadlocks from inconsistent lock ordering in Rust multi-threaded applications?

Preventing deadlocks requires analyzing lock acquisition order across threads. This skill detects deadlock risks from inconsistent lock ordering in Rust concurrency code and guides remediation by enforcing consistent lock patterns and safe state sharing.

When should I use tokio::spawn_blocking instead of standard blocking operations in async contexts?

Use tokio::spawn_blocking for blocking operations in async contexts to avoid starving executors. This skill identifies blocking behaviors in async Rust code and enforces safe replacements like spawn_blocking to ensure reliable concurrency.

Can I use Rc or RefCell across thread or task boundaries in Tokio async tasks?

Using Rc or RefCell across thread or task boundaries breaks Send/Sync guarantees and causes concurrency issues. This skill surfaces these non-thread-safe type violations across spawns and proposes safe alternatives for shared state management.

What is the best way to audit a Rust codebase for async concurrency anti-patterns during code review?

Auditing a Rust codebase for async concurrency anti-patterns involves checking for MutexGuard across await, blocking operations, and Send/Sync violations. This skill applies these detection patterns during code reviews to improve multi-threaded application reliability.