zhanghandong avatar

M14 Mental Model

The m14-mental-model skill helps Rust learners build accurate conceptual frameworks for understanding ownership, borrowing, and other core Rust concepts by providing mental models, analogies, and diagrams that clarify how to think about language features. It targets developers transitioning from other languages (Java, Python, C++) who are confused about Rust's design choices and need to understand the "why" behind compiler errors. The skill directly addresses learning barriers by mapping misconceptions to correct mental models and showing how Rust's safety guarantees connect to language rules.

skills.sh installs
751
GitHub stars
1.3K
last updated
Jul 14, 2026

Install

$ npx -y skills add zhanghandong/rust-skills --skill m14-mental-model --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Sponsors

Details

Repository
github.com/zhanghandong/rust-skills
Category
Rust

More from zhanghandong/rust-skills

All 34

Recommended

More Rust
1zhanghandong avatarm09-domainzhanghandong/rust-skillsm09 domain750skills.sh installs
2zhanghandong avatarm11-ecosystemzhanghandong/rust-skillsm11 ecosystem747skills.sh installs
3zhanghandong avatarmeta-cognition-parallelzhanghandong/rust-skillsmeta cognition parallel635skills.sh installs
4zhanghandong avatardomain-embeddedzhanghandong/rust-skillsdomain embedded625skills.sh installs
5mohitmishra786 avatarrustc-basicsmohitmishra786/low-level-dev-skillsRust compiler skill for systems programming. Use when selecting RUSTFLAGS, configuring Cargo profiles, tuning release builds, reading assembly or MIR output, un567skills.sh installs
6secondsky avatarcloudflare-workers-multi-langsecondsky/claude-skillsMulti-language Workers development with Rust, Python, and WebAssembly. Use when building Workers in languages other than JavaScript/TypeScript, or when integrat310skills.sh installs