Focus: High-performance systems programming, memory safety without garbage collection, concurrency.
Triggers: rust, cargo, borrow checker, lifetimes, ownership, zero-cost abstractions, tokio.
2. Core Principles
Ownership & Borrowing: The compiler enforces strict rules: one mutable reference OR multiple immutable references, never both. This eliminates Data Races at compile time.
Zero-Cost Abstractions: High-level constructs (like Iterators or Generics) compile down to the exact same machine code as hand-written low-level C.
Fearless Concurrency: The Send and Sync traits guarantee thread safety. If a type isn't thread-safe, it won't compile when passed across threads.
3. Anti-Patterns
Overusing .clone(): Beginners spam .clone() to satisfy the borrow checker. This causes hidden memory allocations. Use references (&) or Arc instead.
Ignoring Result: Using .unwrap() in production code will cause panics. Always pattern match with match or use the ? operator.
Self-Referential Structs: Rust hates structs that hold references to their own fields. Use Rc/RefCell or redesign the data structure.
4. References
references/rust-fundamentals.md — Ownership, Lifetimes, and Enums.
references/rust-advanced.md — Unsafe Rust, Macros, and Concurrency.
references/rust-testing.md — Unit testing and Mocking.
1---2name: rust3description: Rust Skill Architecture4---5# Rust Skill Architecture67## 1. Skill Context8**Focus**: High-performance systems programming, memory safety without garbage collection, concurrency.9**Triggers**: rust, cargo, borrow checker, lifetimes, ownership, zero-cost abstractions, tokio.1011## 2. Core Principles12- **Ownership & Borrowing**: The compiler enforces strict rules: one mutable reference OR multiple immutable references, never both. This eliminates Data Races at compile time.13- **Zero-Cost Abstractions**: High-level constructs (like Iterators or Generics) compile down to the exact same machine code as hand-written low-level C.14- **Fearless Concurrency**: The `Send` and `Sync` traits guarantee thread safety. If a type isn't thread-safe, it won't compile when passed across threads.1516## 3. Anti-Patterns17- **Overusing `.clone()`**: Beginners spam `.clone()` to satisfy the borrow checker. This causes hidden memory allocations. Use references (`&`) or `Arc` instead.18- **Ignoring `Result`**: Using `.unwrap()` in production code will cause panics. Always pattern match with `match` or use the `?` operator.19- **Self-Referential Structs**: Rust hates structs that hold references to their own fields. Use `Rc/RefCell` or redesign the data structure.2021## 4. References22- `references/rust-fundamentals.md` — Ownership, Lifetimes, and Enums.23- `references/rust-advanced.md` — Unsafe Rust, Macros, and Concurrency.24- `references/rust-testing.md` — Unit testing and Mocking.
Run npx skillmds@latest add j4flmao/rust in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Rust Skill Architecture It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
j4flmao (@j4flmao) published this skill. Their other Agent Skills are listed on their SkillMD profile.