BeClaude

rust-skills

730Community RegistryDevelopmentby ZhangHanDong

38 skills covering ownership, concurrency, error handling, unsafe code, LSP code intelligence, and domain-specific patterns for Rust development

First seen 4/17/2026

Summary

This skill enhances Claude Code with a meta-cognition framework for Rust development, guiding AI to reason through domain, design, and mechanics layers instead of giving surface-level fixes.

  • It covers ownership, concurrency, error handling, unsafe code, LSP code intelligence, and domain-specific patterns, enabling accurate architectural solutions for complex Rust projects.

Overview

AI-powered Rust development assistant with meta-cognition framework

![Version](https://github.com/actionbook/rust-skills/releases) ![License: MIT](https://opensource.org/licenses/MIT) ![Claude Code](https://github.com/anthropics/claude-code)

What is Rust Skills?

Rust Skills is a Claude Code plugin that transforms how AI assists with Rust development. Instead of giving surface-level answers, it traces through cognitive layers to provide domain-correct architectural solutions.

The Problem

Traditional AI assistance for Rust:

code
User: "My trading system reports E0382"
AI: "Use .clone()"  ← Surface fix, ignores domain constraints

The Solution

Rust Skills with meta-cognition:

code
User: "My trading system reports E0382"

AI (with Rust Skills):
├── Layer 1: E0382 = ownership error → Why is this data needed?
│       ↑
├── Layer 3: Trade records are immutable audit data → Should share, not copy
│       ↓
├── Layer 2: Use Arc<TradeRecord> as shared immutable value
│       ↓
└── Recommendation: Redesign as Arc<T>, not clone()

Features

  • Meta-Cognition Framework: Three-layer cognitive model (Domain → Design → Mechanics)
  • Real-time Information: Fetch latest Rust versions and crate info via background agents
  • Dynamic Skills: Auto-generate skills from your Cargo.toml dependencies
  • Domain Extensions: FinTech, ML, Cloud-Native, IoT, Embedded, Web, CLI support
  • Coding Guidelines: Complete Rust coding conventions and best practices

Installation

Rust Skills supports two installation modes:

  • Plugin Mode (Claude Code): Full features including hooks, agents, and auto meta-cognition
  • Skills-only Mode: Works with any coding agent that supports skills (Claude Code, Vercel AI, etc.)

Skills-only Install (Recommended)

The simplest way to get started. Works with any coding agent that supports skills, including Claude Code, Vercel's `add-skills`, and others.

Skills now include inline fallback logic — when agent files are not available, skills execute directly using built-in tools (actionbook, agent-browser, WebFetch).

bash
npx skills add actionbook/rust-skills

Install via CoWork, a Rust-based skills management tool:

bash
# Install CoWork
cargo install cowork

# Method 1: Direct install
cowork install actionbook/rust-skills

# Method 2: Config-based install (recommended for teams)
cowork config init                    # Create .cowork/Skills.toml
# Edit Skills.toml to add rust-skills (see below)
cowork config install                 # Install all configured skills

Skills.toml configuration:

toml
[project]
name = "my-rust-project"

[skills.install]
rust-skills = "actionbook/rust-skills"

[security]
trusted_authors = ["ZhangHanDong"]

CoWork (co for short) provides version management, dependency resolution, lock files, and security auditing. See CoWork documentation for more details.

bash
git clone https://github.com/actionbook/rust-skills.git
cp -r rust-skills/skills/* ~/.claude/skills/

Note: Skills-only mode does not include hooks, so meta-cognition won't trigger automatically. You can manually call /rust-router or specific skills. Background agents fall back to inline execution automatically.


Claude Code Plugin Install (Full Features)

For Claude Code users who want the complete experience with hooks, background agents, and auto meta-cognition triggering.

bash
# Step 1: Add the marketplace
/plugin marketplace add actionbook/rust-skills

# Step 2: Install the plugin
/plugin install rust-skills@rust-skills

Note: Step 1 only adds the marketplace (plugin source). Step 2 actually installs the rust-skills plugin with all features enabled.

bash
# Clone the repository
git clone https://github.com/actionbook/rust-skills.git

# Launch with plugin directory
claude --plugin-dir /path/to/rust-skills

Feature Comparison

FeaturePlugin (Marketplace)Plugin (Local)Skills-only (NPX/CoWork/Manual)
All 31 Skills
Auto meta-cognition trigger❌ (manual invoke)
Hook-based routing
Background agents✅ (inline fallback)
Easy updates✅ (NPX/CoWork)
Works with other agents

Permission Configuration

Background agents require permission to run agent-browser. Configure in your project:

bash
# Copy example config
cp /path/to/rust-skills/.claude/settings.example.json .claude/settings.local.json

Or create manually:

bash
mkdir -p .claude
cat > .claude/settings.local.json << 'EOF'
{
  "permissions": {
    "allow": [
      "Bash(agent-browser *)"
    ]
  }
}
EOF

See .claude/settings.example.json for reference.

Other Platforms

Dependent Skills

Rust Skills relies on these external tools for full functionality:

ToolDescriptionGitHub
actionbookMCP server for website action manuals. Used by agents to fetch structured web content (Rust releases, crate info, documentation).actionbook/actionbook
agent-browserBrowser automation tool for fetching real-time web data. Fallback when actionbook is unavailable.vercel-labs/agent-browser

Meta-Cognition Framework

Core Concept

Don't answer directly. Trace through cognitive layers first.

code
Layer 3: Domain Constraints (WHY)
├── Domain rules determine design choices
└── Example: Financial systems require immutable, auditable data

Layer 2: Design Choices (WHAT)
├── Design patterns and architectural decisions
└── Example: Use Arc<T> for shared immutable data

Layer 1: Language Mechanics (HOW)
├── Rust language features and compiler rules
└── Example: E0382 is a symptom of ownership design issues

Routing Rules

User SignalEntry LayerTrace DirectionPrimary Skill
E0xxx errorsLayer 1Trace UP ↑m01-m07
"How to design..."Layer 2Bidirectionalm09-m15
"[Domain] app development"Layer 3Trace DOWN ↓domain-*
Performance issuesLayer 1→2Up then Downm10-performance

Skills Overview

Core Skills

  • rust-router - Master router for all Rust questions (invoked first)
  • rust-learner - Fetch latest Rust/crate version info
  • coding-guidelines - Coding conventions lookup

Layer 1: Language Mechanics (m01-m07)

SkillCore QuestionTriggers
m01-ownershipWho should own this data?E0382, E0597, move, borrow
m02-resourceWhat ownership pattern fits?Box, Rc, Arc, RefCell
m03-mutabilityWhy does this data need to change?mut, Cell, E0596, E0499
m04-zero-costCompile-time or runtime polymorphism?generic, trait, E0277
m05-type-drivenHow can types prevent invalid states?newtype, PhantomData
m06-error-handlingExpected failure or bug?Result, Error, panic, ?
m07-concurrencyCPU-bound or I/O-bound?async, Send, Sync, thread

Layer 2: Design Choices (m09-m15)

SkillCore QuestionTriggers
m09-domainWhat role does this concept play?DDD, entity, value object
m10-performanceWhere's the bottleneck?benchmark, profiling
m11-ecosystemWhich crate fits this task?crate selection, dependencies
m12-lifecycleWhen to create, use, cleanup?RAII, Drop, lazy init
m13-domain-errorWho handles this error?retry, circuit breaker
m14-mental-modelHow to think about this correctly?learning Rust, why
m15-anti-patternDoes this pattern hide design issues?code smell, common mistakes

Layer 3: Domain Constraints (domain-*)

SkillDomainCore Constraints
domain-fintechFinTechAudit trail, precision, consistency
domain-mlMachine LearningMemory efficiency, GPU acceleration
domain-cloud-nativeCloud Native12-Factor, observability, graceful shutdown
domain-iotIoTOffline-first, power management, security
domain-webWeb ServicesStateless, latency SLA, concurrency
domain-cliCLIUX, config precedence, exit codes
domain-embeddedEmbeddedNo heap, no_std, real-time

Commands

CommandDescription
/rust-features [version]Get Rust version features
/crate-info <crate>Get crate information
/docs <crate> [item]Get API documentation
/sync-crate-skillsSync skills from Cargo.toml dependencies
/update-crate-skill <crate>Update specific crate skill
/clean-crate-skillsClean local crate skills

Dynamic Skills

Generate skills on-demand from your project dependencies:

bash
# Enter your Rust project
cd my-rust-project

# Sync all dependencies
/sync-crate-skills

# Skills are created at ~/.claude/skills/{crate}/

Features

  • On-demand generation: Created from Cargo.toml dependencies
  • Local storage: ~/.claude/skills/
  • Version tracking: Each skill records crate version
  • Workspace support: Parses all workspace members

How It Works

code
User Question
     │
     ▼
┌─────────────────────────────────────────┐
│           Hook Layer                     │
│  400+ keywords trigger meta-cognition    │
└─────────────────────────────────────────┘
     │
     ▼
┌─────────────────────────────────────────┐
│           rust-router                    │
│  Identify entry layer + domain           │
│  Decision: dual-skill loading            │
└─────────────────────────────────────────┘
     │
     ├──────────────┬──────────────┐
     ▼              ▼              ▼
┌──────────┐  ┌──────────┐  ┌──────────┐
│ Layer 1  │  │ Layer 2  │  │ Layer 3  │
│ m01-m07  │  │ m09-m15  │  │ domain-* │
└──────────┘  └──────────┘  └──────────┘
     │
     ▼
Domain-correct architectural solution

Documentation

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

Acknowledgments

License

MIT License - see LICENSE for details.

Links

  • GitHub: https://github.com/actionbook/rust-skills
  • Issues: https://github.com/actionbook/rust-skills/issues

Install & Usage

1
Create the skills directory
mkdir -p .claude/skills
2
Download the skill file
mkdir -p .claude/skills && curl -o .claude/skills/rust-skills.md https://raw.githubusercontent.com/actionbook/rust-skills/main/SKILL.md
3
Invoke in Claude Code
/rust-skills

Use Cases

Debug ownership errors like E0382 by analyzing why data is needed and suggesting shared immutable patterns with Arc.
Design safe concurrent systems by leveraging Rust's ownership model and choosing appropriate synchronization primitives.
Handle errors idiomatically using Result, Option, and custom error types with proper propagation.
Write and audit unsafe code blocks with clear safety invariants and minimal unsafe surface area.
Fetch latest Rust version or crate information in real-time during development.
Apply domain-specific patterns for systems like trading platforms, embedded devices, or web servers.

Usage Examples

1

/rust-skills My trading system reports E0382 when processing trade records

2

/rust-skills Design a concurrent cache with Arc and RwLock for high-read, low-write workloads

3

/rust-skills Fetch the latest stable Rust version and check if my crate is compatible

View source on GitHub
lsprust

Security Audits

LicenseUnknownSourceWarnRepositoryPass

Frequently Asked Questions

What is rust-skills?

This skill enhances Claude Code with a meta-cognition framework for Rust development, guiding AI to reason through domain, design, and mechanics layers instead of giving surface-level fixes. It covers ownership, concurrency, error handling, unsafe code, LSP code intelligence, and domain-specific patterns, enabling accurate architectural solutions for complex Rust projects.

How to install rust-skills?

To install rust-skills: create the skills directory (mkdir -p .claude/skills), then run: mkdir -p .claude/skills && curl -o .claude/skills/rust-skills.md https://raw.githubusercontent.com/actionbook/rust-skills/main/SKILL.md. Finally, /rust-skills in Claude Code.

What is rust-skills best for?

rust-skills is a skill categorized under Development. It is designed for: lsp, rust. Created by ZhangHanDong.

What can I use rust-skills for?

rust-skills is useful for: Debug ownership errors like E0382 by analyzing why data is needed and suggesting shared immutable patterns with Arc.; Design safe concurrent systems by leveraging Rust's ownership model and choosing appropriate synchronization primitives.; Handle errors idiomatically using Result, Option, and custom error types with proper propagation.; Write and audit unsafe code blocks with clear safety invariants and minimal unsafe surface area.; Fetch latest Rust version or crate information in real-time during development.; Apply domain-specific patterns for systems like trading platforms, embedded devices, or web servers..