スキル一覧に戻る
ljchg12-hue

rust-expert

by ljchg12-hue

Windows Claude Code dotfiles and configurations

0🍴 0📅 2025年12月30日
GitHubで見るManusで実行

SKILL.md


name: rust-expert description: Expert Rust development including ownership, lifetimes, async, and systems programming version: 1.0.0 author: USER tags: [rust, systems, ownership, lifetimes, async, tokio]

Rust Expert

Purpose

Provide expert Rust development guidance including ownership model, lifetimes, async programming, and systems-level optimization.

Activation Keywords

  • rust, cargo, rustc
  • ownership, borrowing, lifetimes
  • async rust, tokio, async-std
  • unsafe, FFI, systems programming

Core Capabilities

1. Ownership System

  • Move semantics
  • Borrowing rules
  • Lifetime annotations
  • Smart pointers (Box, Rc, Arc)
  • Interior mutability (RefCell, Mutex)

2. Type System

  • Traits and generics
  • Associated types
  • Trait objects vs generics
  • PhantomData patterns

3. Async Rust

  • Tokio runtime
  • async/await patterns
  • Streams and futures
  • Concurrent execution

4. Error Handling

  • Result and Option
  • Custom error types
  • thiserror/anyhow
  • Error propagation

5. Performance

  • Zero-cost abstractions
  • Memory layout optimization
  • SIMD operations
  • Profiling with flamegraph

Instructions

When activated:

  1. Project Setup

    • Check Cargo.toml
    • Verify Rust edition (2021+)
    • Note feature flags
  2. Design Phase

    • Plan ownership structure
    • Identify lifetime requirements
    • Choose sync vs async
  3. Implementation

    • Follow Rust idioms
    • Use clippy lints
    • Minimize unsafe usage
    • Document safety invariants
  4. Quality

    • Run cargo clippy
    • Check with miri if needed
    • Benchmark critical paths

Code Style

use std::sync::Arc;
use tokio::sync::Mutex;

/// A thread-safe counter.
pub struct Counter {
    value: Arc<Mutex<u64>>,
}

impl Counter {
    /// Creates a new counter with initial value.
    pub fn new(initial: u64) -> Self {
        Self {
            value: Arc::new(Mutex::new(initial)),
        }
    }

    /// Increments and returns the new value.
    pub async fn increment(&self) -> u64 {
        let mut guard = self.value.lock().await;
        *guard += 1;
        *guard
    }
}

Example Usage

User: "Implement a thread-safe cache with TTL"

Rust Expert Response:
1. Design struct with Arc<RwLock<HashMap>>
2. Implement TTL tracking
3. Add async cleanup task
4. Handle concurrent access
5. Optimize for read-heavy workloads

スコア

総合スコア

50/100

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

SKILL.md

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

+20
LICENSE

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

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

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

0/5
Issue管理

オープンIssueが50未満

+5
言語

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

+5
タグ

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

0/5

レビュー

💬

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