Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add JSK9999/ai-nexus --skill rust-best-practicesgit clone --depth 1 https://github.com/JSK9999/ai-nexusWrote 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/jsk9999/ai-nexus/rust-best-practices)<a href="https://agentmods.dev/skills/jsk9999/ai-nexus/rust-best-practices"><img src="https://agentmods.dev/badge/skills/jsk9999/ai-nexus/rust-best-practices/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/jsk9999/ai-nexus/rust-best-practices"><img src="https://agentmods.dev/badge/skills/jsk9999/ai-nexus/rust-best-practices.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.00025 | $0.03599 |
| Opus 5 | $0.00013 | $0.01800 |
| Sonnet 5 | $0.00005 | $0.00720 |
| Haiku 4.5 | $0.00003 | $0.00360 |
Grade A, and why
rust-best-practices 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 10d 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 — 555 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust Best Practices
A comprehensive guide to writing idiomatic, safe, and performant Rust code.
Overview
This skill provides best practices for Rust development across five key areas:
- Ownership & Borrowing - Memory safety without garbage collection
- Error Handling - Robust error management with Result and Option
- Async Patterns - Efficient concurrent programming with async/await
- Testing - Unit, integration, and property-based testing strategies
- Project Structure - Organizing Rust projects and workspaces
Default Configuration
🚀 ALWAYS USE RUST EDITION 2024 FOR NEW PROJECTS
[package]
name = "my-project"
version = "0.1.0"
edition = "2024"
rust-version = "1.85" # Minimum required version
For workspaces:
[workspace.package]
edition = "2024"
rust-version = "1.85"
[workspace]
resolver = "2"
members = ["crates/*"]
Why Edition 2024?
- ✅ Native async fn in traits (no more async-trait crate!)
- ✅ if let chains for cleaner pattern matching
- ✅ Return position impl Trait in traits (RPITIT)
- ✅ Improved type inference for closures and iterators
- ✅ Better const fn capabilities for compile-time computation
- ✅ Enhanced error messages with actionable suggestions
- ✅ Improved lifetime elision
- ✅ Better diagnostic attributes
See edition-2024.md for comprehensive Edition 2024 guide including:
- Key features and improvements
- Migration guide from Edition 2021
- Best practices and common patterns
- Performance optimizations
- Security considerations
Core Principles
1. Ownership & Borrowing
Rust's ownership system ensures memory safety at compile time. Follow these principles:
Ownership Rules:
- Each value has a single owner
- When the owner goes out of scope, the value is dropped
- Values can be moved or borrowed (immutably or mutably)
Best Practices:
// ✅ Good: Use references to avoid unnecessary moves
fn process_data(data: &Vec<u8>) {
// data is borrowed, not moved
println!("Processing {} bytes", data.len());
}
// ❌ Avoid: Taking ownership when borrowing suffices
fn process_data_bad(data: Vec<u8>) {
println!("Processing {} bytes", data.len());
// data is dropped here - caller can't use it anymore
}
// ✅ Good: Use mutable references for in-place modifications
fn append_data(buffer: &mut Vec<u8>, data: &[u8]) {
buffer.extend_from_slice(data);
}
// ✅ Good: Return owned values when transferring ownership
fn create_buffer(size: usize) -> Vec<u8> {
vec![0; size]
}
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 10d ago First seen · 555 lines · 25 tokens per session scan A d5b3481d2397
rust-best-practices is a skill published in the GitHub repository JSK9999/ai-nexus (19 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 25 tokens to every session and 3,599 once invoked, about $0.0001 per session on Opus 5. 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-08-30.
Other skills, from other repositories
rust-check
Run cargo check on the current Rust project to find compile errors.
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
rust-crate-ci
Load before editing any Rust crate in this repo (currently runners/swarm-sandbox-runner). Covers the mandatory local validation gate, common rustfmt/clippy pitfalls, and Windows-specific Rust correctness patterns that CI enforces but are hard to catch locally without a Windows toolchain.
Agent Browser Automation
Fast Rust-based headless browser automation CLI with Node.js fallback for AI agents, featuring navigation, clicking, typing, snapshots, and structured commands optimized for agent workflows.
rust-agent-handoff
Handoff protocol for the Rust multi-agent development team (rust-architect, rust-developer, rust-testing-engineer, rust-performance-engineer, rust-security-maintenance, rust-code-reviewer, rust-cicd-devops, rust-debugger, rust-critic). Use only when orchestrating subagents via structured YAML files in .local/handoff/.…
dcg
Destructive Command Guard - High-performance Rust hook for Claude Code that blocks dangerous commands before execution. SIMD-accelerated, modular pack system, whitelist-first architecture. Essential safety layer for agent workflows.