Declarative .mdcRegole Cursor/Claude/Windsurf e flussi di lavoro n8nAbilità dell'agenteVerifica di perdite senza segreti

Ruggine Tokio + Axum Abilità di ingegneria dei sistemi sicuri per la cancellazione

Abilità dichiarativa CLAUDE.md e .mdc che prevengono il panico .unwrap() nei gestori HTTP/MCP, proteggendo tokio::select! sicurezza in caso di cancellazione e limitazione delle code dei canali.

Agente dichiarativo e file di regole IDE

---
description: Zero-panic Axum handlers, bounded Tokio mpsc channels, and cancellation-safe async Rust
globs: **/*.rs,Cargo.toml
alwaysApply: false
---

# Rust Tokio & Axum Production Reliability Skill

- Forbid `.unwrap()` and `.expect()` in request handlers and MCP tool loops; propagate typed errors via `thiserror` implementing `axum::response::IntoResponse`.
- Use bounded `tokio::sync::mpsc::channel(capacity)` exclusively — never `unbounded_channel` — to enforce deterministic backpressure.
- Offload CPU-bound parsing, hashing, or synchronous I/O > 500µs onto `tokio::task::spawn_blocking` so worker reactor threads never stall.
- Audit every `tokio::select!` branch for cancellation safety; avoid partial multi-frame writes inside cancellable futures.
- Instrument async handlers with `#[tracing::instrument(skip_all, fields(req_id))]` without logging secret headers.

## Verification Check
```bash
cargo clippy --all-targets -- -D warnings && cargo test
```

Note sull'impostazione della community e recensioni sulla produzione (0)

Nessuna nota della comunità ancora. Condividi il tuo suggerimento per la configurazione della produzione di seguito.

Pubblica una nota di configurazione o un suggerimento per la verifica

Ispettore MCP Strumenti e schema risorse esposti

Identificatore strumento/risorsaParametri di inputComportamento di esecuzione
forbid_handler_unwrapsrc/**/*.rsEnforces typed thiserror/IntoResponse error propagation instead of unwrap()/expect().