rust-development-standards

rust-development-standards is a cursor rule for Cursor from beettlle/pi-spine. It costs 0 tokens per session (5,319 once invoked), scanned A, original, MIT.

Coding standards for Rust 2021 projects, with guidance for safe ownership, error handling, dependencies, formatting, and linting. Rust is a compiled language designed for systems software with strict memory-safety checks.

In plain words
What is it for?
Use it to review Rust code, handle Result and Option values, choose references or ownership correctly, and verify changes with rustfmt, clippy, cargo build, and cargo test.
Why use it?
It helps avoid hidden failures, unnecessary copying, unsafe assumptions, and code that does not follow Rust's safety model.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/beettlle/pi-spine/rust-development-standards
Clone the repo
git clone --depth 1 https://github.com/beettlle/pi-spine

Made for: Cursor.

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-development-standards

README.md
[![agentmods](https://agentmods.dev/badge/rules/beettlle/pi-spine/rust-development-standards.svg)](https://agentmods.dev/rules/beettlle/pi-spine/rust-development-standards)
Your own site
<a href="https://agentmods.dev/rules/beettlle/pi-spine/rust-development-standards"><img src="https://agentmods.dev/badge/rules/beettlle/pi-spine/rust-development-standards.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 5,319 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.05319
Opus 5 $0.00000 $0.02660
Sonnet 5 $0.00000 $0.01064
Haiku 4.5 $0.00000 $0.00532

Measured 3d ago against content hash ce2beb5dd2c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rust-development-standards 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 3d 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.

.cursor/rules/rust-development-standards.mdc · 427 lines

How it starts

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

Persona: Rust Systems Engineer

  • Role: Systems/library author. Philosophy: Safety and clarity over cleverness; lean on the type system and the compiler.
  • Bias: Errors as values (Result/Option); no hidden panics in libraries; ownership by default; std/crates.io over custom code; rustfmt + clippy.

Rust Development Standards

Target: Rust 2021 edition (or 2024 where applicable).

For universal anti-patterns: See general-llm-anti-patterns.mdc.


Philosophy

  • Errors as values: Result/Option; propagate with ?; handle at boundaries; no silent failures.
  • Ownership by default: Prefer references/borrows; avoid unnecessary clone; no hidden panics in library code.
  • Std and crates.io: Prefer standard library and well-maintained crates over custom reimplementations.
  • Tooling: rustfmt, clippy; run cargo build / cargo test before claiming success.

Category 1: Error Handling

1.1 Handle Result/Option; Never Ignore (CRIT)

CRITICAL: Handle or propagate Result/Option; never ignore; propagate with context (map_err, .context(), or custom source).

❌ Bad: let _ = foo(), bar().unwrap() in library code ✅ Good: foo()? or foo().map_err(|e| Error::Context { source: e }); use anyhow::Context or thiserror at boundaries ⚠️ Why: Ignored errors hide bugs and make debugging impossible. 🔧 Fix: Use ? and add context at API boundaries; use typed errors (thiserror/anyhow). 📍 See: Rust Book ch 9; general-llm-anti-patterns.mdc section 5.3

Detect: let _ = on Result/IO, unwrap() in lib, bare ? at public API without context

1.2 Panic Discipline (CRIT)

CRITICAL: No unwrap()/expect() in library or public API code except with a one-line justification; document panics in # Panics.

❌ Bad: fn load(path: &Path) -> Config { ... unwrap() } in lib ✅ Good: fn load(path: &Path) -> Result<Config, Error> { ... }; in binaries, expect() only at boundaries with comment ⚠️ Why: Panics in libraries are not recoverable; callers cannot handle them. 🔧 Fix: Return Result/Option; use ?; document any remaining panics in doc comment. 📍 See: Rust Book ch 9; general-llm-anti-patterns.mdc section 5.3

Read the full file on GitHub · 427 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. 3d ago First seen · 427 lines · 0 tokens per session scan A ce2beb5dd2c6

Subscribe to this mod's changes

rust-development-standards is a cursor rule published in the GitHub repository beettlle/pi-spine (3 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,319 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-08-31.