Skill

rust-skills

Comprehensive Rust coding guidelines with 179 rules across 14 categories. Use when writing, reviewing, or refactoring Rust code. Covers ownership, error handling, async patterns, API design, memory optimization, performance, testing, and common anti-patterns. Invoke with /rust-skills.

From rust-skills
Install
1
Run in your terminal
$
npx claudepluginhub liby/vibe-coding-plugins --plugin rust-skills
Tool Access

This skill uses the workspace's default tool permissions.

Supporting Assets
View in Repository
AGENTS.md
CLAUDE.md
LICENSE
README.md
rules/anti-clone-excessive.md
rules/anti-collect-intermediate.md
rules/anti-empty-catch.md
rules/anti-expect-lazy.md
rules/anti-format-hot-path.md
rules/anti-index-over-iter.md
rules/anti-lock-across-await.md
rules/anti-over-abstraction.md
rules/anti-panic-expected.md
rules/anti-premature-optimize.md
rules/anti-string-for-str.md
rules/anti-stringly-typed.md
rules/anti-type-erasure.md
rules/anti-unwrap-abuse.md
rules/anti-vec-for-slice.md
rules/api-builder-must-use.md
Skill Content

Rust Best Practices

Comprehensive guide for writing high-quality, idiomatic, and highly optimized Rust code. Contains 179 rules across 14 categories, prioritized by impact to guide LLMs in code generation and refactoring.

When to Apply

Reference these guidelines when:

  • Writing new Rust functions, structs, or modules
  • Implementing error handling or async code
  • Designing public APIs for libraries
  • Reviewing code for ownership/borrowing issues
  • Optimizing memory usage or reducing allocations
  • Tuning performance for hot paths
  • Refactoring existing Rust code

Rule Categories by Priority

PriorityCategoryImpactPrefixRules
1Ownership & BorrowingCRITICALown-12
2Error HandlingCRITICALerr-12
3Memory OptimizationCRITICALmem-15
4API DesignHIGHapi-15
5Async/AwaitHIGHasync-15
6Compiler OptimizationHIGHopt-12
7Naming ConventionsMEDIUMname-16
8Type SafetyMEDIUMtype-10
9TestingMEDIUMtest-13
10DocumentationMEDIUMdoc-11
11Performance PatternsMEDIUMperf-11
12Project StructureLOWproj-11
13Clippy & LintingLOWlint-11
14Anti-patternsREFERENCEanti-15

Quick Reference

1. Ownership & Borrowing (CRITICAL)

2. Error Handling (CRITICAL)

3. Memory Optimization (CRITICAL)

4. API Design (HIGH)

5. Async/Await (HIGH)

6. Compiler Optimization (HIGH)

7. Naming Conventions (MEDIUM)

8. Type Safety (MEDIUM)

9. Testing (MEDIUM)

10. Documentation (MEDIUM)

11. Performance Patterns (MEDIUM)

12. Project Structure (LOW)

13. Clippy & Linting (LOW)

14. Anti-patterns (REFERENCE)


Recommended Cargo.toml Settings

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true

[profile.bench]
inherits = "release"
debug = true
strip = false

[profile.dev]
opt-level = 0
debug = true

[profile.dev.package."*"]
opt-level = 3  # Optimize dependencies in dev

How to Use

This skill provides rule identifiers for quick reference. When generating or reviewing Rust code:

  1. Check relevant category based on task type
  2. Apply rules with matching prefix
  3. Prioritize CRITICAL > HIGH > MEDIUM > LOW
  4. Read rule files in rules/ for detailed examples

Rule Application by Task

TaskPrimary Categories
New functionown-, err-, name-
New struct/APIapi-, type-, doc-
Async codeasync-, own-
Error handlingerr-, api-
Memory optimizationmem-, own-, perf-
Performance tuningopt-, mem-, perf-
Code reviewanti-, lint-

Sources

This skill synthesizes best practices from:

Stats
Parent Repo Stars1
Parent Repo Forks0
Last CommitMar 13, 2026