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.
git clone --depth 1 https://github.com/tyrchen/cursor-rust-rulesWrote 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/rules/tyrchen/cursor-rust-rules/configuration)<a href="https://agentmods.dev/rules/tyrchen/cursor-rust-rules/configuration"><img src="https://agentmods.dev/badge/rules/tyrchen/cursor-rust-rules/configuration/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/rules/tyrchen/cursor-rust-rules/configuration"><img src="https://agentmods.dev/badge/rules/tyrchen/cursor-rust-rules/configuration.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.03717 |
| Opus 5.5 | $0.00000 | $0.01487 |
| Sonnet 5.5 | $0.00000 | $0.00743 |
| Haiku 4.5 | $0.00000 | $0.00372 |
Grade A, and why
configuration 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 1mo 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 — 558 lines — stays where its author put it; the contents beside it link to each section on GitHub.
⚙️ RUST CONFIGURATION MANAGEMENT
TL;DR: Comprehensive patterns for configuration management in Rust applications, including multi-format parsing, validation, hot-reloading, and environment-based overrides.
🔍 CONFIGURATION STRATEGY
graph TD
Start["Configuration Needs"] --> Format{"Configuration<br>Format?"}
Format -->|Single| SingleFormat["Single Format Parsing"]
Format -->|Multiple| MultiFormat["Multi-Format Support"]
SingleFormat --> Validation["Configuration Validation"]
MultiFormat --> Validation
Validation --> Environment["Environment Overrides"]
Environment --> Runtime{"Runtime<br>Updates?"}
Runtime -->|Static| StaticConfig["Static Configuration"]
Runtime -->|Dynamic| HotReload["Hot Reloading"]
StaticConfig --> Testing["Configuration Testing"]
HotReload --> Watching["File System Watching"]
Watching --> AtomicUpdate["Atomic Updates"]
AtomicUpdate --> Testing
Testing --> Production["Production Configuration"]
style Start fill:#4da6ff,stroke:#0066cc,color:white
style MultiFormat fill:#4dbb5f,stroke:#36873f,color:white
style HotReload fill:#ffa64d,stroke:#cc7a30,color:white
style AtomicUpdate fill:#d94dbb,stroke:#a3378a,color:white
🎯 CONFIGURATION PRINCIPLES
Multi-Format Configuration Support
use figment::{Figment, providers::{Format, Yaml, Toml, Json, Env}};
use serde::{Deserialize, Serialize};
use validator::{Validate, ValidationError};
// ✅ Configuration structure with validation
#[derive(Debug, Clone, Serialize, Deserialize, Validate)]
#[serde(rename_all = "snake_case")]
pub struct AppConfig {
#[validate(length(min = 1, max = 100))]
pub name: String,
#[validate(range(min = 1, max = 65535))]
pub port: u16,
#[serde(default = "default_host")]
#[validate(length(min = 1))]
pub host: String,
#[serde(default)]
pub features: Vec<String>,
#[validate(nested)]
pub database: DatabaseConfig,
#[serde(default)]
#[validate(nested)]
pub logging: LoggingConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize, Validate)]
pub struct DatabaseConfig {
#[validate(url)]
pub url: String,
#[validate(range(min = 1, max = 1000))]
#[serde(default = "default_pool_size")]
pub pool_size: u32,
#[serde(default = "default_timeout")]
pub timeout_seconds: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Validate)]
pub struct LoggingConfig {
#[serde(default = "default_log_level")]
pub level: String,
#[serde(default)]
pub json_format: bool,
}
// Default value functions
fn default_host() -> String { "0.0.0.0".to_string() }
fn default_pool_size() -> u32 { 10 }
fn default_timeout() -> u64 { 30 }
fn default_log_level() -> String { "info".to_string() }
impl AppConfig {
/// Load configuration from multiple sources with precedence:
/// 1. Environment variables (highest priority)
/// 2. config.yaml file
/// 3. config.toml file
/// 4. Default values (lowest priority)
pub fn load() -> Result<Self, ConfigError> {
let config = Figment::new()
.merge(Toml::file("config.toml"))
.merge(Yaml::file("config.yaml"))
.merge(Json::file("config.json"))
.merge(Env::prefixed("APP_"))
.extract()?;
// Validate the configuration
config.validate()
.map_err(ConfigError::Validation)?;
Ok(config)
}
/// Load from a specific file path
pub fn from_file<P: AsRef<std::path::Path>>(path: P) -> Result<Self, ConfigError> {
let path = path.as_ref();
let extension = path.extension()
.and_then(|ext| ext.to_str())
.ok_or_else(|| ConfigError::UnsupportedFormat("Unknown file extension".to_string()))?;
let figment = match extension.to_lowercase().as_str() {
"yaml" | "yml" => Figment::new().merge(Yaml::file(path)),
"toml" => Figment::new().merge(Toml::file(path)),
"json" => Figment::new().merge(Json::file(path)),
ext => return Err(ConfigError::UnsupportedFormat(ext.to_string())),
};
let config = figment
.merge(Env::prefixed("APP_"))
.extract()?;
config.validate()
.map_err(ConfigError::Validation)?;
Ok(config)
}
}
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.
- 1mo ago First seen · 558 lines · 0 tokens per session scan A 46c7925142cb
configuration is a cursor rule published in the GitHub repository tyrchen/cursor-rust-rules (27 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,717 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-30.
Other cursor rules, from other repositories
rust-module-refactor
Use when splitting Rust modules, moving tests, tightening visibility, or preserving facades during refactors.
rust-architect
PoolAI — Rust Architect workflow: runtime stack, MSYS2, target/ disk, pre-push checks, docs sync.
table-of-contents-standard
Standard section ordering and TOC format for Verus source files.
arc-deref-pattern
When implementing parallel (Mt) algorithms in Verus, do NOT assume.
wrap-vs-specify
When to use externaltypespecification vs wrapper struct for Verus specs.
core
Core STT/TTS abstraction layer documentation.