# rust-router

A skill that stops the agent from answering Rust questions off the cuff and walks it through layers instead: language mechanics, design choices, domain constraints.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2700 installs · ★ 1545
- Author: actionbook
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/actionbook/rust-skills/tree/HEAD/skills/rust-router/SKILL.md
- Updated: 2026-08-23
- HTML: https://affpapa.org/en/nevibecode/skills/rust-router

## What it does

It acts as a router. The agent reads your Rust question, picks the layer, and loads the matching skill: `m01-ownership` for ownership and borrow errors, `m03-mutability` for mutable borrow conflicts, `m04-zero-cost` for generics and traits, `m06-error-handling` for `Result` and `?`. Compiler codes map to skills in a table — E0382 and E0597 go to `m01-ownership`, E0499 and E0502 to `m03-mutability`, E0277 to `m04` or `m07-concurrency`.

The skill triggers on `**/Cargo.toml` and `**/*.rs`. When domain words show up, it insists on loading two skills at once: `axum` and HTTP pull in `m07-concurrency` plus `domain-web`, payments pull in `m01-ownership` plus `domain-fintech`. Comparisons and best-practice questions switch on a negotiation protocol, so the answer arrives with a confidence level and a list of gaps.

There is a firm default too: for new projects the skill prescribes edition 2024, `rust-version` 1.85, `unsafe_code = "warn"`, and clippy with `all` and `pedantic`. If your team pins a different edition or keeps pedantic lints off, that is worth checking before you let the skill touch your `Cargo.toml`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-router -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/rust-router/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/rust-router/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-router -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/rust-router/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-router -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/rust-router/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install actionbook/rust-skills rust-router
```

2. **Manually: put the files in place**
- File: `.github/skills/rust-router/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-router -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/actionbook/rust-skills --path skills/rust-router
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/rust-router/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-router -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/actionbook/rust-skills/tree/HEAD/skills/rust-router/SKILL.md

## When to use it
- work through an E0382 and find where the value got moved
- pick between tokio and async-std for a specific job
- design error handling with `thiserror` and `anyhow`
- connect a compile error back to domain requirements
- find a pattern for shared state in async code

## Example prompts
- Explain the E0597 in this file and show how to fix the lifetime
- Compare tokio and async-std for an axum HTTP server, include the gaps
- Help me design error handling for a new crate

## Similar
- [rust-engineer](https://affpapa.org/en/nevibecode/skills/rust-engineer.md) — skill · 6300 installs
- [rust](https://affpapa.org/en/nevibecode/skills/rust.md) — skill · 922 installs
- [rust-async-patterns](https://affpapa.org/en/nevibecode/skills/rust-async-patterns.md) — skill · 20625 installs
- [rust-project](https://affpapa.org/en/nevibecode/commands/rust-project.md) — command · ★ 41729
- [rust-systems-programming](https://affpapa.org/en/nevibecode/skills/rust-systems-programming.md) — skill · 485 installs
- [rust-async-internals](https://affpapa.org/en/nevibecode/skills/rust-async-internals.md) — skill · 467 installs

From the same set: [actionbook/rust-skills](https://affpapa.org/en/nevibecode/by/actionbook/rust-skills.md) — 33 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
