sb-dev/openquant / .agents/skills/rust-review
rust-review
VerifiedReview Rust crates, services, or libraries for safe/unsafe boundary issues, memory safety, concurrency hazards, panic-induced denial of service, FFI safety, and async runtime mistakes. Use for a Rust security audit, especially unsafe, FFI, or concurrent code.
upstream/prompts/general/async-blocking-finder.md
View on GitHub---
name: async-blocking-finder
description: Detects std::sync, std::fs, std::thread::sleep, or other blocking std calls inside async functions
---
**Finding ID Prefix:** `ASYNCBLOCK`.
**Gates:**
1. Inside `async fn` or `async {}` block.
2. Blocking call: `std::sync::{Mutex,RwLock}::lock`, `std::fs::*`, `std::thread::sleep`, `std::net::*`, blocking channel.
3. Not already offloaded via `tokio::task::spawn_blocking` / `block_in_place`. **Caveats:** `block_in_place` requires the multi-thread runtime (it *panics* on a `current_thread` runtime), so a `block_in_place` wrapper is not a universal clear; and **neither** wrapper resolves the `std::sync::Mutex`/`RwLock` guard held *across* an `.await` (the guard is `!Send` and its lifetime spanning the await is the defect — the synchronous closure passed to `spawn_blocking`/`block_in_place` cannot span an await).
**Patch:** switch to `tokio::sync` / `tokio::fs` / `tokio::time::sleep`, or offload genuinely-blocking CPU/IO work via `spawn_blocking` (use `block_in_place` only on the multi-thread runtime). For a lock guard held across `.await`, use `tokio::sync::Mutex` or drop the guard before the await — wrapping in `spawn_blocking`/`block_in_place` cannot fix that case.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |