m03-mutability

m03-mutability is a skill for Claude Code, Codex from moeru-ai/auv. It costs 74 tokens per session (1,060 once invoked), scanned A, original, Apache-2.0.

A Rust coding guide for handling data that must change while respecting Rust’s borrowing rules. It covers mutable references, shared references, and single- or multi-threaded mutation tools.

In plain words
What is it for?
Use it when Rust reports errors such as E0596, E0499, or E0502, or when working with mut, &mut, Cell, RefCell, Mutex, or RwLock.
Why use it?
It helps diagnose borrow-checker errors instead of fixing them with changes that may hide a design problem. It also helps decide whether mutation is needed at all.

Skill for Claude CodeCodex

Written for Claude Code: user-invocable in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when Rust reports errors such as E0596, E0499, or E0502, or when working with mut, &mut, Cell, RefCell, Mutex, or RwLock.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/moeru-ai/auv/m03-mutability
View source ↗ moeru-ai/auv
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add moeru-ai/auv --skill m03-mutability
Clone the repo
git clone --depth 1 https://github.com/moeru-ai/auv

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for m03-mutability

README.md
[![agentmods](https://agentmods.dev/badge/skills/moeru-ai/auv/m03-mutability.svg)](https://agentmods.dev/skills/moeru-ai/auv/m03-mutability)
Your own site
<a href="https://agentmods.dev/skills/moeru-ai/auv/m03-mutability"><img src="https://agentmods.dev/badge/skills/moeru-ai/auv/m03-mutability.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,060 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.01060
Opus 5 $0.00037 $0.00530
Sonnet 5 $0.00015 $0.00212
Haiku 4.5 $0.00007 $0.00106

Measured 8d ago against content hash 1e2d270dbfd2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

m03-mutability scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/m03-mutability/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mutability

Layer 1: Language Mechanics

Core Question

Why does this data need to change, and who can change it?

Before adding interior mutability, understand:

  • Is mutation essential or accidental complexity?
  • Who should control mutation?
  • Is the mutation pattern safe?

Error → Design Question

Error Don't Just Say Ask Instead
E0596 "Add mut" Should this really be mutable?
E0499 "Split borrows" Is the data structure right?
E0502 "Separate scopes" Why do we need both borrows?
RefCell panic "Use try_borrow" Is runtime check appropriate?

Thinking Prompt

Before adding mutability:

  1. Is mutation necessary?

    • Maybe transform → return new value
    • Maybe builder → construct immutably
  2. Who controls mutation?

    • External caller → &mut T
    • Internal logic → interior mutability
    • Concurrent access → synchronized mutability
  3. What's the thread context?

    • Single-thread → Cell/RefCell
    • Multi-thread → Mutex/RwLock/Atomic

Trace Up ↑

When mutability conflicts persist:

E0499/E0502 (borrow conflicts)
    ↑ Ask: Is the data structure designed correctly?
    ↑ Check: m09-domain (should data be split?)
    ↑ Check: m07-concurrency (is async involved?)
Persistent Error Trace To Question
Repeated borrow conflicts m09-domain Should data be restructured?
RefCell in async m07-concurrency Is Send/Sync needed?
Mutex deadlocks m07-concurrency Is the lock design right?

Trace Down ↓

From design to implementation:

"Need mutable access from &self"
    ↓ T: Copy → Cell<T>
    ↓ T: !Copy → RefCell<T>

"Need thread-safe mutation"
    ↓ Simple counters → AtomicXxx
    ↓ Complex data → Mutex<T> or RwLock<T>

"Need shared mutable state"
    ↓ Single-thread: Rc<RefCell<T>>
    ↓ Multi-thread: Arc<Mutex<T>>

Borrow Rules

At any time, you can have EITHER:
├─ Multiple &T (immutable borrows)
└─ OR one &mut T (mutable borrow)

Never both simultaneously.

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 154 lines · 74 tokens per session scan A 1e2d270dbfd2

Subscribe to this mod's changes

m03-mutability is a skill published in the GitHub repository moeru-ai/auv (27 stars, last pushed today), licensed Apache-2.0. It adds 74 tokens to every session and 1,060 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.