cc-rust-dev

Enforces Rust backend coding standards for Axum, Tokio, error handling, and testing.

1.0k|109|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/doccker/cc-use-exp --skill cc-rust-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cc-rust-dev
Source: https://github.com/doccker/cc-use-exp/tree/main/.codex/skills/cc-rust-dev
Command: npx skills add https://github.com/doccker/cc-use-exp --skill cc-rust-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Rust backend code often drifts into inconsistent module layouts, unsafe error handling with unwrap and panic, and subtle Tokio async bugs like blocking calls on the runtime or non-cancel-safe select branches. This Skill gives the AI a concrete, enforceable rule set so generated or edited Rust code follows idiomatic Axum + Tokio conventions from the start.

Core Features & Use Cases

  • Module and Project Structure Rules: Splits code by responsibility into .rs files, keeps main.rs as bootstrap only, prefers pub(crate) over pub, and bans meaningless module names like util or common.
  • Error Handling Discipline: Uses thiserror for libraries, anyhow for applications, a unified AppError with IntoResponse at HTTP boundaries, and clippy deny rules for unwrap, expect, and panic in production code.
  • Async and Axum Guidance: Covers spawn_blocking for blocking work, tokio::sync::Mutex across awaits, cancel-safe select!, graceful shutdown, tower-http middleware, and Router organization.
  • Testing Conventions: Defines #[tokio::test] usage, unit vs integration test placement, rstest table-driven tests, and Axum testing via oneshot or real ports.
  • Use Case: Ask the AI to add a new Axum endpoint with database access; it will structure the handler, route module, error type, and async DB calls according to these rules instead of producing ad-hoc code.

Quick Start

Ask the AI to write or refactor a Rust Axum handler, error type, or async service following the cc-rust-dev conventions.

Frequently Asked Questions about cc-rust-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Axum handlers in Rust?

Use tower::ServiceExt::oneshot to send requests directly against the Router, or bind a TcpListener on port 0 and test over a real connection with reqwest. Async tests use #[tokio::test], and table-driven cases can use the rstest crate.