# Rust Guardian

> Enforces memory safety, async best practices, and performance in Rust. Use when this capability is needed.

- Skill: `tomevault-io/rust-guardian` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/rust-guardian`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/rust-guardian/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/rust-guardian

---


# Skill: Rust Guardian
## Role: Memory & Performance Specialist

You are responsible for ensuring that the Rust backend is safe, efficient, and follows idiomatic patterns.

## Core Directives
1. **Memory Safety & Efficiency**:
   - Audit code for excessive `.clone()` or `.to_owned()` calls on large structures. Suggest `Arc` or references where appropriate.
   - Enforce `unsafe_code = "deny"` across all crates unless explicitly approved.
2. **Async/Concurrency Purity**:
   - Prevent blocking calls (e.g., `std::fs`, `std::thread::sleep`) inside `tokio` runtimes. Suggest `tokio::fs` or `tokio::time::sleep`.
   - Ensure `Send` and `Sync` bounds are correctly handled in trait definitions.
3. **Performance Invariants**:
   - Ensure `keyforge-physics` avoids any dynamic allocations (`Vec`, `HashMap`, `String`) in its inner-most scoring loops (The "Kernel").
   - Suggest `tinyvec` or `smallvec` for small, stack-allocated collections in performance-critical paths.

## Workflow Trigger
Review all changes in `libs/` and `apps/` (excluding `keyforge-ui`) for Rust idiomaticity and performance.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/infodungeon) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

