m03-mutability — Claude Code skill: fixing Rust mutability errors
A Rust skill for mutability trouble: it walks from borrow-checker errors to a decision about the data, not just another mut.
npx skills add actionbook/rust-skills --skill m03-mutability -a claude-codeWhat m03-mutability does
The skill fires on E0596, E0499, E0502, on “cannot borrow as mutable” messages and on RefCell panics. Its first move is a question: does this value need to change at all, and who gets to change it? Sometimes the answer is a new value instead of a mutation.
Choosing interior mutability comes down to two facts in the reference tables: is the type Copy, and does the code cross threads. Cell<T> covers Copy types on one thread; RefCell<T> handles the rest without threads; Mutex<T> and RwLock<T> take the multithreaded cases. An anti-pattern table names the usual mistakes, including a lock taken inside a hot loop and RefCell sprinkled everywhere.
When borrow conflicts keep returning, the skill points to neighbouring topics on data structure design and concurrency, because a repeated E0499 often means the struct itself is wrong. It is not a slash command — the description triggers it automatically, so the SKILL.md file has to sit in your platform's skills directory.
What it helps with
- work out an E0596 without blindly adding
mut - pick between
Cell,RefCellandMutexfor a given field - track down the borrow that makes
RefCellpanic at runtime - untangle overlapping borrows in E0499 and E0502
- spot anti-patterns such as locking inside a hot loop
Example prompts for the agent
- I'm getting E0502, a
&mutwhile a&is alive. What should I restructure? - I need to mutate a non-
Copyfield through&self.RefCell, or something else? - My
RefCellpanics with already borrowed. How do I find the borrow that was never dropped?
How to install m03-mutability
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m03-mutability -a claude-code2Manually: put the files in place
~/.claude/skills/m03-mutability/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/m03-mutability/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m03-mutability -a codex2Manually: put the files in place
.agents/skills/m03-mutability/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m03-mutability -a cursor2Manually: put the files in place
.cursor/skills/m03-mutability/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install actionbook/rust-skills m03-mutability2Manually: put the files in place
.github/skills/m03-mutability/SKILL.md1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m03-mutability -a gemini-cli2Platform CLI
gemini skills install https://github.com/actionbook/rust-skills --path skills/m03-mutabilityManually: put the files in place
.devin/skills/m03-mutability/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m03-mutability -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 m03-mutability
How do I install m03-mutability in Claude Code?
Run npx skills add actionbook/rust-skills --skill m03-mutability -a claude-code. The skill file lands at ~/.claude/skills/m03-mutability/SKILL.md.
What does m03-mutability do?
It helps with Rust mutability and borrow errors. Each error code leads to a design question about the data rather than a quick annotation fix.
Does m03-mutability run as a command?
No. It has user-invocable: false and triggers from its description when errors like E0596 or RefCell come up.