
Coding Guidelines
The coding-guidelines skill provides developers with Rust-specific code style standards and best practices, covering naming conventions, data types, error handling, memory management, concurrency, and async patterns. It serves Rust programmers who need guidance on naming conventions, code formatting, and adherence to Rust idioms during code review and development. The skill solves the problem of inconsistent code style and suboptimal practices by offering a centralized reference to the 50 core rules from the official Rust Coding Guidelines.
- skills.sh installs
- 1.2K
- GitHub stars
- 1.3K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add zhanghandong/rust-skills --skill coding-guidelines --agent claude-codeInstalls into .claude/skills of the current project.
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 |
Sponsors
Promote your product hereReach 125k+ visitors monthlyPromote your product hereReach 125k+ visitors monthly
Agent CaffeineSponsoredClose your lid, come back to finished work
SnugSponsoredThe clipboard manager for the AI eraPromote your product hereReach 125k+ visitors monthly
WaxSponsoredBlock anything with supervision, without erasing your iPhonePromote your product hereReach 125k+ visitors monthly
knobsSponsoredSee your site on any phone, any day, in any language
Details
- Repository
- github.com/zhanghandong/rust-skills
- Category
- Rust
More from zhanghandong/rust-skills
All 34- M10 Performance895
- M07 Concurrency844
- M06 Error Handling827
- Rust Refactor Helper821
- M01 Ownership809
- M04 Zero Cost789
- M05 Type Driven786
- M02 Resource783
- M03 Mutability773
- M12 Lifecycle764
- M14 Mental Model751
- M09 Domain750
- M11 Ecosystem747
- M13 Domain Error738
- Rust Trait Explorer731
- Rust Code Navigator728
- Unsafe Checker726
- Domain Cli709
- Rust Symbol Analyzer702
- Rust Call Graph699
- Rust Router698
- Rust Learner688
- Rust Deps Visualizer684
- Rust Skill Creator670