Declarative .mdcPravidla Cursor/Claude/Windsurf a pracovní postupy n8nAgent SkillZero-Secret Leak Audited
Rust Tokio + Axum Systémové inženýrské dovednosti bezpečného zrušení
Deklarativní dovednosti CLAUDE.md a .mdc zabraňující panice .unwrap() v ovladačích HTTP/MCP, hlídání tokio::select! bezpečnost zrušení a fronty ohraničujících kanálů.
Deklarativní agent a soubory pravidel 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
```Poznámky k nastavení komunity a recenze produkce (0)
Zatím žádné poznámky komunity. Podělte se o svůj tip na konfiguraci výroby níže.
Exponovaný nástroj MCP Tools & Resource Schema Inspector
| Identifikátor nástroje / zdroje | Vstupní parametry | Chování při provádění |
|---|---|---|
| forbid_handler_unwrap | src/**/*.rs | Enforces typed thiserror/IntoResponse error propagation instead of unwrap()/expect(). |