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 majiayu000/spellbook --skill rust-best-practicesgit clone --depth 1 https://github.com/majiayu000/spellbookWrote 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/majiayu000/spellbook/rust-best-practices)<a href="https://agentmods.dev/skills/majiayu000/spellbook/rust-best-practices"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/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/majiayu000/spellbook/rust-best-practices"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/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.00051 | $0.00610 |
| Opus 5.5 | $0.00020 | $0.00244 |
| Sonnet 5.5 | $0.00010 | $0.00122 |
| Haiku 4.5 | $0.00005 | $0.00061 |
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 2mo 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 — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust Best Practices Assistant
Core Principles
- Prefer safe Rust; use
unsafeonly when absolutely necessary and well-documented - Leverage the type system to prevent bugs at compile time
- Use
Result<T, E>for error handling, avoidpanic!in library code - Make illegal states unrepresentable through proper type design
Code Style
- Format all code with
rustfmt - Follow all
clippysuggestions (run withcargo clippy -- -W clippy::pedantic) - Use
snake_casefor variables and functions - Use
CamelCasefor types and traits - Use
SCREAMING_SNAKE_CASEfor constants
Memory & Ownership
- Prefer borrowing (
&T,&mut T) over ownership when possible - Use
Cow<str>for strings that might be borrowed or owned - Avoid unnecessary
.clone()- consider borrowing or restructuring - Use
Arc<T>for shared ownership across threads,Rc<T>for single-threaded
Error Handling
- Use
thiserrorfor defining library error types - Use
anyhowfor application-level error handling - Provide meaningful, actionable error messages
- Use
?operator for error propagation
Performance
- Avoid unnecessary heap allocations
- Prefer iterators over manual loops (zero-cost abstraction)
- Use
&strinstead ofStringfor function parameters when possible - Consider using
SmallVecfor small, stack-allocated vectors
Async Rust
- Use
tokioas the async runtime for most applications - Prefer
async fnover manualFutureimplementations - Avoid blocking operations in async contexts
- Use
tokio::spawnfor concurrent tasks
Testing
- Write unit tests in the same file using
#[cfg(test)]module - Use
#[should_panic]for testing panic behavior - Use
proptestorquickcheckfor property-based testing - Aim for meaningful test coverage, not just line coverage
Common Patterns
- Use the builder pattern for complex object construction
- Use
FromandIntotraits for type conversions - Implement
Defaultwhen a sensible default exists - Use
Option<T>instead of sentinel values
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.
- 2mo ago First seen · 62 lines · 51 tokens per session scan A 77402ffc4879
rust-best-practices is a skill published in the GitHub repository majiayu000/spellbook (301 stars, last pushed 7d ago), licensed MIT. It adds 51 tokens to every session and 610 once invoked, about $0.0002 per session on Opus 5.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-09-03.
rust-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rust-best-practicesmajiayu000/spellbook | Skill | 301 | 7d ago | MIT | A | 51 | Claude Code |
| Agent Browser AutomationPramodDutta/qaskills | Skill | 252 | 27d ago | MIT | A | 37 | Claude Code, Codex |
| architecture-auditorg2AI/ORG2 | Skill | 2.5k | 27d ago | AGPL-3.0 | A | 70 | Claude Code, Codex |
| rust-systemsiliaal/ai-skills | Skill | 46 | 2d ago | MIT | A | 59 | Claude Code |
| triz-analysisd-oit/rust-2026-template | Skill | 15 | yesterday | MIT | A | 79 | Claude Code, Codex |
| rust-conventionstmj-90/gaffer | Skill | 1 | yesterday | Apache-2.0 | A | 115 | Claude Code, Codex |
| sota-rustmartinholovsky/SOTA-skills | Skill | 31 | today | CC-BY-4.0 | A | 228 | Claude Code |