# m13-domain-error

This skill helps design domain error types, recovery rules, and debugging context. Use it when Rust code needs retry, fallback, or clear error boundaries.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3300 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/m13-domain-error/SKILL.md
- Updated: 2026-08-23
- HTML: https://affpapa.org/en/nevibecode/skills/m13-domain-error

## What it does

The skill organizes domain errors by audience and recovery path: user-facing, internal, system, transient, and permanent. It guides decisions about friendly messages, developer diagnostics, operational alerts, retryable failures, and errors that should fail fast.

Its material includes patterns and examples for `thiserror`, `anyhow::Context`, `tracing`, `tokio-retry`, `backoff`, and `failsafe-rs`. It covers exponential backoff, fallback values, circuit breakers, timeouts, bulkheads, and a typed `AppError` hierarchy with an `is_retryable()` check.

The skill is marked `user-invocable: false`, so it is not meant to run as a separate slash command. For a Rust project, check that libraries used by the examples, such as `tokio-retry` or `failsafe-rs`, fit the codebase before applying them.

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install actionbook/rust-skills m13-domain-error
```

2. **Manually: put the files in place**
- File: `.github/skills/m13-domain-error/SKILL.md`

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m13-domain-error -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/m13-domain-error/SKILL.md

## When to use it
- separate user, developer, and ops errors
- choose retry or fallback for a failure
- model an error hierarchy with `thiserror`
- add call context with `anyhow::Context`
- cap retry attempts and backoff delays

## Example prompts
- Design domain error handling for this Rust module. Separate user-facing, internal, and transient failures.
- Review this code and decide where exponential-backoff retry fits, where fallback is safer, and where it should fail fast.
- Create an `AppError` type with `thiserror` and add `is_retryable()` for temporary service failures.

## Similar
- [iii-error-handling](https://affpapa.org/en/nevibecode/skills/iii-error-handling.md) — skill · 4100 installs
- [error-handling-patterns](https://affpapa.org/en/nevibecode/skills/error-handling-patterns.md) — skill · 22957 installs
- [error-handling](https://affpapa.org/en/nevibecode/skills/error-handling.md) — skill · 4800 installs
- [resilience](https://affpapa.org/en/nevibecode/skills/resilience.md) — skill · 2800 installs
- [go-error-handling](https://affpapa.org/en/nevibecode/skills/go-error-handling.md) — skill · 1300 installs
- [Error Handling taste](https://affpapa.org/en/nevibecode/prompts/error-handling-taste.md) — prompt · ★ 174597

From the same set: [actionbook/rust-skills](https://affpapa.org/en/nevibecode/by/actionbook/rust-skills.md) — 35 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
