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.
curl -O https://raw.githubusercontent.com/irahardianto/rugged-gemini/main/.gemini/skills/rust-idioms/SKILL.mdgit clone --depth 1 https://github.com/irahardianto/rugged-geminiWrote 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.
[](https://agentmods.dev/skills/irahardianto/rugged-gemini/rust-idioms)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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
-
Prefer borrowing (
&T,&mut T) over cloning. Never.clone()to silence borrow checker without// CLONE:comment. UseCow<'_, T>when may/may not need ownership. Prefer&stroverString,&[T]overVec<T>in params. -
Minimize owned data in structs. References + lifetimes for short-lived. Owned types when struct outlives inputs.
-
Avoid unnecessary
Arc<Mutex<T>>: channels for one-directional,RwLockfor read-heavy,Arc<T>(no lock) for immutable-after-init.
Error Handling
-
?for propagation — neverunwrap()in production. Acceptable only in tests, infallible ops with// SAFETY:comment, CLImain()withexpect("reason"). -
Error crates by context: library =
thiserror(typed enums), application =anyhow(ergonomic chaining). Never mix: libs must not depend onanyhow. -
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
-
tokioruntime.#[tokio::main]/#[tokio::test].tokio::spawnoverstd::thread::spawn.tokio::select!for racing futures. -
Cancellation safety: prefer
tokio::sync::mpscover broadcast. Document cancellation on async fns holding resources across.await. UseCancellationTokenfor shutdown.
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.
- 6d ago First seen · 121 lines · 0 tokens per session scan A b962634eeb5d
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.
Other skills, from other repositories
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
omh-rust
This is a Hermes-native rust workflow skill.
bevy-ecs
Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the Time resource for frame-rate-independent motion. Use when building or debugging a Bevy game in Rust — when the user mentions…
rust-project
Modern Rust project architecture guide for 2025. Use when creating Rust projects (CLI, web services, libraries). Covers workspace structure, error handling, async patterns, and idiomatic Rust best practices.
gcs-rust-download-object-api
Fix "DownloadObjectRequest not found" error in google-cloud-storage Rust crate. Use when: (1) Trying to download objects from GCS using the Rust SDK, (2) Looking for a download request type in http::objects::download module, (3) Compile error about missing type. The downloadobject method uses GetObjectRequest from the…
azure-keyvault-secrets-rust
Client library for Azure Key Vault Secrets — secure storage for passwords, API keys, and other secrets.