rust-idioms

📁 pproenca/dot-skills 📅 Jan 22, 2026
43
总安装量
43
周安装量
#4855
全站排名
安装命令
npx skills add https://github.com/pproenca/dot-skills --skill rust-idioms

Agent 安装分布

claude-code 38
codex 35
gemini-cli 35
opencode 34
github-copilot 29
antigravity 27

Skill 文档

Rust Community Rust Refactoring Best Practices

Comprehensive refactoring and idiomatic patterns guide for Rust applications, maintained by the Rust Community. Contains 44 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new Rust code with strong type guarantees
  • Refactoring ownership and borrowing patterns
  • Designing error handling strategies
  • Creating public APIs with traits and generics
  • Organizing modules and controlling visibility

Rule Categories by Priority

Priority Category Impact Prefix
1 Type Safety & Newtype Patterns CRITICAL type-
2 Ownership & Borrowing CRITICAL own-
3 Error Handling Patterns HIGH err-
4 API Design & Traits HIGH api-
5 Module & Visibility MEDIUM-HIGH mod-
6 Conversion Traits MEDIUM conv-
7 Idiomatic Patterns MEDIUM idiom-
8 Iterator & Collections LOW-MEDIUM iter-

Quick Reference

1. Type Safety & Newtype Patterns (CRITICAL)

2. Ownership & Borrowing (CRITICAL)

3. Error Handling Patterns (HIGH)

4. API Design & Traits (HIGH)

5. Module & Visibility (MEDIUM-HIGH)

6. Conversion Traits (MEDIUM)

7. Idiomatic Patterns (MEDIUM)

8. Iterator & Collections (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

For a single-file comprehensive guide, see AGENTS.md.