
M01 Ownership
Rust ownership and lifetime error guide that maps compiler codes to design questions before quick fixes.
- skills.sh installs
- 3.7K
- GitHub stars
- 1.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers ownership, borrowing, and lifetime errors E0382, E0597, E0506, E0507, E0515, E0716, and E0106
- Includes an error-to-design-question table, a thinking prompt, and a quick-reference of move, borrow, clone, Rc, Arc, and Cow patterns
- Guides escalation to smart pointers, interior mutability, or domain modeling when the same error persists after repeated fixes
- Designed for Rust developers who hit borrow checker errors and want to fix the underlying design rather than just clone
Install
$ npx -y skills add actionbook/rust-skills --skill m01-ownership -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Ownership & Lifetimes
Layer 1: Language Mechanics
Core Question
Who should own this data, and for how long?
Before fixing ownership errors, understand the data's role:
- Is it shared or exclusive?
- Is it short-lived or long-lived?
- Is it transformed or just read?
Error → Design Question
| Error | Don't Just Say | Ask Instead |
|---|---|---|
| E0382 | "Clone it" | Who should own this data? |
| E0597 | "Extend lifetime" | Is the scope boundary correct? |
| E0506 | "End borrow first" | Should mutation happen elsewhere? |
| E0507 | "Clone before move" | Why are we moving from a reference? |
| E0515 | "Return owned" | Should caller own the data? |
| E0716 | "Bind to variable" | Why is this temporary? |
| E0106 | "Add 'a" | What is the actual lifetime relationship? |
Thinking Prompt
Before fixing an ownership error, ask:
- What is this data's domain role?
- Entity (unique identity) → owned
- Value Object (interchangeable) → clone/copy OK
- Temporary (computation result) → maybe restructure
Details
- Repository
- github.com/actionbook/rust-skills
- Categories
- Rust, Learning & Teaching
- First seen
- May 16, 2026
More from actionbook/rust-skills
All 38- M05 Type Driven3.7K
- M04 Zero Cost3.7K
- M02 Resource3.7K
- Rust Refactor Helper3.7K
- M03 Mutability3.7K
- M12 Lifecycle3.6K
- M09 Domain3.6K
- M14 Mental Model3.6K
- M13 Domain Error3.6K
- M11 Ecosystem3.6K
- Unsafe Checker3.6K
- Rust Code Navigator3.6K
- Rust Trait Explorer3.5K
- Rust Call Graph3.5K
- Rust Symbol Analyzer3.5K
- Domain Web3.5K
- Domain Cli3.5K
- Rust Learner3.4K
- Rust Skill Creator3.4K
- Rust Deps Visualizer3.3K
- Meta Cognition Parallel3.3K
- Rust Daily3.3K
- Domain Embedded3.2K
- Domain Cloud Native3.2K
Similar to M01 Ownership
More Rust
m14-mental-modelactionbook/rust-skills3.6K installsA learning guide that maps core Rust concepts to mental models, analogies, and common compiler-error misconceptions.
m03-mutabilityactionbook/rust-skills3.7K installsRust mutability guide mapping E0596, E0499, and E0502 errors to Cell, RefCell, Mutex, and RwLock choices.
rust-patternsaffaan-m/ecc6.7K installsIdiomatic Rust patterns for ownership, error handling, enums, traits, iterators, and concurrency in production code.
rust-best-practicesapollographql/skills23.4K installsIdiomatic Rust guidance covering ownership, error handling, performance, linting, testing, and documentation, drawn from Apollo's handbook.
memory-safety-patternswshobson/agents12.3K installsCross-language memory-safety patterns covering RAII, ownership, smart pointers, and resource management for Rust, C++, and C.