rugged-gemini: Skill for Claude Code

.gemini/skills/rust-idioms/SKILL.md

rust-idioms is a skill for Claude Code, Gemini CLI from irahardianto/rugged-gemini. It costs 0 tokens per session (1,452 once invoked), scanned A, original, MIT.

A set of Rust coding guidelines built around ownership, borrowing, error handling, concurrency, and the Rust compiler’s safety checks.

In plain words
What is it for?
It supports designing Rust function parameters and data structures, propagating errors, choosing synchronization methods, and writing safe concurrent code.
Why use it?
It helps prevent memory-safety problems and reduces unnecessary copying or unsafe error handling. It gives developers practical patterns for working with Rust’s ownership rules.

Skill for Claude CodeGemini CLI

Written for Claude Code and Gemini CLI: paths in frontmatter, but also installed under .gemini/. Also seen: mentions Gemini CLI.

This is irahardianto/rugged-gemini's own configuration. It tells Claude Code and Gemini CLI how to work on rugged-gemini itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rugged-gemini configures →

Reuse

Borrowing it

Nothing to install: this file belongs to irahardianto/rugged-gemini. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/irahardianto/rugged-gemini/main/.gemini/skills/rust-idioms/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/irahardianto/rugged-gemini

Made for: Claude Code, Gemini CLI.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rust-idioms

README.md
[![agentmods](https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/rust-idioms/github.svg)](https://agentmods.dev/skills/irahardianto/rugged-gemini/rust-idioms)
Your own site
<a href="https://agentmods.dev/skills/irahardianto/rugged-gemini/rust-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/rust-idioms/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rust-idioms

Your own site · 80×15
<a href="https://agentmods.dev/skills/irahardianto/rugged-gemini/rust-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/rust-idioms.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,452 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01452
Opus 5 $0.00000 $0.00726
Sonnet 5 $0.00000 $0.00290
Haiku 4.5 $0.00000 $0.00145

Measured 6d ago against content hash b962634eeb5d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

rust-idioms scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.gemini/skills/rust-idioms/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust Idioms and Patterns

Rust type system + ownership model = primary correctness tools. Lean into compiler — strongest ally. Idiomatic, safe, expressive.

Scope: Rust coding idioms. Layout: @.gemini/skills/project-structure-rust/SKILL.md. Test naming: GEMINI.md § Testing Strategy. Logging: @.gemini/skills/logging-and-observability-principles/SKILL.md.

Ownership and Borrowing

  1. Prefer borrowing (&T, &mut T) over cloning. Never .clone() to silence borrow checker without // CLONE: comment. Use Cow<'_, T> when may/may not need ownership. Prefer &str over String, &[T] over Vec<T> in params.

  2. Minimize owned data in structs. References + lifetimes for short-lived. Owned types when struct outlives inputs.

  3. Avoid unnecessary Arc<Mutex<T>>: channels for one-directional, RwLock for read-heavy, Arc<T> (no lock) for immutable-after-init.

Error Handling

  1. ? for propagation — never unwrap() in production. Acceptable only in tests, infallible ops with // SAFETY: comment, CLI main() with expect("reason").

  2. Error crates by context: library = thiserror (typed enums), application = anyhow (ergonomic chaining). Never mix: libs must not depend on anyhow.

  3. Error type design:

// ✅ Typed, matchable
#[derive(Debug, thiserror::Error)]
pub enum PathfinderError {
    #[error("file not found: {path}")]
    FileNotFound { path: PathBuf },
    #[error("AST parse failed: {0}")]
    ParseError(String),
    #[error(transparent)]
    Io(#[from] std::io::Error),
}

// ❌ Stringly-typed, unmatchable
fn do_thing() -> Result<(), String> { ... }

// ✅ Force callers to handle
#[must_use]
pub fn create_task(req: CreateTaskRequest) -> Result<Task, TaskError> { ... }

Async and Concurrency

  1. tokio runtime. #[tokio::main]/#[tokio::test]. tokio::spawn over std::thread::spawn. tokio::select! for racing futures.

  2. Cancellation safety: prefer tokio::sync::mpsc over broadcast. Document cancellation on async fns holding resources across .await. Use CancellationToken for shutdown.

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 121 lines · 0 tokens per session scan A b962634eeb5d

Subscribe to this mod's changes

rust-idioms is a skill published in the GitHub repository irahardianto/rugged-gemini (5 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,452 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories