{
  "markdown": "# Rust Skills\n\n[中文](./README-zh.md) | [日本語](./README-ja.md)\n\n> AI-powered Rust development assistant with meta-cognition framework\n\n[![Version](https://img.shields.io/badge/version-2.0.9-green.svg)](https://github.com/actionbook/rust-skills/releases)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Claude Code](https://img.shields.io/badge/Claude%20Code-Plugin-blue)](https://github.com/anthropics/claude-code)\n\n## What is Rust Skills?\n\n**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**.\n\n### The Problem\n\nTraditional AI assistance for Rust:\n```\nUser: \"My trading system reports E0382\"\nAI: \"Use .clone()\"  ← Surface fix, ignores domain constraints\n```\n\n### The Solution\n\nRust Skills with meta-cognition:\n```\nUser: \"My trading system reports E0382\"\n\nAI (with Rust Skills):\n├── Layer 1: E0382 = ownership error → Why is this data needed?\n│       ↑\n├── Layer 3: Trade records are immutable audit data → Should share, not copy\n│       ↓\n├── Layer 2: Use Arc<TradeRecord> as shared immutable value\n│       ↓\n└── Recommendation: Redesign as Arc<T>, not clone()\n```\n\n## Features\n\n- **Meta-Cognition Framework**: Three-layer cognitive model (Domain → Design → Mechanics)\n- **Real-time Information**: Fetch latest Rust versions and crate info via background agents\n- **Dynamic Skills**: Auto-generate skills from your Cargo.toml dependencies\n- **Domain Extensions**: FinTech, ML, Cloud-Native, IoT, Embedded, Web, CLI support\n- **Coding Guidelines**: Complete Rust coding conventions and best practices\n\n## Installation\n\nRust Skills supports two installation modes:\n\n- **Plugin Mode** (Claude Code): Full features including hooks, agents, and auto meta-cognition\n- **Skills-only Mode**: Works with any coding agent that supports skills (Claude Code, Vercel AI, etc.)\n\n---\n\n### Skills-only Install (Recommended)\n\nThe simplest way to get started. Works with **any coding agent** that supports skills, including Claude Code, [Vercel's `add-skills`](https://github.com/nicepkg/add-skills), and others.\n\nSkills now include **inline fallback logic** — when agent files are not available, skills execute directly using built-in tools (actionbook, agent-browser, WebFetch).\n\n#### Option A: NPX (Easiest)\n\n```bash\nnpx skills add actionbook/rust-skills\n```\n\n#### Option B: CoWork CLI\n\nInstall via [CoWork](https://crates.io/crates/cowork), a Rust-based skills management tool:\n\n```bash\n# Install CoWork\ncargo install cowork\n\n# Method 1: Direct install\ncowork install actionbook/rust-skills\n\n# Method 2: Config-based install (recommended for teams)\ncowork config init                    # Create .cowork/Skills.toml\n# Edit Skills.toml to add rust-skills (see below)\ncowork config install                 # Install all configured skills\n```\n\n**Skills.toml configuration:**\n\n```toml\n[project]\nname = \"my-rust-project\"\n\n[skills.install]\nrust-skills = \"actionbook/rust-skills\"\n\n[security]\ntrusted_authors = [\"ZhangHanDong\"]\n```\n\n> CoWork (`co` for short) provides version management, dependency resolution, lock files, and security auditing. See [CoWork documentation](https://crates.io/crates/cowork) for more details.\n\n#### Option C: Manual Copy\n\n```bash\ngit clone https://github.com/actionbook/rust-skills.git\ncp -r rust-skills/skills/* ~/.claude/skills/\n```\n\n> **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.\n\n---\n\n### Claude Code Plugin Install (Full Features)\n\nFor **Claude Code users** who want the complete experience with hooks, background agents, and auto meta-cognition triggering.\n\n#### Option A: Marketplace\n\n```bash\n# Step 1: Add the marketplace\n/plugin marketplace add actionbook/rust-skills\n\n# Step 2: Install the plugin\n/plugin install rust-skills@rust-skills\n```\n\n> **Note**: Step 1 only adds the marketplace (plugin source). Step 2 actually installs the rust-skills plugin with all features enabled.\n\n#### Option B: Full Plugin (Local)\n\n```bash\n# Clone the repository\ngit clone https://github.com/actionbook/rust-skills.git\n\n# Launch with plugin directory\nclaude --plugin-dir /path/to/rust-skills\n```\n\n---\n\n### Feature Comparison\n\n| Feature | Plugin (Marketplace) | Plugin (Local) | Skills-only (NPX/CoWork/Manual) |\n|---------|---------------------|----------------|--------------------------------|\n| All 31 Skills | ✅ | ✅ | ✅ |\n| Auto meta-cognition trigger | ✅ | ✅ | ❌ (manual invoke) |\n| Hook-based routing | ✅ | ✅ | ❌ |\n| Background agents | ✅ | ✅ | ✅ (inline fallback) |\n| Easy updates | ✅ | ❌ | ✅ (NPX/CoWork) |\n| Works with other agents | ❌ | ❌ | ✅ |\n\n### Permission Configuration\n\nBackground agents require permission to run `agent-browser`. Configure in your project:\n\n```bash\n# Copy example config\ncp /path/to/rust-skills/.claude/settings.example.json .claude/settings.local.json\n```\n\nOr create manually:\n\n```bash\nmkdir -p .claude\ncat > .claude/settings.local.json << 'EOF'\n{\n  \"permissions\": {\n    \"allow\": [\n      \"Bash(agent-browser *)\"\n    ]\n  }\n}\nEOF\n```\n\nSee [.claude/settings.example.json](.claude/settings.example.json) for reference.\n\n### Other Platforms\n\n- **OpenCode**: See [.opencode/INSTALL.md](.opencode/INSTALL.md)\n- **Codex**: See [.codex/INSTALL.md](.codex/INSTALL.md)\n\n## Dependent Skills\n\nRust Skills relies on these external tools for full functionality:\n\n| Tool | Description | GitHub |\n|------|-------------|--------|\n| **actionbook** | MCP server for website action manuals. Used by agents to fetch structured web content (Rust releases, crate info, documentation). | [actionbook/actionbook](https://github.com/actionbook/actionbook) |\n| **agent-browser** | Browser automation tool for fetching real-time web data. Fallback when actionbook is unavailable. | [vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser) |\n\n## Meta-Cognition Framework\n\n### Core Concept\n\n**Don't answer directly. Trace through cognitive layers first.**\n\n```\nLayer 3: Domain Constraints (WHY)\n├── Domain rules determine design choices\n└── Example: Financial systems require immutable, auditable data\n\nLayer 2: Design Choices (WHAT)\n├── Design patterns and architectural decisions\n└── Example: Use Arc<T> for shared immutable data\n\nLayer 1: Language Mechanics (HOW)\n├── Rust language features and compiler rules\n└── Example: E0382 is a symptom of ownership design issues\n```\n\n### Routing Rules\n\n| User Signal | Entry Layer | Trace Direction | Primary Skill |\n|-------------|-------------|-----------------|---------------|\n| E0xxx errors | Layer 1 | Trace UP ↑ | m01-m07 |\n| \"How to design...\" | Layer 2 | Bidirectional | m09-m15 |\n| \"[Domain] app development\" | Layer 3 | Trace DOWN ↓ | domain-* |\n| Performance issues | Layer 1→2 | Up then Down | m10-performance |\n\n## Skills Overview\n\n### Core Skills\n- `rust-router` - Master router for all Rust questions (invoked first)\n- `rust-learner` - Fetch latest Rust/crate version info\n- `coding-guidelines` - Coding conventions lookup\n\n### Layer 1: Language Mechanics (m01-m07)\n\n| Skill | Core Question | Triggers |\n|-------|---------------|----------|\n| m01-ownership | Who should own this data? | E0382, E0597, move, borrow |\n| m02-resource | What ownership pattern fits? | Box, Rc, Arc, RefCell |\n| m03-mutability | Why does this data need to change? | mut, Cell, E0596, E0499 |\n| m04-zero-cost | Compile-time or runtime polymorphism? | generic, trait, E0277 |\n| m05-type-driven | How can types prevent invalid states? | newtype, PhantomData |\n| m06-error-handling | Expected failure or bug? | Result, Error, panic, ? |\n| m07-concurrency | CPU-bound or I/O-bound? | async, Send, Sync, thread |\n\n### Layer 2: Design Choices (m09-m15)\n\n| Skill | Core Question | Triggers |\n|-------|---------------|----------|\n| m09-domain | What role does this concept play? | DDD, entity, value object |\n| m10-performance | Where's the bottleneck? | benchmark, profiling |\n| m11-ecosystem | Which crate fits this task? | crate selection, dependencies |\n| m12-lifecycle | When to create, use, cleanup? | RAII, Drop, lazy init |\n| m13-domain-error | Who handles this error? | retry, circuit breaker |\n| m14-mental-model | How to think about this correctly? | learning Rust, why |\n| m15-anti-pattern | Does this pattern hide design issues? | code smell, common mistakes |\n\n### Layer 3: Domain Constraints (domain-*)\n\n| Skill | Domain | Core Constraints |\n|-------|--------|------------------|\n| domain-fintech | FinTech | Audit trail, precision, consistency |\n| domain-ml | Machine Learning | Memory efficiency, GPU acceleration |\n| domain-cloud-native | Cloud Native | 12-Factor, observability, graceful shutdown |\n| domain-iot | IoT | Offline-first, power management, security |\n| domain-web | Web Services | Stateless, latency SLA, concurrency |\n| domain-cli | CLI | UX, config precedence, exit codes |\n| domain-embedded | Embedded | No heap, no_std, real-time |\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `/rust-features [version]` | Get Rust version features |\n| `/crate-info <crate>` | Get crate information |\n| `/docs <crate> [item]` | Get API documentation |\n| `/sync-crate-skills` | Sync skills from Cargo.toml dependencies |\n| `/update-crate-skill <crate>` | Update specific crate skill |\n| `/clean-crate-skills` | Clean local crate skills |\n\n## Dynamic Skills\n\nGenerate skills on-demand from your project dependencies:\n\n```bash\n# Enter your Rust project\ncd my-rust-project\n\n# Sync all dependencies\n/sync-crate-skills\n\n# Skills are created at ~/.claude/skills/{crate}/\n```\n\n### Features\n- **On-demand generation**: Created from Cargo.toml dependencies\n- **Local storage**: `~/.claude/skills/`\n- **Version tracking**: Each skill records crate version\n- **Workspace support**: Parses all workspace members\n\n## How It Works\n\n```\nUser Question\n     │\n     ▼\n┌─────────────────────────────────────────┐\n│           Hook Layer                     │\n│  400+ keywords trigger meta-cognition    │\n└─────────────────────────────────────────┘\n     │\n     ▼\n┌─────────────────────────────────────────┐\n│           rust-router                    │\n│  Identify entry layer + domain           │\n│  Decision: dual-skill loading            │\n└─────────────────────────────────────────┘\n     │\n     ├──────────────┬──────────────┐\n     ▼              ▼              ▼\n┌──────────┐  ┌──────────┐  ┌──────────┐\n│ Layer 1  │  │ Layer 2  │  │ Layer 3  │\n│ m01-m07  │  │ m09-m15  │  │ domain-* │\n└──────────┘  └──────────┘  └──────────┘\n     │\n     ▼\nDomain-correct architectural solution\n```\n\n## Documentation\n\n- [Architecture (中文)](./docs/architecture-zh.md)\n- [Functional Overview (中文)](./docs/functional-overview-zh.md)\n- [Hook Mechanism (中文)](./docs/hook-mechanism-zh.md)\n- [Prompt Engineering (中文)](./docs/prompt-engineering-zh.md)\n- [Meta-Cognition Example: E0382](./docs/meta-cognition-example-e0382.md)\n\n## Contributing\n\nContributions are welcome! Please read our contributing guidelines before submitting PRs.\n\n## Acknowledgments\n\n- [@pinghe](https://github.com/pinghe) - `context: fork` support suggestion ([#4](https://github.com/actionbook/rust-skills/issues/4))\n- [@DoiiarX](https://github.com/DoiiarX) - OpenCode installation fix ([#6](https://github.com/actionbook/rust-skills/issues/6))\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Links\n\n- **GitHub**: https://github.com/actionbook/rust-skills\n- **Issues**: https://github.com/actionbook/rust-skills/issues\n",
  "bytes": 11668,
  "sha": "b90e0493e9afa7667c411e9f74a75459a4493b7929cd1868bdc675226b31ad41",
  "repo_slug": "actionbook/rust-skills",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/skl_actionbook_rust_skills_domain_iot_7824e665/readme"
}