Skip to main content
skill CX Codex

m01-ownership — Claude Code skill: what it does, how to install

Guides AI agents through Rust ownership and lifetime errors without spraying .clone() calls across the codebase.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add actionbook/rust-skills --skill m01-ownership -a claude-code
Open on GitHub

What m01-ownership does

The skill instructs coding agents on handling Rust borrow checker failures such as E0382, E0597, or E0506. Rather than slapping .clone() on every moved variable or pinning 'static everywhere, the agent investigates who should hold the data. It analyzes scope boundaries and reference lifetimes first.

Its internal prompt framework maps compiler diagnostic codes directly to architectural questions. It distinguishes between data entities with dedicated identities, interchangeable value objects, and temporary values. If three consecutive fixes fail, the skill directs the agent to rethink data ownership instead of repeating compiler workarounds.

Scattering .clone() across functions masks architectural flaws and adds heap allocations. This skill forces the assistant to respect Rust borrow semantics before touching memory buffers.

What it helps with

  • resolve E0382 moved value errors without wasteful heap cloning
  • fix lifetime scope mismatches like E0597 and E0515
  • determine when to switch from references to Arc or Rc
  • redesign structs and function signatures instead of fighting the borrow checker

Example prompts for the agent

  • I got error E0382 on this line, help me fix ownership without cloning
  • Why does this reference fail with E0597 here?
  • Review this function signature to resolve borrowed value does not live long enough

How to install m01-ownership

1Skills CLI (Vercel)

npx skills add actionbook/rust-skills --skill m01-ownership -a claude-code

2Manually: put the files in place

~/.claude/skills/m01-ownership/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/m01-ownership/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about m01-ownership

How to install m01-ownership in Claude Code?

Run npx skills add actionbook/rust-skills --skill m01-ownership -a claude-code. The rule file will be placed in ~/.claude/skills/m01-ownership/SKILL.md.

What does m01-ownership do?

It guides AI assistants in diagnosing Rust ownership, borrow checker, and lifetime errors systematically. The assistant focuses on data responsibilities rather than inserting temporary hacks.

Can m01-ownership be invoked manually?

The skill marks user-invocable: false, meaning it activates automatically whenever error codes like E0382 or lifetime terms appear in the conversation.

Similar skills

All skills for Programming languages →

From the same set33

m07-concurrency Guides Rust concurrency and async decisions, from Send/Sync errors to locks and channels. Use it when spawned tasks, shared state, or deadlocks need design review. CX Codex +1 3,500installs m02-resource Guides AI agents in choosing the right Rust smart pointers and ownership models. Useful when designing data structures or preventing memory leaks. CX Codex +1 3,400installs m05-type-driven This skill helps shape Rust types so invalid states can be rejected by the compiler. Use it for newtypes, type-state APIs, and checked builders. CX Codex +1 3,400installs m04-zero-cost Walks through E0277, E0308 and E0599 and helps you pick between generics and dyn Trait. Useful when Rust trait bounds stop cooperating. CX Codex +1 3,400installs m11-ecosystem Guides the AI through Rust crate selection, Cargo.toml configuration, and FFI bindings. Helps resolve compiler dependency errors. CX Codex +1 3,300installs m13-domain-error This skill helps design domain error types, recovery rules, and debugging context. Use it when Rust code needs retry, fallback, or clear error boundaries. CX Codex +1 3,300installs m14-mental-model A skill that explains ownership, borrowing and lifetimes in Rust through analogies and compiler error breakdowns. Useful when the borrow checker blocks your build. CX Codex +1 3,300installs m09-domain Domain-driven design guide for structuring Rust code. Helps your coding agent organize entities, aggregates, and value objects under Rust ownership. CX Codex +1 3,300installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor