Declarative .mdcQuy tắc Cursor/Claude/Windsurf & quy trình làm việc n8nKỹ năng đặc vụĐã kiểm tra rò rỉ bí mật
Rust Tokio + Axum Kỹ năng kỹ thuật hệ thống an toàn hủy bỏ
Kỹ năng khai báo CLAUDE.md và .mdc ngăn chặn .unwrap() gây hoảng loạn trong trình xử lý HTTP/MCP, bảo vệ tokio::select! an toàn hủy bỏ và giới hạn hàng đợi kênh.
Tệp quy tắc IDE & Tác nhân khai báo
---
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
```Ghi chú Thiết lập Cộng đồng & Đánh giá Sản xuất (0)
Chưa có ghi chú cộng đồng nào. Chia sẻ mẹo cấu hình sản xuất của bạn bên dưới.
Trình kiểm tra lược đồ tài nguyên và công cụ MCP
| Mã định danh công cụ/tài nguyên | Thông số đầu vào | Hành vi thực thi |
|---|---|---|
| forbid_handler_unwrap | src/**/*.rs | Enforces typed thiserror/IntoResponse error propagation instead of unwrap()/expect(). |