スキル一覧に戻る
rustfs

rust-router

by rustfs

rust-routerは、クラウドインフラの構築と運用を支援するスキルです。スケーラビリティと信頼性を確保しながら、効率的なクラウド環境を実現します。

20,125🍴 866📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: rust-router description: "CRITICAL: Use for ALL Rust questions including errors, design, and coding. Triggers on: Rust, cargo, rustc, crate, Cargo.toml, 意图分析, 问题分析, 语义分析, analyze intent, question analysis, compile error, borrow error, lifetime error, ownership error, type error, trait error, value moved, cannot borrow, does not live long enough, mismatched types, not satisfied, E0382, E0597, E0277, E0308, E0499, E0502, E0596, async, await, Send, Sync, tokio, unsafe, FFI, concurrency, error handling, 编译错误, compile error, 所有权, ownership, 借用, borrow, 生命周期, lifetime, 类型错误, type error, 异步, async, 并发, concurrency, 错误处理, error handling, 问题, problem, question, 怎么用, how to use, 如何, how to, 为什么, why, 什么是, what is, 帮我写, help me write, 实现, implement, 解释, explain, 区别, difference, 最佳实践, best practice" globs: ["/Cargo.toml", "/*.rs"]

Rust Question Router

Version: 2.0.0 | Last Updated: 2026-01-17

New in v2.0: Meta-Cognition Routing - Three-layer cognitive model for deeper answers

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 SignalEntry LayerDirectionFirst Skill
E0xxx errorLayer 1Trace UP ↑m01-m07
Compile errorLayer 1Trace UP ↑Error table below
"How to design..."Layer 2Check L3, then DOWN ↓m09-domain
"Building [domain] app"Layer 3Trace DOWN ↓domain-*
"Best practice..."Layer 2Both directionsm09-m15
Performance issueLayer 1 → 2UP then DOWNm10-performance

CRITICAL: Dual-Skill Loading

When domain keywords are present, you MUST load BOTH skills:

Domain KeywordsL1 SkillL3 Skill
Web API, HTTP, axum, handlerm07-concurrencydomain-web
交易, 支付, trading, paymentm01-ownershipdomain-fintech
CLI, terminal, clapm07-concurrencydomain-cli
kubernetes, grpc, microservicem07-concurrencydomain-cloud-native
embedded, no_std, MCUm02-resourcedomain-embedded

Example: "Web API 报错 Rc cannot be sent"

  • Load: m07-concurrency (L1 - Send/Sync error)
  • Load: domain-web (L3 - Web state management)
  • Answer must include both layers

Trace Examples

User: "My trading system reports E0382"

1. Entry: Layer 1 (E0382 = ownership error)
2. Load: m01-ownership skill
3. Trace UP: What design led to this?
4. Check: domain-fintech (trading = immutable audit data)
5. Answer: Don't clone, use Arc<T> for shared immutable data
User: "How should I handle user authentication?"

1. Entry: Layer 2 (design question)
2. Trace UP to Layer 3: domain-web constraints
3. Load: domain-web skill (security, stateless HTTP)
4. Trace DOWN: m06-error-handling, m07-concurrency
5. Answer: JWT with proper error types, async handlers

INSTRUCTIONS FOR CLAUDE

Default Project Settings (When Creating Rust Code)

When creating new Rust projects or Cargo.toml files, ALWAYS use:

[package]
edition = "2024"  # ALWAYS use latest stable edition
rust-version = "1.85"

[lints.rust]
unsafe_code = "warn"

[lints.clippy]
all = "warn"
pedantic = "warn"

Rules:

  • ALWAYS use edition = "2024" (not 2021 or earlier)
  • Include rust-version for MSRV clarity
  • Enable clippy lints by default
  • DO NOT use WebSearch for Rust questions - use skills and agents

Meta-Cognition Routing Process

  1. Identify Entry Layer

    • E0xxx errors → Layer 1
    • Design questions → Layer 2
    • Domain-specific → Layer 3
  2. Load Appropriate Skill

    • Read the skill file for context
    • Note the "Trace Up" and "Trace Down" sections
  3. Trace Through Layers

    • Don't stop at surface-level fix
    • Ask "Why?" to trace up
    • Ask "How?" to trace down
  4. Answer with Context

    • Include the reasoning chain
    • Reference which layers/skills informed the answer

When User Requests Intent Analysis

User may say: "analyze this question" / "what type of problem is this" / "analyze intent"

Execute these steps:

  1. Extract Keywords - Identify Rust concepts, error codes, crate names
  2. Identify Entry Layer - Which cognitive layer is this?
  3. Map to Skills - Which m0x/m1x/domain skills apply?
  4. Report Analysis - Tell user the layers and suggested trace
  5. Invoke Skill - Load and apply the matched skill

Layer 1 Skills (Language Mechanics)

PatternCategoryRoute To
move, borrow, lifetime, E0382, E0597m01m01-ownership
Box, Rc, Arc, RefCell, Cellm02m02-resource
mut, interior mutability, E0499, E0502, E0596m03m03-mutability
generic, trait, inline, monomorphizationm04m04-zero-cost
type state, phantom, newtypem05m05-type-driven
Result, Error, panic, ?, anyhow, thiserrorm06m06-error-handling
Send, Sync, thread, async, channelm07m07-concurrency
unsafe, FFI, extern, raw pointer, transmute-unsafe-checker

Layer 2 Skills (Design Choices)

PatternCategoryRoute To
domain model, business logicm09m09-domain
performance, optimization, benchmarkm10m10-performance
integration, interop, bindingsm11m11-ecosystem
resource lifecycle, RAII, Dropm12m12-lifecycle
domain error, recovery strategym13m13-domain-error
mental model, how to thinkm14m14-mental-model
anti-pattern, common mistake, pitfallm15m15-anti-pattern

Layer 3 Skills (Domain Constraints)

Domain KeywordsRoute To
fintech, trading, decimal, currencydomain-fintech
ml, tensor, model, inferencedomain-ml
kubernetes, docker, grpc, microservicedomain-cloud-native
embedded, sensor, mqtt, iotdomain-iot
web server, HTTP, REST, axum, actixdomain-web
CLI, command line, clap, terminaldomain-cli
no_std, microcontroller, firmwaredomain-embedded

Error Code Routing

Error CodeLayerRoute ToCommon Cause
E0382L1m01-ownershipUse of moved value
E0597L1m01-ownershipLifetime too short
E0506L1m01-ownershipCannot assign to borrowed
E0507L1m01-ownershipCannot move out of borrowed
E0515L1m01-ownershipReturn local reference
E0716L1m01-ownershipTemporary value dropped
E0106L1m01-ownershipMissing lifetime specifier
E0596L1m03-mutabilityCannot borrow as mutable
E0499L1m03-mutabilityMultiple mutable borrows
E0502L1m03-mutabilityBorrow conflict
E0277L1m04/m07Trait bound not satisfied
E0308L1m04-zero-costType mismatch
E0599L1m04-zero-costNo method found
E0038L1m04-zero-costTrait not object-safe
E0433L1m11-ecosystemCannot find crate/module

Unsafe-Specific Routing

For detailed unsafe rules, route to unsafe-checker skill:

PatternRoute To
unsafe code review, SAFETY commentunsafe-checker
FFI, extern "C", C interop, libcunsafe-checker
raw pointer, *mut, *const, NonNullunsafe-checker
transmute, union, repr(C)unsafe-checker
MaybeUninit, uninitialized memoryunsafe-checker
panic safety, double-freeunsafe-checker
Send impl, Sync impl, manual auto-traitsunsafe-checker

Functional Routing Table

PatternRoute ToAction
latest version, what's newrust-learnerUse agents
API, docs, documentationdocs-researcherUse agent
Cargo.toml, dependenciesdynamic-skillsSuggest /sync-crate-skills
code style, naming, clippycoding-guidelinesRead skill
unsafe code, FFIunsafe-checkerRead skill
code reviewos-checkerSuggest /rust-review

Priority Order

  1. Identify cognitive layer (L1/L2/L3)
  2. Load entry skill (m0x/m1x/domain)
  3. Trace through layers (UP or DOWN)
  4. Cross-reference skills as indicated in "Trace" sections
  5. Answer with reasoning chain

Skill File Paths

Meta-Cognition Framework

_meta/reasoning-framework.md    # How to trace through layers
_meta/layer-definitions.md      # Layer definitions
_meta/externalization.md        # Cognitive externalization
_meta/error-protocol.md         # 3-Strike escalation rule
_meta/hooks-patterns.md         # Automatic triggers

Layer 1 Skills (Language Mechanics)

skills/m01-ownership/SKILL.md
skills/m02-resource/SKILL.md
skills/m03-mutability/SKILL.md
skills/m04-zero-cost/SKILL.md
skills/m05-type-driven/SKILL.md
skills/m06-error-handling/SKILL.md
skills/m07-concurrency/SKILL.md

Layer 2 Skills (Design Choices)

skills/m09-domain/SKILL.md
skills/m10-performance/SKILL.md
skills/m11-ecosystem/SKILL.md
skills/m12-lifecycle/SKILL.md
skills/m13-domain-error/SKILL.md
skills/m14-mental-model/SKILL.md
skills/m15-anti-pattern/SKILL.md

Layer 3 Skills (Domain Constraints)

skills/domain-fintech/SKILL.md
skills/domain-ml/SKILL.md
skills/domain-cloud-native/SKILL.md
skills/domain-iot/SKILL.md
skills/domain-web/SKILL.md
skills/domain-cli/SKILL.md
skills/domain-embedded/SKILL.md

OS-Checker Integration

For code review and security auditing:

Use CaseCommandTools
Daily check/rust-reviewclippy
Security audit/audit securitycargo audit, geiger
Unsafe audit/audit safetymiri, rudra
Concurrency audit/audit concurrencylockbud
Full audit/audit fullall os-checker tools

Workflow Example with Meta-Cognition

User: "Why am I getting E0382 in my trading system?"

Analysis:
1. Entry: Layer 1 (E0382 = ownership/move error)
2. Load: m01-ownership skill
3. Context: "trading system" → domain-fintech

Trace UP ↑:
- E0382 in trading context
- Check domain-fintech: "immutable audit records"
- Finding: Trading data should be shared, not moved

Response:
"E0382 indicates a value was moved when still needed.
In a trading system (domain-fintech), transaction records
should be immutable and shareable for audit purposes.

Instead of cloning, consider:
- Arc<TradeRecord> for shared immutable access
- This aligns with financial audit requirements

See: m01-ownership (Trace Up section),
     domain-fintech (Audit Requirements)"

スコア

総合スコア

90/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 1000以上

+15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

0/5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

レビュー

💬

レビュー機能は近日公開予定です