# Rust Skills

193 Rust coding rules across 14 categories.

- Repository: https://github.com/vinhnx/VTCode (897 stars)
- Category: Design
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add vinhnx/VTCode --skill rust-skills -g -a claude-code -y`
Codex: `npx skills add vinhnx/VTCode --skill rust-skills -g -a codex -y`
Cursor: `npx skills add vinhnx/VTCode --skill rust-skills -g -a cursor -y`
Gemini CLI: `npx skills add vinhnx/VTCode --skill rust-skills -g -a gemini-cli -y`

## Description

193 Rust coding rules across 14 categories. Use when writing, reviewing, or refactoring Rust code. Covers ownership, errors, async, API design, memory, performance, testing, and anti-patterns.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Rust Best Practices

Comprehensive guide for writing high-quality, idiomatic, and highly optimized Rust code. Contains 193 rules across 14 categories, prioritized by impact to guide LLMs in code generation and refactoring. Quick reference below; the reasoning behind each rule family lives in the per-source digests under [`references/`](references/) (adapted from [BeautifulRust](https://github.com/morganlinton/BeautifulRust), MIT).

## When to Apply

Reference these guidelines when:
- Writing new Rust functions, structs, or modules
- Implementing error handling or async code
- Designing public APIs for libraries
- Reviewing code for ownership/borrowing issues
- Optimizing memory usage or reducing allocations
- Tuning performance for hot paths
- Refactoring existing Rust code

## Rule Categories by Priority

| Priority | Category | Impact | Prefix | Rules |
|----------|----------|--------|--------|-------|
| 1 | Ownership & Borrowing | CRITICAL | `own-` | 14 |
| 2 | Error Handling | CRITICAL | `err-` | 14 |
| 3 | Memory Optimization | CRITICAL | `mem-` | 15 |
| 4 | API Design | HIGH | `api-` | 17 |
| 5 | Async/Await | HIGH | `async-` | 16 |
| 6 | Compiler Optimization | HIGH | `opt-` | 12 |
| 7 | Naming Conventions | MEDIUM | `name-` | 17 |
| 8 | Type Safety | MEDIUM | `type-` | 11 |
| 9 | Testing | MEDIUM | `test-` | 15 |
| 10 | Documentation | MEDIUM | `doc-` | 11 |
| 11 | Performance Patterns | MEDIUM | `perf-` | 11 |
| 12 | Project Structure | LOW | `proj-` | 12 |
| 13 | Clippy & Linting | LOW | `lint-` | 12 |
| 14 | Anti-patterns | REFERENCE | `anti-` | 16 |

---

## Quick Reference

### 1. Ownership & Borrowing (CRITICAL)

The rest: https://github.com/vinhnx/VTCode/blob/HEAD/.agents/skills/rust-skills/SKILL.md
