auto-concurrency

Detect and fix concurrency bugs in async and multi-threaded code.

6|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/Corvalis-LLC/Crow-Stack --skill auto-concurrency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auto-concurrency
Source: https://github.com/Corvalis-LLC/Crow-Stack/tree/main/skills/auto-concurrency
Command: npx skills add https://github.com/Corvalis-LLC/Crow-Stack --skill auto-concurrency

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Concurrency bugs are a major source of instability in asynchronous and multi-threaded code. This Skill helps identify and fix race conditions, atomicity violations, and improper lock management that lead to incorrect behavior and hard-to-diagnose failures.

Core Features & Use Cases

  • TOCTOU prevention: Encourage atomic operations and safe synchronization to avoid race checks followed by actions.
  • Atomic multi-step operations: Promote transactional patterns and careful locking to ensure state remains consistent.
  • Lock ordering and cancellation safety: Enforce consistent lock acquisition order and safe cancellation/shutdown handling.
  • Usage scenarios: For Rust/Tokio async code, systems relying on mutexes, RwLocks, channels, or task spawning to coordinate shared state.

Quick Start

Provide a small Rust async function that updates a shared counter under a mutex without holding the lock during any await.

Frequently Asked Questions about auto-concurrency

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

FAQPage Schema
How do I prevent deadlocks when holding a mutex across an await in Rust Tokio?

To prevent deadlocks in Tokio, avoid holding mutexes across await points by enforcing atomic operations and releasing locks before any asynchronous calls. This ensures shared state remains consistent without blocking tasks.

What is the best way to fix race conditions and TOCTOU bugs in async code?

Fixing TOCTOU and race conditions requires atomic multi-step mutations using transactional patterns and careful locking. This ensures state checks and subsequent actions execute without interruption from other threads.

How do I enforce consistent lock ordering to avoid deadlocks in multi-threaded applications?

Enforce consistent lock acquisition order across all threads to avoid deadlocks. Applying strict lock ordering guarantees that circular wait conditions cannot occur when coordinating shared state.

Does this concurrency auditing approach work with RwLocks and channels, or only standard mutexes?

This approach applies to codebases relying on mutexes, RwLocks, channels, and task spawning. It mitigates concurrency bugs across various synchronization primitives used to coordinate shared state.

How do I implement safe task cancellation and graceful shutdown in Tokio?

Implement safe cancellation by enforcing graceful shutdown handling and avoiding holding locks during cancellation. This prevents partial updates and atomicity violations when tasks are aborted.