Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
actionbook avatar

M01 Ownership

  • 1.5k installs
  • 1.3k repo stars
  • Updated May 24, 2026
  • actionbook/rust-skills

m01-ownership is an agent skill for Rust ownership, borrow, and lifetime errors with design-first questioning.

About

The m01-ownership skill addresses Rust ownership, borrow, and lifetime issues including errors E0382 E0597 E0506 E0507 E0515 E0716 E0106 with design-first questioning instead of reflexive clones. Core question asks who should own data and for how long considering shared versus exclusive, short-lived versus long-lived, and transformed versus read-only roles. Error tables map each compiler error to design questions like who should own versus extend lifetime. Thinking prompts distinguish entity value object and temporary data roles and intentional versus accidental ownership. Trace up escalates repeated E0382 to m02-resource Arc Rc and E0597 to m09-domain scope boundaries. Use for ownership, borrow, lifetime, move, and clone decisions in Rust.

  • Core question: who owns data and for how long?
  • Error map: E0382 E0597 E0506 E0507 E0515 E0716 E0106.
  • Design-first: ask who should own before cloning.
  • Entity vs Value Object vs temporary data roles.
  • Trace up to m02-resource m03-mutability m09-domain.

M01 Ownership by the numbers

  • 1,456 all-time installs (skills.sh)
  • +52 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #325 of 4,386 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

m01-ownership capabilities & compatibility

Capabilities
error to design questioning · ownership role analysis · sibling skill trace routing · escalation after repeated failures
Use cases
code review
From the docs

What m01-ownership says it does

Who should own this data, and for how long?
SKILL.md
E0382 | "Clone it" | Who should own this data?
SKILL.md
npx skills add https://github.com/actionbook/rust-skills --skill m01-ownership

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.5k
repo stars1.3k
Security audit3 / 3 scanners passed
Last updatedMay 24, 2026
Repositoryactionbook/rust-skills

How do I fix E0382 or E0597 ownership errors without blindly cloning everything?

Resolve Rust ownership, borrow, and lifetime errors E0382 E0597 with design-first questioning.

Who is it for?

Rust developers hitting move, borrow, and lifetime compiler errors.

Skip if: Skip for smart pointer selection covered by m02-resource or trait generics in m04-zero-cost.

When should I use this skill?

User hits ownership borrow lifetime errors E0382 E0597 move clone value moved.

What you get

An ownership design answer matching data role, scope, and borrow structure not just compiler silence.

  • Ownership comparison tables
  • Move-semantics code snippets

Files

SKILL.mdMarkdownGitHub ↗

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

ErrorDon't Just SayAsk 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:

1. What is this data's domain role?

  • Entity (unique identity) → owned
  • Value Object (interchangeable) → clone/copy OK
  • Temporary (computation result) → maybe restructure

2. Is the ownership design intentional?

  • By design → work within constraints
  • Accidental → consider redesign

3. Fix symptom or redesign?

  • If Strike 3 (3rd attempt) → escalate to Layer 2

---

Trace Up ↑

When errors persist, trace to design layer:

E0382 (moved value)
    ↑ Ask: What design choice led to this ownership pattern?
    ↑ Check: m09-domain (is this Entity or Value Object?)
    ↑ Check: domain-* (what constraints apply?)
Persistent ErrorTrace ToQuestion
E0382 repeatedm02-resourceShould use Arc/Rc for sharing?
E0597 repeatedm09-domainIs scope boundary at right place?
E0506/E0507m03-mutabilityShould use interior mutability?

---

Trace Down ↓

From design decisions to implementation:

"Data needs to be shared immutably"
    ↓ Use: Arc<T> (multi-thread) or Rc<T> (single-thread)

"Data needs exclusive ownership"
    ↓ Use: move semantics, take ownership

"Data is read-only view"
    ↓ Use: &T (immutable borrow)

---

Quick Reference

PatternOwnershipCostUse When
MoveTransferZeroCaller doesn't need data
&TBorrowZeroRead-only access
&mut TExclusive borrowZeroNeed to modify
clone()DuplicateAlloc + copyActually need a copy
Rc<T>Shared (single)Ref countSingle-thread sharing
Arc<T>Shared (multi)Atomic ref countMulti-thread sharing
Cow<T>Clone-on-writeAlloc if mutatedMight modify

Error Code Reference

ErrorCauseQuick Fix
E0382Value movedClone, reference, or redesign ownership
E0597Reference outlives ownerExtend owner scope or restructure
E0506Assign while borrowedEnd borrow before mutation
E0507Move out of borrowedClone or use reference
E0515Return local referenceReturn owned value
E0716Temporary droppedBind to variable
E0106Missing lifetimeAdd 'a annotation

---

Anti-Patterns

Anti-PatternWhy BadBetter
.clone() everywhereHides design issuesDesign ownership properly
Fight borrow checkerIncreases complexityWork with the compiler
'static for everythingRestricts flexibilityUse appropriate lifetimes
Leak with Box::leakMemory leakProper lifetime design

---

Related Skills

WhenSee
Need smart pointersm02-resource
Need interior mutabilitym03-mutability
Data is domain entitym09-domain
Learning ownership conceptsm14-mental-model

Related skills

Forks & variants (1)

M01 Ownership has 1 known copy in the catalog totaling 822 installs. They canonicalize to this original listing.

How it compares

Pick m01-ownership before m02-resource when the blocker is basic move/borrow rules rather than choosing between Box, Rc, or Arc.

FAQ

Should I just clone on E0382?

Ask who should own the data first — clone only when Value Object semantics justify it.

When escalate beyond fixes?

On third failed attempt trace up to m02-resource for Arc/Rc or m09-domain for scope redesign.

Is m01-ownership safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.