SuperAPI AI Directory

cc-rust-dev

Coding & development

View repository

Updated 10-15 21:11

About this skill

CC Rust Dev

Use this skill when editing or reviewing Rust code, focusing on idiomatic Rust, module splitting, error handling (thiserror/anyhow), Tokio async pitfalls, Axum routing organization, and testing.

Do not use for:

  • Formal review or fix/debug workflows
  • Operations risk assessment
  • General change boundaries unrelated to Rust
  • wasm / CLI / embedded scenarios (this skill focuses on backend Web)

Core rules

  • Split modules by responsibility into .rs files, do not pile into lib.rs;pub(crate) takes precedence over pub。
  • Errors: libraries use thiserror, applications use anyhow, unified across boundaries AppError + IntoResponse。
  • Production code prohibits .unwrap() / .expect() / panic!(); configure clippy deny.
  • Async: blocking calls must tokio::task::spawn_blocking; across .await locks use tokio::sync::Mutex。
  • tokio::select! branches must be cancel-safe; when unsure, save state to select! externally.
  • Default edition = "2024", TLS choose rustls; business code in principle prohibits unsafe。

Expand as needed

  • Style:references/style.md
  • Error handling:references/errors.md
  • Async and Axum:references/async.md
  • Testing:references/testing.md
  • Project structure:references/project-shape.md