m14-mental-model — Claude Code skill: Rust mental models
A skill that explains ownership, borrowing and lifetimes in Rust through analogies and compiler error breakdowns. Useful when the borrow checker blocks your build.
npx skills add actionbook/rust-skills --skill m14-mental-model -a claude-codeWhat m14-mental-model does
The skill lays out mental models for core Rust concepts. Ownership is a single house key, a move is handing that key over, &T is lending a book to read, &mut T is being the only one allowed to edit the document. Smart pointers get their own analogies: Box<T> as a remote control to the TV, Rc<T> as several remotes where the last one turns it off, Arc<T> as those remotes working from any room.
A second table covers switching languages. From Java and C# the shift is that values are owned rather than referenced by default. From Python and Go it is the absence of a garbage collector and deterministic destruction. From JavaScript, Option replaces null.
There is a misconception table keyed to compiler errors: E0382, E0502, E0499, E0106, E0507. Each row pairs the wrong model with the correct one. The skill is not user-invocable, so you just describe what confuses you and let the agent pick it up.
What it helps with
- understand why a variable stops working after a move
- tell
&Tand&mut Tapart by what access they grant - explain lifetimes to a teammate without dry theory
- switch to Rust from Java or Python without carrying old habits
- decode a borrow checker error and find the rule you broke
Example prompts for the agent
- Explain with analogies why Rust rejects two mutable borrows at once
- I'm coming from Python — what do I need to rethink about ownership?
- Why does the compiler throw E0382 and how should I rewrite this?
How to install m14-mental-model
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m14-mental-model -a claude-code2Manually: put the files in place
~/.claude/skills/m14-mental-model/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/m14-mental-model/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m14-mental-model -a codex2Manually: put the files in place
.agents/skills/m14-mental-model/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m14-mental-model -a cursor2Manually: put the files in place
.cursor/skills/m14-mental-model/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install actionbook/rust-skills m14-mental-model2Manually: put the files in place
.github/skills/m14-mental-model/SKILL.md1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m14-mental-model -a gemini-cli2Platform CLI
gemini skills install https://github.com/actionbook/rust-skills --path skills/m14-mental-modelManually: put the files in place
.devin/skills/m14-mental-model/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m14-mental-model -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about m14-mental-model
How do I install m14-mental-model in Claude?
Run npx skills add actionbook/rust-skills --skill m14-mental-model -a claude-code. The skill file lands at ~/.claude/skills/m14-mental-model/SKILL.md.
What does m14-mental-model do?
It collects mental models for Rust concepts: ownership, moves, borrowing, lifetimes and smart pointers, plus tables of misconceptions and language transitions.
Is the skill invoked manually?
No, it is marked user-invocable: false. It activates when a request is about learning Rust and understanding its concepts.