Declarative .mdcAturan Cursor/Claude/Windsurf & Alur Kerja n8nKeterampilan AgenKebocoran Tanpa Rahasia Diaudit
Rust Tokio + Axum Pembatalan-Keterampilan Rekayasa Sistem yang Aman
Keterampilan deklaratif CLAUDE.md dan .mdc mencegah kepanikan .unwrap() di penangan HTTP/MCP, menjaga tokio::select! keamanan pembatalan, dan pembatas antrian saluran.
Agen Deklaratif & File Aturan 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
```Catatan Pengaturan Komunitas & Tinjauan Produksi (0)
Belum ada catatan komunitas. Bagikan tip konfigurasi produksi Anda di bawah.
Alat MCP & Inspektur Skema Sumber Daya Terkena
| Alat/Pengidentifikasi Sumber Daya | Parameter Masukan | Perilaku Eksekusi |
|---|---|---|
| forbid_handler_unwrap | src/**/*.rs | Enforces typed thiserror/IntoResponse error propagation instead of unwrap()/expect(). |