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/axum)<a href="https://agentmods.dev/rules/tyrchen/cursor-rust-rules/axum"><img src="https://agentmods.dev/badge/rules/tyrchen/cursor-rust-rules/axum/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/axum"><img src="https://agentmods.dev/badge/rules/tyrchen/cursor-rust-rules/axum.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.09871 |
| Opus 5.5 | $0.00000 | $0.03948 |
| Sonnet 5.5 | $0.00000 | $0.01974 |
| Haiku 4.5 | $0.00000 | $0.00987 |
Grade A, and why
axum 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 — 1,434 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🌐 AXUM WEB FRAMEWORK STANDARDS
TL;DR: Comprehensive guidelines for building production-ready web applications with Axum, including AppConfig/AppState patterns, OpenAPI integration with utoipa, and scalable server architecture.
🏗️ AXUM APPLICATION ARCHITECTURE
graph TD
HTTP["HTTP Requests"] --> Router["Axum Router"]
Router --> Middleware["Middleware Stack"]
Middleware --> Handlers["Route Handlers"]
Handlers --> State["Application State"]
State --> Config["AppConfig<br>(via arc-swap)"]
State --> Database["Database Pool"]
State --> Services["Service Layer"]
Config --> Settings["Configuration Settings"]
Database --> Repositories["Repository Layer"]
Services --> BusinessLogic["Business Logic"]
Handlers --> Response["HTTP Response"]
Response --> OpenAPI["OpenAPI Docs<br>(utoipa)"]
Response --> Swagger["Swagger UI"]
style HTTP fill:#4da6ff,stroke:#0066cc,color:white
style Router fill:#4dbb5f,stroke:#36873f,color:white
style State fill:#ffa64d,stroke:#cc7a30,color:white
style Config fill:#d94dbb,stroke:#a3378a,color:white
style OpenAPI fill:#4dbbbb,stroke:#368787,color:white
🎯 AXUM VERSION AND SETUP
Axum 0.8+ Requirements
- Use Axum 0.8 or later - leverages latest async patterns
- Path parameters with
{param}syntax - more intuitive than:param - Structured router organization - group related endpoints
- OpenAPI integration with utoipa for documentation
- AppState pattern with arc-swap for hot-reloadable configuration
📦 AXUM DEPENDENCIES
# Cargo.toml - Required dependencies for Axum applications
[dependencies]
# Core Axum
axum = { version = "0.8", features = ["macros", "multipart"] }
tokio = { version = "1.45", features = ["macros", "rt-multi-thread", "net", "fs", "time", "sync", "signal"] }
tower = { version = "0.5", features = ["full"] }
tower-http = { version = "0.6", features = ["cors", "trace", "compression", "auth", "limit"] }
http = "1.0"
# Configuration management with hot-reload
arc-swap = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# OpenAPI and documentation
utoipa = { version = "5.0", features = ["axum_extras", "chrono", "uuid"] }
utoipa-axum = "0.2"
utoipa-swagger-ui = { version = "9.0", features = ["axum"] }
# Error handling and validation
anyhow = "1.0"
thiserror = "2.0"
validator = { version = "0.18", features = ["derive"] }
# Utilities
uuid = { version = "1.17", features = ["v4", "v7", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
# Logging and tracing
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "chrono"] }
# Database (if needed)
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "uuid", "chrono", "time", "json"] }
# HTTP client
reqwest = { version = "0.12", features = ["rustls-tls", "json", "stream", "multipart"] }
[dev-dependencies]
axum-test = "15.0"
tower-test = "0.4"
tempfile = "3.0"
wiremock = "0.6"
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 · 1,434 lines · 0 tokens per session scan A 2ab0863fe858
axum 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 9,871 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
Rules for writing Rust services at PostHog. Focuses on writing async Rust with Tokio and encoding general Rust best practices from the Rust book and docs.
actix-web
Definitive guidelines for building high-performance, maintainable, and secure web applications with actix-web 4, focusing on modern Rust best practices.
rocket
Definitive guidelines for building robust, performant, and maintainable backend services with Rocket 0.5+, focusing on modern Rust async patterns, API design, and testing.
axum
Comprehensive best practices for Axum 0.8+ development with WebSocket support.
core
Core STT/TTS abstraction layer documentation.
rust-hexagonal
Règles Rust Architecture Hexagonale avec gRPC (tonic).