
M01 Ownership
This triggers automatically on Rust ownership errors like E0382 or E0597 and pushes you to ask design questions before reaching for clone(). Instead of just fixing the compiler error, it maps each error code to a fundamental question: who should own this data, is the scope boundary right, should mutation happen elsewhere. The trace up/trace down framework is smart, connecting ownership issues to domain modeling (m09) or resource patterns (m02) when quick fixes fail three times. Best part is the error-to-design-question table that reframes "borrowed value does not live long enough" as "is the scope boundary correct?" It won't teach you ownership from scratch, but it will stop you from cargo cult cloning everything.
- skills.sh installs
- 3.6K
- GitHub stars
- 1.6K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add actionbook/rust-skills --skill m01-ownership --agent claude-codeInstalls into .claude/skills of the current project.
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
Sponsors
Details
- Repository
- github.com/actionbook/rust-skills
- Category
- Rust
- First seen
- May 16, 2026
More from actionbook/rust-skills
All 38- M04 Zero Cost3.6K
- M05 Type Driven3.6K
- M02 Resource3.6K
- M03 Mutability3.6K
- Rust Refactor Helper3.6K
- M12 Lifecycle3.5K
- M09 Domain3.5K
- M14 Mental Model3.5K
- M11 Ecosystem3.5K
- M13 Domain Error3.5K
- Unsafe Checker3.5K
- Rust Code Navigator3.4K
- Rust Trait Explorer3.4K
- Rust Call Graph3.4K
- Rust Symbol Analyzer3.4K
- Domain Web3.4K
- Domain Cli3.4K
- Rust Learner3.3K
- Rust Skill Creator3.3K
- Rust Deps Visualizer3.2K
- Meta Cognition Parallel3.2K
- Rust Daily3.2K
- Domain Embedded3.1K
- Domain Cloud Native3K