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/tools-and-config)<a href="https://agentmods.dev/rules/tyrchen/cursor-rust-rules/tools-and-config"><img src="https://agentmods.dev/badge/rules/tyrchen/cursor-rust-rules/tools-and-config/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/tools-and-config"><img src="https://agentmods.dev/badge/rules/tyrchen/cursor-rust-rules/tools-and-config.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.04960 |
| Opus 5.5 | $0.00000 | $0.01984 |
| Sonnet 5.5 | $0.00000 | $0.00992 |
| Haiku 4.5 | $0.00000 | $0.00496 |
Grade A, and why
tools-and-config 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 — 722 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🛠️ TOOLS AND CONFIGURATION BEST PRACTICES
TL;DR: Essential tools and configuration patterns for modern Rust applications, focusing on logging, configuration management, and templating.
🔍 TOOLS & CONFIGURATION STRATEGY
graph TD
Start["Application Setup"] --> ConfigType{"Configuration<br>Complexity?"}
ConfigType -->|Simple| EnvVars["Environment Variables"]
ConfigType -->|Complex| YAMLConfig["YAML Configuration"]
EnvVars --> Logging["Logging Setup"]
YAMLConfig --> ConfigValidation["Configuration Validation"]
ConfigValidation --> Logging
Logging --> StructuredLogging["Structured Logging"]
StructuredLogging --> LogRotation["Log Rotation"]
LogRotation --> Templating{"Template<br>Engine Needed?"}
Templating -->|Yes| MiniJinja["MiniJinja Templates"]
Templating -->|No| DataProcessing["Data Processing"]
MiniJinja --> DataProcessing
DataProcessing --> JSONPath["JSON Path Extraction"]
JSONPath --> Monitoring["Application Monitoring"]
Monitoring --> Production["Production Tools"]
style Start fill:#4da6ff,stroke:#0066cc,color:white
style YAMLConfig fill:#4dbb5f,stroke:#36873f,color:white
style StructuredLogging fill:#ffa64d,stroke:#cc7a30,color:white
style MiniJinja fill:#d94dbb,stroke:#a3378a,color:white
📊 LOGGING AND OBSERVABILITY
Tracing Ecosystem (Not env_logger)
- Always use
tracing- modern structured logging - Combine with
tracing-subscriberfor output formatting - File rotation with
tracing-appenderfor production - Structured logging with spans and events
# Cargo.toml - Tracing configuration
[dependencies]
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
chrono = { version = "0.4", features = ["serde"] }
Structured Logging Setup
use tracing::{info, error, warn, debug, span, Level};
use tracing_subscriber::{
fmt::{self, time::ChronoUtc},
layer::SubscriberExt,
util::SubscriberInitExt,
EnvFilter,
Registry,
};
use tracing_appender::{non_blocking, rolling};
pub fn init_logging(config: &LogConfig) -> Result<(), Box<dyn std::error::Error>> {
// Create file appender with rotation
let file_appender = rolling::daily(&config.log_dir, "app.log");
let (file_writer, _guard) = non_blocking(file_appender);
// Console formatting
let console_layer = fmt::layer()
.with_target(true)
.with_timer(ChronoUtc::rfc_3339())
.with_level(true)
.with_thread_ids(true)
.with_thread_names(true);
// File formatting (JSON for structured logs)
let file_layer = fmt::layer()
.json()
.with_timer(ChronoUtc::rfc_3339())
.with_writer(file_writer);
// Environment filter
let filter = EnvFilter::try_from_default_env()
.unwrap_or_else(|_| EnvFilter::new(&config.level));
Registry::default()
.with(filter)
.with(console_layer)
.with(file_layer)
.init();
Ok(())
}
// Usage in application code
#[tracing::instrument(skip(service), fields(user_id = %user_id))]
pub async fn process_user_registration(
user_id: &str,
service: &UserService,
) -> Result<User, ServiceError> {
let span = span!(Level::INFO, "user_registration", user_id = %user_id);
let _enter = span.enter();
info!("Starting user registration process");
let user = service.create_user(user_id).await.map_err(|e| {
error!("Failed to create user: {}", e);
e
})?;
info!(
user_id = %user.id,
email = %user.email,
"User registration completed successfully"
);
Ok(user)
}
// Contextual logging with structured fields
pub async fn handle_payment_processing(
order_id: &str,
amount: f64,
payment_method: &str,
) -> Result<PaymentResult, PaymentError> {
let span = span!(
Level::INFO,
"payment_processing",
order_id = %order_id,
amount = %amount,
payment_method = %payment_method
);
let _enter = span.enter();
info!("Processing payment");
match process_payment(order_id, amount, payment_method).await {
Ok(result) => {
info!(
transaction_id = %result.transaction_id,
status = %result.status,
"Payment processed successfully"
);
Ok(result)
}
Err(e) => {
error!(
error = %e,
"Payment processing failed"
);
Err(e)
}
}
}
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 · 722 lines · 0 tokens per session scan A 8ea3b25675de
tools-and-config 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 4,960 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
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
config-validation-and-normalization
Config validation and normalization responsibilities (defineConfig normalizes, the orm section schema validates and resolves paths, the loader reports per-section diagnostics).
control-plane-descriptors
Control plane descriptor and instance implementation patterns.