m01-ownership

Identify and resolve Rust borrowing, ownership and lifetime compilation errors.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/jmduea/emotiv-cortex-rs --skill m01-ownership-jmduea
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: m01-ownership
Source: https://github.com/jmduea/emotiv-cortex-rs/tree/main/.github/skills/m01-ownership
Command: npx skills add https://github.com/jmduea/emotiv-cortex-rs --skill m01-ownership-jmduea

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust developers frequently encounter cryptic ownership, borrowing, and lifetime errors that block compilation and impede productivity. This skill transforms those errors into clear design questions and concrete remediation steps, reducing friction during development.

Core Features & Use Cases

  • Error‑to‑Design Mapping: Turns compiler error codes (e.g., E0382, E0597) into strategic questions about data ownership and scope.
  • Pattern Tracing: Guides users up and down the design‑implementation hierarchy to select appropriate smart pointers, mutability models, or lifetime annotations.
  • Quick Reference Tables: Provides side‑by‑side comparisons of ownership patterns, costs, and suitable scenarios.
  • Anti‑Pattern Alerts: Highlights common misuse such as over‑cloning or blanket 'static lifetimes and suggests better alternatives.
  • Related Skills Navigation: Links to complementary resources for smart pointers, mutability, and domain modeling.

Quick Start

Ask the ownership skill to explain a Rust compile error about a moved value in your code.

Frequently Asked Questions about m01-ownership

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Rust ownership errors like value moved due to borrow checker rules?

To resolve Rust lifetime errors, trace borrowing patterns and apply appropriate lifetime annotations. This skill guides pattern tracing up and down the design hierarchy to select correct lifetime models for compilation errors like E0597.

What is the best way to resolve a borrowed value does not live long enough Rust error?

The best way to resolve a borrowed value lifetime error is to trace the data scope and apply correct lifetime annotations. The skill provides design-oriented guidance and side-by-side comparisons of ownership patterns to fix errors like E0597.

Why does Rust throw a cannot move out of borrowed content error and how do I fix it?

Rust throws this ownership error when moving data violates borrow checker rules. The skill translates these compiler diagnostics into strategic questions about data ownership and suggests appropriate smart pointers or mutability models.

How do I stop over-cloning values to satisfy the Rust borrow checker?

To stop over-cloning values, identify anti-patterns and select better ownership alternatives. The skill highlights common misuse like blanket cloning and provides design-oriented guidance to choose more efficient smart pointers.

Can I use this skill to fix Rust E0506 cannot assign to borrowed value errors?

Yes, you can fix E0506 errors by applying design-oriented guidance to adjust mutability models. The skill handles E0506 and related borrow-checker diagnostics by providing pattern tracing and concrete code fixes.