actionbook avatar

Coding Guidelines

This gives Claude 50 core Rust conventions that go beyond what it already knows from training. It's meant for the non-obvious stuff: no get_ prefix on getters, when to use as_ versus to_ versus into_, why G_CONFIG for statics but no prefix for consts, and which crates have been deprecated by newer stdlib features (like OnceLock replacing lazy_static in 1.70). The tables are dense reference material, not tutorial content. Invoke this when you're doing code review, arguing about naming conventions, or wondering if there's a more idiomatic way to do something. It won't teach you Rust, but it will save you from bikeshedding and outdated patterns.

skills.sh installs
4.2K
GitHub stars
1.6K
last updated
Aug 21, 2026

Install

$ npx -y skills add actionbook/rust-skills --skill coding-guidelines --agent claude-code

Installs into .claude/skills of the current project.

Files

Rust Coding Guidelines (50 Core Rules)

Naming (Rust-Specific)

RuleGuideline
No get_ prefixfn name() not fn get_name()
Iterator conventioniter() / iter_mut() / into_iter()
Conversion namingas_ (cheap &), to_ (expensive), into_ (ownership)
Static var prefixG_CONFIG for static, no prefix for const

Data Types

RuleGuideline
Use newtypesstruct Email(String) for domain semantics
Prefer slice patternsif let [first, .., last] = slice
Pre-allocateVec::with_capacity(), String::with_capacity()
Avoid Vec abuseUse arrays for fixed sizes

Strings

RuleGuideline
Prefer bytess.bytes() over s.chars() when ASCII
Use Cow<str>When might modify borrowed data
Use format!Over string concatenation with +
Avoid nested iterationcontains() on string is O(n*m)

Error Handling

RuleGuideline
Use ? propagationNot try!() macro
expect() over unwrap()When value guaranteed
Assertions for invariantsassert! at function entry

Sponsors

Details

Repository
github.com/actionbook/rust-skills
Categories
Git & Pull Requests, Code Review & Quality, Rust
First seen
May 16, 2026

More from actionbook/rust-skills

All 38
1forcedotcom avatargenerating-apexforcedotcom/sf-skillsPrimary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refac4.2Kskills.sh installs
2agricidaniel avatarads-budgetagricidaniel/claude-adsPlan and review paid-media budgets, bidding, pacing, marginal return, forecasts, CPA, ROAS, MER, LTV:CAC, constraints, and allocation across supported platforms4.2Kskills.sh installs
3dpearson2699 avatarstorekitdpearson2699/swift-ios-skillsImplement, review, or improve in-app purchases and subscriptions using StoreKit 2. Use when building paywalls with SubscriptionStoreView or ProductView, process4.2Kskills.sh installs
4dpearson2699 avatarwidgetkitdpearson2699/swift-ios-skillsImplement, review, or improve WidgetKit widgets and controls. Use when building Home Screen, Lock Screen, StandBy, or CarPlay widgets with timeline providers; c4.2Kskills.sh installs
5dpearson2699 avatarswiftui-gesturesdpearson2699/swift-ios-skillsImplement, review, or improve SwiftUI gesture handling. Use when adding tap, long press, drag, magnify, or rotate gestures, composing gestures with simultaneous4.2Kskills.sh installs
6dotnet avatareval-performancedotnet/skillsGuide for diagnosing and improving MSBuild project evaluation performance. USE FOR: builds slow before any compilation starts, high evaluation time in binlog an4.2Kskills.sh installs