Skip to content
Skill

M02 resource

Guides an agent in choosing Rust smart pointers like Box, Rc, Arc, Weak and RefCell

M02 resource is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
21
Last commit
License
MIT
Listing updated

Similar skills

About M02 resource

This skill gives an agent a decision framework for Rust smart pointers and resource management. It starts from the ownership question: whether a resource has a single or shared owner, whether access crosses threads, and whether reference cycles are possible. From those answers it steers toward Box, Rc, Arc, Weak, Cell, RefCell or Mutex/RwLock.

The skill is organized as a reference rather than a script. It includes a decision flowchart, a quick reference table of pointer types, a list of common errors such as Rc cycle leaks and RefCell borrow panics, and anti-patterns like reaching for Arc everywhere. It also points the agent to related skills for ownership, mutability, concurrency and lifecycle questions.

It expects a Rust codebase and questions about memory and sharing. It does not run any scripts or require external tools.

When your agent uses it

CRITICAL: Use for smart pointers and resource management. Triggers: Box, Rc, Arc, Weak, RefCell, Cell, smart pointer, heap allocation, reference counting, RAII, Drop, should I use Box or Rc, when to use Arc vs Rc, 智能指针, 引用计数, 堆分配

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (4 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/m02-resource to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/m02-resource &&
cp -R "$tmp/.claude/skills/m02-resource" ~/.claude/skills/m02-resource &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/m02-resource inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/m02-resource to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/m02-resource &&
cp -R "$tmp/.claude/skills/m02-resource" ~/.agents/skills/m02-resource &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/m02-resource inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/m02-resource to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/m02-resource &&
cp -R "$tmp/.claude/skills/m02-resource" ~/.cursor/skills/m02-resource &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/m02-resource inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/k1-c/linear-tui.git --path .claude/skills/m02-resource

Or copy the folder to ~/.gemini/skills/m02-resource yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/m02-resource:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/m02-resource &&
cp -R "$tmp/.claude/skills/m02-resource" ~/.copilot/skills/m02-resource &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/m02-resource inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/k1-c/linear-tui.git

Then copy linear-tui/.claude/skills/m02-resource into your agent's skills folder as m02-resource. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Pointer selection flowchart
A decision tree that maps heap allocation, sharing and thread context to a suitable pointer type.
Pointer reference table
A quick summary of Box, Rc, Arc, Weak, Cell and RefCell with ownership, thread safety and typical use.
Reference cycle guidance
Advice on breaking cycles by using Weak for one direction of a relationship.
Common error diagnosis
Explains typical causes and fixes for Rc cycle leaks, RefCell panics and Arc overhead.
Anti-pattern warnings
Lists habits such as overusing Arc or RefCell and suggests cleaner ownership designs.
Related skill routing
Points to companion skills for ownership, mutability, concurrency and resource lifecycle.

Good for

  • Decide whether a recursive type should use Box or stay on the stack
  • Choose between Rc and Arc for data shared across threads
  • Fix a memory leak caused by a reference cycle between Rc values
  • Resolve a RefCell runtime borrow panic
  • Pick the right interior mutability type for a struct field

M02 resource FAQ

When does M02 resource trigger?

It is meant to load when a task involves Box, Rc, Arc, Weak, RefCell, Cell, smart pointers, heap allocation, reference counting, RAII, Drop or similar questions about choosing between them.

Does M02 resource run any scripts or need extra tools?

No scripts are included. The skill is a single SKILL.md file with reference material and does not set allowed tools.

How do I install M02 resource in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/m02-resource to use it in all your projects, or to .claude/skills/m02-resource in one project.

Does M02 resource run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use M02 resource?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to M02 resource?

The closest alternatives to M02 resource are M01 ownership, M03 mutability, M14 mental model, M12 lifecycle and M06 error handling.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from k1-c/linear-tui

  1. Gives the agent a quick reference of Rust-specific naming, error handling and async rules

    • Open source
    • 21 GitHub stars
    • Developer tools
  2. Guides the agent to write Conventional Commits, splitting mixed changes into several

    • Open source
    • 21 GitHub stars
    • Developer tools
  3. Guides an agent through building Rust command-line tools with clap, config layers

    • Open source
    • 21 GitHub stars
    • Developer tools
  4. Guides the agent through Rust ownership, borrow and lifetime compiler errors

    • Open source
    • 21 GitHub stars
    • Developer tools
  5. Guides a Rust agent through E0596/E0499/E0502 borrow errors and interior mutability

    • Open source
    • 21 GitHub stars
    • Developer tools
  6. Guides Claude through generics, traits, static vs dynamic dispatch and related Rust

    • Open source
    • 21 GitHub stars
    • Developer tools