# coding-guidelines

A skill with 50 Rust coding rules: naming, strings, errors, memory, async. Useful during review or when the agent writes a new module.

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

## What it does

The skill answers questions about Rust style and nudges the agent toward idiomatic code. Inside are rule tables for naming, data types, strings, error handling, memory, concurrency, async and macros. A separate table maps deprecated items to replacements: `lazy_static!` to `std::sync::OnceLock`, `once_cell::Lazy` to `std::sync::LazyLock`, `try!()` to the `?` operator.

The rules are the non-obvious, Rust-specific ones. No `get_` prefix on function names. Cheap borrows get `as_`, expensive ones `to_`, ownership transfer `into_`. Statics take a prefix like `G_CONFIG`, consts take none. There is a short cheat sheet too: `snake_case` for functions and variables, `CamelCase` for types, `SCREAMING_CASE` for constants, `rustfmt` for formatting, `#![warn(clippy::all)]` for lints.

You do not invoke it by hand — it loads as knowledge and fires when you ask about Rust style or review. Installing it into a project in another language makes little sense, since the rules are tied to Rust and will not come up elsewhere.

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

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

### GitHub Copilot

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

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

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

## When to use it
- pick a name for a converter: `as_`, `to_` or `into_`
- swap `lazy_static!` and `once_cell` for std types
- decide when `expect()` beats `unwrap()`
- run a Rust review against a fixed rule list
- drop `Mutex` for primitives in favour of atomics

## Example prompts
- check this module against coding-guidelines and tell me what breaks Rust style
- what should I name a function that takes ownership of a string?
- replace the deprecated crates in this file with current std equivalents

## Similar
- [write-coding-standards-from-file](https://affpapa.org/en/nevibecode/skills/write-coding-standards-from-file.md) — skill · 9570 installs
- [cpp-coding-standards](https://affpapa.org/en/nevibecode/skills/cpp-coding-standards.md) — skill · 5100 installs
- [swift-api-design-guidelines](https://affpapa.org/en/nevibecode/skills/swift-api-design-guidelines.md) — skill · 2800 installs
- [swift-api-design-guidelines-skill](https://affpapa.org/en/nevibecode/skills/swift-api-design-guidelines-skill.md) — skill · 1200 installs
- [coding-agent](https://affpapa.org/en/nevibecode/skills/coding-agent.md) — skill · 6500 installs

## Other versions with the same name
- [coding-guidelines · tech-leads-club](https://affpapa.org/en/nevibecode/skills/ale-coding-guidelines.md) — 322 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
