# domain-web

A Rust web-service skill covering async handlers, shared state, errors, extractors, and middleware. Use it when a project contains Cargo.toml.

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

## What it does

domain-web gives an agent design rules for Rust web services. It covers HTTP, REST APIs, GraphQL, WebSocket, routers, handlers, extractors, authentication, JWT, sessions, CORS, and rate limiting. The skill targets projects matched by `**/Cargo.toml`.

Its guidance covers async execution, shared application state, and request lifetimes. It recommends `Arc<T>` or `Arc<RwLock<T>>`, type-driven input validation, `IntoResponse` for errors, and Tower layers for middleware. The material compares `axum`, `actix-web`, `warp`, and `rocket`, and names crates such as `reqwest`, `serde_json`, `jsonwebtoken`, `sqlx`, and `diesel`.

A blocking handler conflicts with the skill’s async rule, so CPU-heavy work belongs in `spawn_blocking`. Check that boundary before extending the route layer.

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

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

### GitHub Copilot

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

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

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

## When to use it
- design a Rust HTTP service
- choose a pattern for shared application state
- inspect handlers and request extractors
- return a consistent error response
- build middleware with Tower layers

## Example prompts
- Design a Rust REST API for this project with `Cargo.toml`; choose a suitable framework and lay out the routes.
- Review these web handlers for blocking work, missing `Send + Sync`, and unsafe shared-state patterns.
- Add request validation and a shared `IntoResponse` error type while keeping the handlers async.

## Similar
- [rust-pro](https://affpapa.org/en/nevibecode/agents/rust-pro.md) — subagent · 1148 installs
- [rust-project](https://affpapa.org/en/nevibecode/commands/rust-project.md) — command · ★ 41729
- [web-development](https://affpapa.org/en/nevibecode/skills/mindrally-web-development.md) — skill · 815 installs
- [httpx](https://affpapa.org/en/nevibecode/rules/httpx.md) — rule · ★ 3579
- [rust-engineer](https://affpapa.org/en/nevibecode/skills/rust-engineer.md) — skill · 6300 installs
- [web-pentest](https://affpapa.org/en/nevibecode/skills/web-pentest.md) — skill · 545 installs

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
