All skills
onsails avatar

/rust-dev

@1db78da
by Andrey Kuznetsovonsails/skills44 stars
3

This skill should be used when working with Rust code, reviewing Rust code, managing Rust dependencies, creating Rust projects, or fixing Rust compilation errors. It provides strict coding standards (especially FAIL FAST error handling), workspace architecture guidance, dependency management automation, and common Rust patterns.

Use this Skill: https://skilld.dev/gh/onsails/skills/rust-dev

This session only. Nothing lands on disk.

referencesdependency-guide.md

≈400 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Dependency Management

Version Format

Always use x.x (major.minor) format: serde = "1.0". This ensures patch compatibility.

Find latest version: python3 scripts/check_crate_version.py <crate-name>

Workspace Dependencies

Root Cargo.toml:

[workspace]
members = ["project", "project-cli"]

[workspace.dependencies]
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
anyhow = "1.0"
thiserror = "2.0"
clap = { version = "4.5", features = ["derive"] }
derive_more = { version = "1.0", features = ["full"] }

Member crate Cargo.toml:

[dependencies]
serde = { workspace = true }
tokio = { workspace = true }

Feature Flags

[features]
default = ["std"]
std = []
full = ["serde", "tokio"]

[dependencies]
serde = { version = "1.0", optional = true, features = ["derive"] }
tokio = { version = "1", optional = true, features = ["full"] }

CLI-First Configuration

use clap::Parser;

#[derive(Parser, Debug)]
#[command(name = "myapp")]
pub struct CliArgs {
    #[arg(long, env = "API_KEY")]
    api_key: String,

    #[arg(long, default_value = "localhost")]
    host: String,

    #[arg(long, default_value_t = 8080)]
    port: u16,
}

pub struct Config {
    pub api_key: String,
    pub host: String,
    pub port: u16,
}

impl Config {
    pub fn from_cli_args(args: CliArgs) -> Self {
        Self {
            api_key: args.api_key,
            host: args.host,
            port: args.port,
        }
    }
}

Never use Default that reads environment. Always from_cli_args().

Source: SKILL.md on GitHub

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides templates, coding standards, and utility scripts for Rust development. It uses official registries for dependency information and enforces robust error-handling patterns. No security risks were identified.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 1db78da. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Steadyupdated last month
What it can do
Reads files Runs commands
All 3 allowed tools
ReadBash(python3 *)Bash(cargo *)

README badge

README badge for onsails/skills/rust-dev