m01-ownership

Installation
Summary

Rust ownership and lifetime error diagnosis through design-first questioning.

  • Covers seven critical error codes (E0382, E0597, E0506, E0507, E0515, E0716, E0106) with root-cause questions rather than quick fixes
  • Guides developers to ask "who should own this data?" before applying syntax solutions, distinguishing between symptom fixes and design restructuring
  • Provides decision trees for choosing between move semantics, borrowing, cloning, and smart pointers (Arc, Rc, Cow) based on data role and sharing requirements
  • Includes escalation paths to related skills (resource management, mutability, domain modeling) when errors persist beyond a third attempt
SKILL.md

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
Related skills

More from zhanghandong/rust-skills

Installs
717
GitHub Stars
1.1K
First Seen
Jan 20, 2026