# M02 resource

> M02 resource is an open-source agent skill for developer tools. Guides an agent in choosing Rust smart pointers like Box, Rc, Arc, Weak and RefCell. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/k1-c/linear-tui/tree/main/.claude/skills/m02-resource
- **Repository:** https://github.com/k1-c/linear-tui
- **GitHub stars:** 21
- **License:** MIT
- **Skill name:** m02-resource
- **Collection:** https://github.com/k1-c/linear-tui
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

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, 智能指针, 引用计数, 堆分配

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/k1-c/linear-tui/tree/HEAD/.claude/skills/m02-resource)
- [License: MIT](https://github.com/k1-c/linear-tui/tree/HEAD/.claude/skills/m02-resource)

## Features

- **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

## Install

### Claude Code

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

```sh
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.

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [M01 ownership](https://ai-powered.com/skills/m01-ownership): M01 ownership is an open-source agent skill for developer tools.
- [M03 mutability](https://ai-powered.com/skills/m03-mutability): M03 mutability is an open-source agent skill for developer tools.
- [M14 mental model](https://ai-powered.com/skills/m14-mental-model): M14 mental model is an open-source agent skill for knowledge and memory.
- [M12 lifecycle](https://ai-powered.com/skills/m12-lifecycle): M12 lifecycle is an open-source agent skill for developer tools.
- [M06 error handling](https://ai-powered.com/skills/m06-error-handling): M06 error handling is an open-source agent skill for developer tools.
- [M11 ecosystem](https://ai-powered.com/skills/m11-ecosystem): M11 ecosystem is an open-source agent skill for developer tools.
- [M15 anti pattern](https://ai-powered.com/skills/m15-anti-pattern): M15 anti pattern is an open-source agent skill for developer tools.
- [M04 zero cost](https://ai-powered.com/skills/m04-zero-cost): M04 zero cost is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/m02-resource
