
Rust Router
Route every Rust question—errors, design, async, and comparisons—to the right specialized rust-skills submodule instead of generic guesses.
Overview
Rust Router is an agent skill most often used in Build (also Ship) that analyzes Rust intent and delegates to specialized rust-skills instead of answering with undifferentiated chat advice.
Install
npx skills add https://github.com/zhanghandong/rust-skills --skill rust-routerWhat is this skill?
- CRITICAL entry point: highest-priority routing for all Rust questions including compare/vs and best-practice asks
- Meta-cognition layers: domain constraints, design choices, then implementation paths
- Triggers on compiler errors (E0382, E0597, E0277, E0308, borrow/move/lifetime) and async/tokio topics
- Activates on Cargo.toml and **/*.rs globs for repo-aware sessions
- Bilingual trigger phrases (EN/ZH) for intent analysis before delegating to m09–m15 and domain skills
- Meta-cognition framework version 2.0.0 documented in SKILL.md
Adoption & trust: 655 installs on skills.sh; 1.2k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent gives generic Rust snippets that miss the real error code, runtime choice, or domain constraint behind your Cargo project.
Who is it for?
Solo builders with active Cargo repos who hit compile errors, async design forks, or cross-crate architecture questions daily.
Skip if: Greenfield learners who only want a Rust tutorial with no repo—start with fundamentals, then enable the router when Cargo.toml exists.
When should I use this skill?
Any Rust, cargo, rustc, crate, compile error, async, or compare/vs question in a repo with Cargo.toml or .rs files.
What do I get? / Deliverables
Questions get classified through the meta-cognition stack and routed to the correct rust-skills deep dive for fixes, patterns, or comparisons.
- Routed plan to the appropriate rust submodule
- Layered analysis (domain, design, implementation) before code edits
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Rust work clusters in Build backend, but compile and borrow failures also dominate Ship debugging—canonical shelf stays backend where most coding happens. Backend subphase covers Cargo projects, crates, and systems APIs where the router’s globs and triggers apply.
Where it fits
Classify a mismatched types error and hand off to the typed fix skill before patching handlers.
Compare tokio versus async-std for a new HTTP client crate before locking Cargo.toml deps.
Route CI failures on E0502 borrow errors to the ownership submodule during test fixes.
Interpret a trait bound not satisfied in a PR and pick the design-pattern skill for the API surface.
How it compares
Meta routing skill for a Rust skill pack—not a single-purpose code generator.
Common Questions / FAQ
Who is rust-router for?
Developers using Claude Code, Cursor, or Codex on Rust codebases who need consistent delegation across the zhanghandong rust-skills family.
When should I use rust-router?
During Build backend when implementing crates or APIs, and during Ship testing or review when fixing E0xxx errors, lifetime issues, or tokio versus async-std decisions.
Is rust-router safe to install?
It is documentation and routing logic; review the Security Audits panel on this page—downstream skills may request shell or network depending on which submodule runs.
SKILL.md
READMESKILL.md - Rust Router
--- # Rust Question Router > **Version:** 2.0.0 | **Last Updated:** 2025-01-22 > > **v2.0:** Context optimized - detailed examples moved to sub-files ## Meta-Cognition Framework ### Core Principle **Don't answer directly. Trace through the cognitive layers first.** ``` Layer 3: Domain Constraints (WHY) ├── Business rules, regulatory requirements ├── domain-fintech, domain-web, domain-cli, etc. └── "Why is it designed this way?" Layer 2: Design Choices (WHAT) ├── Architecture patterns, DDD concepts ├── m09-m15 skills └── "What pattern should I use?" Layer 1: Language Mechanics (HOW) ├── Ownership, borrowing, lifetimes, traits ├── m01-m07 skills └── "How do I implement this in Rust?" ``` ### Routing by Entry Point | User Signal | Entry Layer | Direction | First Skill | |-------------|-------------|-----------|-------------| | E0xxx error | Layer 1 | Trace UP ↑ | m01-m07 | | Compile error | Layer 1 | Trace UP ↑ | Error table below | | "How to design..." | Layer 2 | Check L3, then DOWN ↓ | m09-domain | | "Building [domain] app" | Layer 3 | Trace DOWN ↓ | domain-* | | "Best practice..." | Layer 2 | Both directions | m09-m15 | | Performance issue | Layer 1 → 2 | UP then DOWN | m10-performance | ### CRITICAL: Dual-Skill Loading **When domain keywords are present, you MUST load BOTH skills:** | Domain Keywords | L1 Skill | L3 Skill | |-----------------|----------|----------| | Web API, HTTP, axum, handler | m07-concurrency | **domain-web** | | 交易, 支付, trading, payment | m01-ownership | **domain-fintech** | | CLI, terminal, clap | m07-concurrency | **domain-cli** | | kubernetes, grpc, microservice | m07-concurrency | **domain-cloud-native** | | embedded, no_std, MCU | m02-resource | **domain-embedded** | --- ## INSTRUCTIONS FOR CLAUDE ### CRITICAL: Negotiation Protocol Trigger **BEFORE answering, check if negotiation is required:** | Query Contains | Action | |----------------|--------| | "比较", "对比", "compare", "vs", "versus" | **MUST use negotiation** | | "最佳实践", "best practice" | **MUST use negotiation** | | Domain + error (e.g., "交易系统 E0382") | **MUST use negotiation** | | Ambiguous scope (e.g., "tokio 性能") | **SHOULD use negotiation** | **When negotiation is required, include:** ```markdown ## Negotiation Analysis **Query Type:** [Comparative | Cross-domain | Synthesis | Ambiguous] **Negotiation:** Enabled ### Source: [Agent/Skill Name] **Confidence:** HIGH | MEDIUM | LOW | UNCERTAIN **Gaps:** [What's missing] ## Synthesized Answer [Answer] **Overall Confidence:** [Level] **Disclosed Gaps:** [Gaps user should know] ``` > **详细协议见:** `patterns/negotiation.md` --- ### Default Project Settings When creating new Rust projects or Cargo.toml files, ALWAYS use: ```toml [package] edition = "2024" # ALWAYS use latest stable edition rust-version = "1.85" [lints.rust] unsafe_code = "warn" [lints.clippy] all = "warn" pedantic = "warn" ``` --- ## Layer 1 Skills (Language Mechanics) | Pattern | Route To | |---------|----------| | move, borrow, lifetime, E0382, E0597 | m01-ownership | | Box, Rc, Arc