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 agentmods add rules/wangqiqi/cursor-ai-rules/rust-advancedgit clone --depth 1 https://github.com/wangqiqi/cursor-ai-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/wangqiqi/cursor-ai-rules/rust-advanced)<a href="https://agentmods.dev/rules/wangqiqi/cursor-ai-rules/rust-advanced"><img src="https://agentmods.dev/badge/rules/wangqiqi/cursor-ai-rules/rust-advanced.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.02409 |
| Opus 5 | $0.00000 | $0.01205 |
| Sonnet 5 | $0.00000 | $0.00482 |
| Haiku 4.5 | $0.00000 | $0.00241 |
Grade A, and why
rust-advanced 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.
How it starts
The opening of the file, as written. The whole thing — 400 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust 高级实践
本文档是从 @rust-basics 分割出来的高级主题部分,涵盖测试策略、性能优化、安全实践和最佳实践。
Cargo.toml (工作区根)
[workspace] members = [ "crates/core", "crates/api", "crates/cli", "crates/utils", ]
[workspace.dependencies]
共享依赖版本
serde = "1.0" tokio = "1.0" anyhow = "1.0"
### 条件编译
```rust
// 使用条件编译处理平台差异
#[cfg(target_os = "linux")]
mod linux_specific {
pub fn get_os_info() -> String {
"Linux".to_string()
}
}
#[cfg(target_os = "macos")]
mod macos_specific {
pub fn get_os_info() -> String {
"macOS".to_string()
}
}
#[cfg(target_os = "windows")]
mod windows_specific {
pub fn get_os_info() -> String {
"Windows".to_string()
}
}
pub fn get_platform_info() -> String {
#[cfg(target_os = "linux")]
return linux_specific::get_os_info();
#[cfg(target_os = "macos")]
return macos_specific::get_os_info();
#[cfg(target_os = "windows")]
return windows_specific::get_os_info();
#[allow(unreachable_code)]
"Unknown".to_string()
}
🧪 测试策略
单元测试和集成测试
#[cfg(test)]
mod tests {
use super::*;
use std::sync::Arc;
// ✅ 推荐:单元测试
#[test]
fn test_user_creation() {
let username = "john_doe".to_string();
let email = "[email protected]".to_string();
let user = User::new(username.clone(), email.clone());
assert_eq!(user.username, username);
assert_eq!(user.email, email);
assert_eq!(user.id, 0); // 默认ID
assert!(user.created_at <= chrono::Utc::now());
}
#[test]
fn test_user_validation() {
// 有效用户
let user = User::new("john".to_string(), "[email protected]".to_string());
assert!(user.validate().is_ok());
// 无效用户名
let invalid_user = User::new("".to_string(), "[email protected]".to_string());
assert!(invalid_user.validate().is_err());
// 无效邮箱
let invalid_user2 = User::new("john".to_string(), "invalid-email".to_string());
assert!(invalid_user2.validate().is_err());
}
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.
- 3d ago First seen · 400 lines · 0 tokens per session scan A 8f6a3a02b4f8
rust-advanced is a cursor rule published in the GitHub repository wangqiqi/cursor-ai-rules (15 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,409 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
core
Core STT/TTS abstraction layer documentation.
rust-architect
PoolAI — Rust Architect workflow: runtime stack, MSYS2, target/ disk, pre-push checks, docs sync.
rust-module-refactor
Use when splitting Rust modules, moving tests, tightening visibility, or preserving facades during refactors.
cube-engine
Use when changing Rust puzzle state, moves, notation, scrambles, or validation.
ivolgaql-project
Общие принципы ИволгаQL (MVP, Rust, русский UX, TCP).
rust-native-architecture
Enforces native-first architecture and crate boundary rules for the nca workspace.