Token导航 LogoToken导航

Agent Skill · 开发

rust-guide(Rust 指南)

rust-guide 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

rust-guide 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有未通过项,按安装量在开发类的 21,746 个 Skill 里排第 19,262。

总安装 282周安装 12GitHub Stars 8下载 99核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rust-guide(Rust 指南)
来源仓库:https://github.com/ar4mirez/samuel
仓库路径:skills/rust-guide
安装命令:
npx skills add https://github.com/ar4mirez/samuel --skill rust-guide
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ar4mirez/samuel --skill rust-guide

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。适合围绕代码变更和仓库状态进行整理与查询。可结合原始 README 进一步核验具体用法。安装前建议确认权限范围和是否会触发命令执行。需注意维护状态和网络访问限制。rust-guide 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/rust-guide

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/ar4mirez/samuel --skill rust-guide;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

rust-guide 怎么安装?

在终端执行 npx skills add https://github.com/ar4mirez/samuel --skill rust-guide。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

rust-guide 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

rust-guide 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/ar4mirez/samuel --skill rust-guide 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

rust-guide 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

rust-guide 用的人多吗?

公开数据是累计安装 282 次,近一周安装 12 次,下载 99 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

rust-guide 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
rust-guide

Rust 指南 · 本页

2828执行命令未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Rust Guide

Applies to: Rust 2021 edition+, Systems Programming, CLIs, WebAssembly, APIs

Core Principles

  1. Ownership Clarity: Every value has one owner; borrowing is explicit and intentional
  2. Result Over Panic: Return Result<T, E> for all fallible operations; panic! is a bug
  3. Zero-Cost Abstractions: Use iterators, generics, and traits without runtime overhead
  4. Minimal Unsafe: Default to #[forbid(unsafe_code)]; justify every unsafe block in writing
  5. Clippy Compliance: All code passes cargo clippy -- -D warnings with zero exceptions

Guardrails

Edition & Toolchain

  • Use Rust 2021 edition (edition = "2021" in Cargo.toml)
  • Set rust-version (MSRV) in Cargo.toml for all published crates
  • Use stable toolchain unless a nightly feature is explicitly justified
  • Pin dependency versions with ~ for compatible updates in libraries
  • Commit Cargo.lock for binaries; omit for libraries
  • Run cargo update weekly for security patches

Code Style

  • Run cargo fmt before every commit (no exceptions)
  • Run cargo clippy -- -D warnings before every commit
  • Follow Rust API Guidelines
  • snake_case for functions, variables, modules, crate names
  • PascalCase for types, traits, enums, type parameters
  • SCREAMING_SNAKE_CASE for constants and statics
  • Prefer exhaustive match over if let chains
  • No use super::* in non-test modules (explicit imports only)
  • Derive order: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Error Handling

  • Return Result<T, E> for all operations that can fail
  • Use thiserror for library error types, anyhow for application code
  • Never use String as an error type (create enums or use thiserror)
  • Use ? operator for propagation; avoid manual match on Result when ? suffices
  • unwrap() is forbidden outside tests and examples
  • expect("reason") is allowed only with a comment explaining the invariant
  • Use #[must_use] on functions returning Result or important values

Lifetimes

  • Let the compiler infer lifetimes whenever possible (elision rules)
  • Add explicit annotations only when the compiler requires them
  • Prefer owned types in structs; use references only when zero-copy is measured to matter
  • Use Cow<'a, str> when a function may or may not allocate
  • Avoid 'static bounds unless truly needed (e.g., thread spawning, lazy statics)

Concurrency

  • Use tokio as the async runtime (unless project requires async-std)
  • All async operations must have timeouts via tokio::time::timeout
  • Use Arc<T> for shared ownership across threads; never Rc<T> in async code
  • Prefer tokio::sync::Mutex over std::sync::Mutex in async contexts
  • Use channels (mpsc, oneshot, broadcast) over shared mutable state
  • Spawn tasks with tokio::spawn; propagate errors via JoinHandle
  • Every select! branch must handle cancellation

Project Structure

Binary Crate

myproject/
├── Cargo.toml
├── Cargo.lock
├── src/
│   ├── main.rs              # Entry point, minimal (parse args, call run)
│   ├── lib.rs               # Public API and module declarations
│   ├── config.rs            # Configuration loading
│   ├── error.rs             # Custom error types
│   ├── domain/
│   │   ├── mod.rs
│   │   └── user.rs
│   └── infra/
│       ├── mod.rs
│       ├── db.rs
│       └── http.rs
├── tests/                   # Integration tests
│   └── api_test.rs
├── benches/                 # Benchmarks (criterion)
│   └── throughput.rs
└── examples/
    └── basic_usage.rs

Cargo Workspace

workspace/
├── Cargo.toml               # [workspace] members
├── crates/
│   ├── core/                # Domain logic (no I/O)
│   │   ├── Cargo.toml
│   │   └── src/lib.rs
│   ├── api/                 # HTTP layer
│   │   ├── Cargo.toml
│   │   └── src/lib.rs
│   └── cli/                 # Binary entry point
│       ├── Cargo.toml
│       └── src/main.rs
└── tests/                   # Workspace-level integration tests
  • main.rs should be thin: parse CLI args, build config, call lib.rs entry
  • Put all business logic in lib.rs modules (testable without binary)
  • Use workspaces for projects with 3+ crates
  • error.rs at crate root defines the crate-level error enum
  • No global mutable state; use dependency injection via function arguments or structs

Error Handling Patterns

Library Errors (thiserror)

use thiserror::Error;

#[derive(Error, Debug)]
pub enum StorageError {
    #[error("record {id} not found in {table}")]
    NotFound { table: &'static str, id: String },

    #[error("duplicate key: {0}")]
    Conflict(String),

    #[error(transparent)]
    Database(#[from] sqlx::Error),

    #[error(transparent)]
    Io(#[from] std::io::Error),
}

Application Errors (anyhow)

use anyhow::{bail, Context, Result};

fn load_config(path: &str) -> Result<Config> {
    let raw = std::fs::read_to_string(path)
        .with_context(|| format!("reading config from {path}"))?;

    let config: Config = toml::from_str(&raw)
        .context("parsing TOML config")?;

    if config.port == 0 {
        bail!("port must be non-zero");
    }

    Ok(config)
}

Conversion With the? Operator

// Define From impls via thiserror's #[from], then just use ?
fn create_user(db: &Pool, input: &NewUser) -> Result<User, AppError> {
    validate_email(&input.email)?;   // ValidationError -> AppError
    let user = db.insert(input)?;    // sqlx::Error -> AppError
    Ok(user)
}

Testing

Unit Tests (in-module)

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn parse_valid_email_succeeds() {
        let result = Email::parse("user@example.com");
        assert!(result.is_ok());
    }

    #[test]
    fn parse_invalid_email_returns_error() {
        let err = Email::parse("not-an-email").unwrap_err();
        assert!(matches!(err, ValidationError::InvalidEmail(_)));
    }

    #[test]
    fn amount_cannot_be_negative() -> Result<(), Box<dyn std::error::Error>> {
        let result = Amount::new(-5);
        assert!(result.is_err());
        Ok(())
    }
}

Integration Tests (tests/ directory)

// tests/api_test.rs
use myproject::app;

#[tokio::test]
async fn health_endpoint_returns_ok() {
    let app = app::build_test_app().await;
    let resp = app.get("/health").await;
    assert_eq!(resp.status(), 200);
}

Doc Tests

/// Adds two numbers together.
///
/// # Examples
///
/// ```
/// use mycrate::add;
/// assert_eq!(add(2, 3), 5);
/// ```
pub fn add(a: i32, b: i32) -> i32 {
    a + b
}

Property-Based Testing (proptest)

use proptest::prelude::*;

proptest! {
    #[test]
    fn roundtrip_serialization(input in "[a-zA-Z0-9]{1,100}") {
        let encoded = encode(&input);
        let decoded = decode(&encoded)?;
        prop_assert_eq!(input, decoded);
    }
}

Testing Standards

  • Test names describe behavior: fn rejected_order_cannot_be_shipped()
  • Unit tests live in #[cfg(test)] mod tests in the same file
  • Integration tests go in tests/ directory
  • Use #[should_panic(expected = "...")] for panic-testing (rare)
  • Use assert!(matches!(...)) for enum variant assertions
  • Coverage target: >80% for libraries, >60% for applications
  • Use cargo tarpaulin or cargo llvm-cov for coverage
  • Async tests use #[tokio::test]

Tooling

Essential Commands

cargo fmt                       # Format (non-negotiable)
cargo clippy -- -D warnings     # Lint with deny
cargo test                      # All tests
cargo test --all-features       # Test all feature combinations
cargo check                     # Fast type-check (no codegen)
cargo doc --open                # Generate and view docs
cargo audit                     # Check for vulnerable deps
cargo deny check                # License + advisory check
cargo bench                     # Run benchmarks (criterion)

Cargo.toml Essentials

[package]
name = "myproject"
version = "0.1.0"
edition = "2021"
rust-version = "1.75"

[dependencies]
serde = { version = "1", features = ["derive"] }
thiserror = "2"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tracing = "0.1"

[dev-dependencies]
proptest = "1"
tokio = { version = "1", features = ["test-util"] }

[profile.release]
lto = true
codegen-units = 1
strip = true

[lints.clippy]
pedantic = { level = "warn", priority = -1 }
unwrap_used = "deny"
expect_used = "warn"

Rustfmt Configuration

# rustfmt.toml
edition = "2021"
max_width = 100
use_field_init_shorthand = true

MSRV Policy

  • Set rust-version in Cargo.toml for every published crate
  • Test MSRV in CI: cargo +1.75.0 check
  • Bump MSRV only when a dependency or language feature requires it
  • Document MSRV bumps in changelog

Advanced Topics

For detailed patterns and examples, see:

External References

平台分布

Codex

37.96%
按下载量换算38

Claude

31%
按下载量换算31

Cursor

20%
按下载量换算20

Gemini CLI

8.87%
按下载量换算9

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/ar4mirez/samuel --skill rust-guide 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills