
Coding Guidelines
Rust style and best-practice rules covering naming, data types, strings, errors, memory, concurrency, and async.
- skills.sh installs
- 4.3K
- GitHub stars
- 1.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers naming conventions, newtypes, string handling, error propagation, memory and lifetimes, concurrency, async, and macros
- Includes a table of deprecated crates and std items with their replacements, such as
lazy_static!tostd::sync::OnceLock - Enforces rules like no
get_prefix,as_/to_/into_conversion naming, and?instead oftry!() - Designed for Claude to consult on Rust naming, formatting, and code review questions beyond common conventions
Install
$ npx -y skills add actionbook/rust-skills --skill coding-guidelines -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Rust Coding Guidelines (50 Core Rules)
Naming (Rust-Specific)
| Rule | Guideline |
|---|---|
No get_ prefix | fn name() not fn get_name() |
| Iterator convention | iter() / iter_mut() / into_iter() |
| Conversion naming | as_ (cheap &), to_ (expensive), into_ (ownership) |
| Static var prefix | G_CONFIG for static, no prefix for const |
Data Types
| Rule | Guideline |
|---|---|
| Use newtypes | struct Email(String) for domain semantics |
| Prefer slice patterns | if let [first, .., last] = slice |
| Pre-allocate | Vec::with_capacity(), String::with_capacity() |
| Avoid Vec abuse | Use arrays for fixed sizes |
Strings
| Rule | Guideline |
|---|---|
| Prefer bytes | s.bytes() over s.chars() when ASCII |
Use Cow<str> | When might modify borrowed data |
Use format! | Over string concatenation with + |
| Avoid nested iteration | contains() on string is O(n*m) |
Error Handling
| Rule | Guideline |
|---|---|
Use ? propagation | Not try!() macro |
expect() over unwrap() | When value guaranteed |
| Assertions for invariants | assert! at function entry |
Details
- Repository
- github.com/actionbook/rust-skills
- Category
- Rust
- First seen
- May 16, 2026
More from actionbook/rust-skills
All 38- M10 Performance4K
- M07 Concurrency3.8K
- M06 Error Handling3.8K
- M01 Ownership3.7K
- M05 Type Driven3.7K
- M04 Zero Cost3.7K
- M02 Resource3.7K
- Rust Refactor Helper3.7K
- M03 Mutability3.7K
- M12 Lifecycle3.6K
- M09 Domain3.6K
- M14 Mental Model3.6K
- M13 Domain Error3.6K
- M11 Ecosystem3.6K
- Unsafe Checker3.6K
- Rust Code Navigator3.6K
- Rust Trait Explorer3.5K
- Rust Call Graph3.5K
- Rust Symbol Analyzer3.5K
- Domain Web3.5K
- Domain Cli3.5K
- Rust Learner3.4K
- Rust Skill Creator3.4K
- Rust Deps Visualizer3.3K
Similar to Coding Guidelines
More Rust
m15-anti-patternactionbook/rust-skills9.4K installsRust code review checklist that flags anti-patterns and points to idiomatic replacements with tracing to design causes.
rust-skillsleonardomso/rust-skills7.2K installsComprehensive Rust coding guidelines with 265 rules across 26 categories for writing and reviewing code.
rust-best-practicesapollographql/skills23.4K installsIdiomatic Rust guidance covering ownership, error handling, performance, linting, testing, and documentation, drawn from Apollo's handbook.
unsafe-checkeractionbook/rust-skills3.6K installsReview unsafe Rust code and FFI boundaries for soundness, SAFETY documentation, and safer alternatives.
rustpproenca/dot-skills124 installsRust performance guidelines for writing, reviewing, and refactoring code toward optimal patterns.