Skip to main content

rust-hardening

Stars14
Forks0
UpdatedJuly 19, 2026 at 00:20

Use whenever writing, reviewing, or generating Rust code โ€” hardening is the default for all Rust, not just production. Enforces a zero-warning / zero-clippy-finding build, bans panicking constructs (unwrap/expect/panic/indexing/slicing) in non-test code, forbids silently-overflowing arithmetic and lossy `as` casts, and requires runtime failures from arithmetic, indexing, conversion, and other fallible operations to propagate as Result unless local recovery completes the documented contract. Also bans erasing failures through underscore bindings, default substitution, Result-to-Option conversion, or ignored overflow flags, and requires rustfmt. Lint suppression is the rare, self-cleaning exception: `#[expect(reason=โ€ฆ)]` over `#[allow]`, at the narrowest scope, only from an explicit production allowlist โ€” while generated code and test code (#[cfg(test)], tests/, benches/, examples/) may relax freely.

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

File Explorer
2 files
SKILL.md
readonly