What problem does it solve?
This skill helps developers understand and resolve Rust mutability and borrowing conflicts that lead to compile errors and runtime panics, reducing unsafe or ad-hoc fixes. It frames the core design question of why data must change and who is responsible for changing it, so you avoid introducing fragile interior mutability or incorrect synchronization.
Core Features & Use Cases
- Error-driven diagnosis: Maps common compiler errors like E0596, E0499, and E0502 to design questions and practical fixes.
- Pattern guidance: Recommends when to use exclusive mutable borrows, Cell, RefCell, Mutex, RwLock, or atomics based on copyability and thread context.
- Traceability: Provides trace-up and trace-down guidance to decide whether to restructure data, split domains, or apply concurrency primitives in async or multithreaded contexts.
- Use Case: Debug a borrow conflict in a shared data structure and choose between refactoring ownership, adding interior mutability, or introducing proper locking.
Quick Start
Use the m03-mutability skill to analyze a Rust borrow error and recommend whether to use an exclusive borrow, interior mutability, or a synchronization primitive based on thread context and type semantics.