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

M14 Mental Model

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

m14-mental-model is an agent skill for explain rust ownership, borrow checker, and memory layout with mental models and analogies.

About

The m14-mental-model skill is designed for explain Rust ownership, borrow checker, and memory layout with mental models and analogies. Mental Models > Layer 2: Design Choices Core Question What's the right way to think about this Rust concept? When learning or explaining Rust: What's the correct mental model? Invoke when the user asks how to think about ownership, borrow checker, or Rust misconceptions.

  • What's the correct mental model?.
  • What misconceptions should be avoided?.
  • What analogies help understanding?.

M14 Mental Model by the numbers

  • 1,438 all-time installs (skills.sh)
  • +51 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #12 of 129 Rust 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

m14-mental-model capabilities & compatibility

Capabilities
what's the correct mental model? · what misconceptions should be avoided? · what analogies help understanding?
From the docs

What m14-mental-model says it does

Use when learning Rust concepts. Keywords: mental model, how to think about ownership, understanding borrow checker, visualizing memory layout, analogy, misconception, explaining o
SKILL.md
Use when learning Rust concepts. Keywords: mental model, how to think about ownership, understanding borrow checker, visualizing memory layout, analogy, misconc
SKILL.md
npx skills add https://github.com/actionbook/rust-skills --skill m14-mental-model

Add your badge

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

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

How do I explain rust ownership, borrow checker, and memory layout with mental models and analogies?

Explain Rust ownership, borrow checker, and memory layout with mental models and analogies.

Who is it for?

Learners building intuition for ownership, borrowing, and lifetimes in Rust.

Skip if: Skip for advanced unsafe FFI without conceptual teaching goals.

When should I use this skill?

User asks how to think about ownership, borrow checker, or Rust misconceptions.

What you get

Completed m14-mental-model workflow with documented commands, files, and expected deliverables.

  • Ownership and borrowing mental model
  • Scope-drop code examples
  • Borrow-checker error prevention patterns

Files

SKILL.mdMarkdownGitHub ↗

Mental Models

Layer 2: Design Choices

Core Question

What's the right way to think about this Rust concept?

When learning or explaining Rust:

  • What's the correct mental model?
  • What misconceptions should be avoided?
  • What analogies help understanding?

---

Key Mental Models

ConceptMental ModelAnalogy
OwnershipUnique keyOnly one person has the house key
MoveKey handoverGiving away your key
&TLending for readingLending a book
&mut TExclusive editingOnly you can edit the doc
Lifetime 'aValid scope"Ticket valid until..."
Box<T>Heap pointerRemote control to TV
Rc<T>Shared ownershipMultiple remotes, last turns off
Arc<T>Thread-safe RcRemotes from any room

---

Coming From Other Languages

FromKey Shift
Java/C#Values are owned, not references by default
C/C++Compiler enforces safety rules
Python/GoNo GC, deterministic destruction
FunctionalMutability is safe via ownership
JavaScriptNo null, use Option instead

---

Thinking Prompt

When confused about Rust:

1. What's the ownership model?

  • Who owns this data?
  • How long does it live?
  • Who can access it?

2. What guarantee is Rust providing?

  • No data races
  • No dangling pointers
  • No use-after-free

3. What's the compiler telling me?

  • Error = violation of safety rule
  • Solution = work with the rules

---

Trace Up ↑

To design understanding (Layer 2):

"Why can't I do X in Rust?"
    ↑ Ask: What safety guarantee would be violated?
    ↑ Check: m01-m07 for the rule being enforced
    ↑ Ask: What's the intended design pattern?

---

Trace Down ↓

To implementation (Layer 1):

"I understand the concept, now how do I implement?"
    ↓ m01-ownership: Ownership patterns
    ↓ m02-resource: Smart pointer choice
    ↓ m07-concurrency: Thread safety

---

Common Misconceptions

ErrorWrong ModelCorrect Model
E0382 use after moveGC cleans upOwnership = unique key transfer
E0502 borrow conflictMultiple writers OKOnly one writer at a time
E0499 multiple mut borrowsAliased mutationExclusive access for mutation
E0106 missing lifetimeIgnoring scopeReferences have validity scope
E0507 cannot move from &TImplicit cloneReferences don't own data

Deprecated Thinking

DeprecatedBetter
"Rust is like C++"Different ownership model
"Lifetimes are GC"Compile-time validity scope
"Clone solves everything"Restructure ownership
"Fight the borrow checker"Work with the compiler
"unsafe to avoid rules"Understand safe patterns first

---

Ownership Visualization

Stack                          Heap
+----------------+            +----------------+
| main()         |            |                |
|   s1 ─────────────────────> │ "hello"        |
|                |            |                |
| fn takes(s) {  |            |                |
|   s2 (moved) ─────────────> │ "hello"        |
| }              |            | (s1 invalid)   |
+----------------+            +----------------+

After move: s1 is no longer valid

Reference Visualization

+----------------+
| data: String   |────────────> "hello"
+----------------+
       ↑
       │ &data (immutable borrow)
       │
+------+------+
| reader1    reader2    (multiple OK)
+------+------+

+----------------+
| data: String   |────────────> "hello"
+----------------+
       ↑
       │ &mut data (mutable borrow)
       │
+------+
| writer (only one)
+------+

---

Learning Path

StageFocusSkills
BeginnerOwnership basicsm01-ownership, m14-mental-model
IntermediateSmart pointers, error handlingm02, m06
AdvancedConcurrency, unsafem07, unsafe-checker
ExpertDesign patternsm09-m15, domain-*

---

Related Skills

WhenSee
Ownership errorsm01-ownership
Smart pointersm02-resource
Concurrencym07-concurrency
Anti-patternsm15-anti-pattern

Related skills

Forks & variants (1)

M14 Mental Model has 1 known copy in the catalog totaling 764 installs. They canonicalize to this original listing.

How it compares

Pick m14-mental-model over m12-lifecycle when the blocker is understanding ownership and borrows, not designing connection pools or resource scopes.

FAQ

What does m14-mental-model do?

Explain Rust ownership, borrow checker, and memory layout with mental models and analogies.

When should I use m14-mental-model?

User asks how to think about ownership, borrow checker, or Rust misconceptions.

Is m14-mental-model safe to install?

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

Rustbackend

This week in AI coding

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

unsubscribe anytime.