m06-error-handling — Claude Code skill: what it does, how to install
Guides the AI agent through Rust error handling patterns. Useful when deciding between Result, Option, panic!, thiserror, and anyhow.
npx skills add actionbook/rust-skills --skill m06-error-handling -a claude-codeWhat m06-error-handling does
This skill enforces structured error design in Rust projects. Instead of slapping .unwrap() or burying failures under generic types, the agent evaluates whether a failure is expected or an invariant bug. It directs library crates toward typed errors with thiserror and application code toward anyhow.
The instruction set includes explicit decision paths and anti-pattern warnings. It prompts the model to attach call context via .context() when using the ? operator. It flags silent error swallowing and unnecessary panics in production logic.
The skill is configured with user-invocable: false. The model triggers it automatically upon encountering Rust error types or propagation logic.
What it helps with
- decide between
Result,Option, andpanic! - split error strategies between library crates (
thiserror) and application code (anyhow) - replace unsafe
.unwrap()calls with error propagation using? - attach contextual messages to error propagation chains
Example prompts for the agent
- Refactor this parser function to return a proper Result instead of panicking with unwrap.
- Should I use thiserror or anyhow for this database module?
- Help me propagate this IO error with descriptive context.
How to install m06-error-handling
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m06-error-handling -a claude-code2Manually: put the files in place
~/.claude/skills/m06-error-handling/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/m06-error-handling/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m06-error-handling -a codex2Manually: put the files in place
.agents/skills/m06-error-handling/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m06-error-handling -a cursor2Manually: put the files in place
.cursor/skills/m06-error-handling/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install actionbook/rust-skills m06-error-handling2Manually: put the files in place
.github/skills/m06-error-handling/SKILL.md1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m06-error-handling -a gemini-cli2Platform CLI
gemini skills install https://github.com/actionbook/rust-skills --path skills/m06-error-handlingManually: put the files in place
.devin/skills/m06-error-handling/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m06-error-handling -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about m06-error-handling
How to install m06-error-handling in Claude Code?
Run npx skills add actionbook/rust-skills --skill m06-error-handling -a claude-code. The skill file will be placed at ~/.claude/skills/m06-error-handling/SKILL.md.
What does m06-error-handling do?
It guides AI coding agents to make principled decisions about Rust errors, separating expected failures, missing values, and unrecoverable bugs.
When does the skill choose thiserror over anyhow?
It recommends thiserror for library boundaries where callers need typed error variants. It selects anyhow for applications where easy propagation and call-chain context take priority.