Skip to main content
skill CX Codex

m02-resource — Claude Code skill: what it does, how to install

Guides AI agents in choosing the right Rust smart pointers and ownership models. Useful when designing data structures or preventing memory leaks.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add actionbook/rust-skills --skill m02-resource -a claude-code
Open on GitHub

What m02-resource does

This skill guides coding assistants through Rust resource management. Instead of blindly wrapping types in heap allocations, it forces the agent to inspect the ownership model. The agent checks whether data has a single owner or shared access, runs on one thread or multiple threads, and contains reference cycles.

The skill includes decision flows for mapping errors to design fixes. It directs single-owner heap data to Box, single-threaded shared data to Rc, and cross-thread sharing to Arc. Placing Arc everywhere adds unneeded atomic overhead on hot paths. For interior mutability, it contrasts Cell for copyable types against RefCell and synchronization primitives, while pushing Weak to break reference cycles.

What it helps with

  • select between Rc and Arc based on thread requirements
  • resolve reference cycles using Weak pointers
  • eliminate unnecessary Box heap allocations for small types
  • configure interior mutability without runtime borrow panics

Example prompts for the agent

  • Should I use Rc or Arc for this single-threaded tree structure?
  • I have a runtime panic with RefCell borrow, how should I restructure this?
  • Can this recursive enum fit on the stack or does it need Box?

How to install m02-resource

1Skills CLI (Vercel)

npx skills add actionbook/rust-skills --skill m02-resource -a claude-code

2Manually: put the files in place

~/.claude/skills/m02-resource/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/m02-resource/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about m02-resource

How to install m02-resource in Claude Code?

Run npx skills add actionbook/rust-skills --skill m02-resource -a claude-code in your terminal. You can also place the configuration file directly at ~/.claude/skills/m02-resource/SKILL.md.

What does m02-resource do?

It establishes decision rules for Rust memory management. The agent evaluates thread contexts, ownership boundaries, and cycle risks before proposing smart pointers.

How does the skill prevent memory leaks in reference counting?

It identifies mutual strong references in Rc or Arc structures. To break the cycle, it directs the agent to replace one direction with a Weak reference.

Similar skills

All skills for Programming languages →

From the same set33

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor