Rust + Axum + SQLx
Rust has strict idioms. 'No unwrap() in production' and 'compile-time checked queries' are constraints Claude can enforce consistently, producing code that compiles cleanly.
# CLAUDE.md ## Project Overview {{project_name}} — {{one-line description}} ## Tech Stack - Language: Rust (latest stable) - Web framework: Axum 0.7+ - Database: PostgreSQL via SQLx (compile-time checked queries) - Serialization: serde + serde_json - Error handling: thiserror + anyhow - Auth: {{auth_approach}} - Tracing: tracing + tracing-subscriber ## Commands \`\`\`bash cargo run # Dev server cargo test # Run tests cargo clippy -- -D warnings # Lint sqlx migrate run # Apply migrations sqlx prepare # Prepare offline query cache \`\`\` ## Directory Structure \`\`\` src/ ├── main.rs # Server setup + routing ├── routes/ # Axum handler functions ├── models/ # Database models (FromRow) ├── services/ # Business logic ├── extractors/ # Custom Axum extractors ├── error.rs # App error type + IntoResponse └── config.rs # Environment config migrations/ # SQLx migrations \`\`\` ## Conventions - Use typed extractors (Json<T>, Path<T>, Query<T>) - Custom AppError type that implements IntoResponse - All DB queries via sqlx::query_as! (compile-time checked) - Use Arc<AppState> for shared state - Prefer &str over String in function parameters - No unwrap() in production code — use ? operator - Run \`sqlx prepare\` before committing if queries changed
Variables to customize
Why this prompt works
Rust has strict idioms. 'No unwrap() in production' and 'compile-time checked queries' are constraints Claude can enforce consistently, producing code that compiles cleanly.
What you get when you save this prompt
Your workspace unlocks powerful tools to iterate and improve.
AI Optimization
One-click improvement with structure analysis and pattern suggestions.
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
$ npm i -g @promptingbox/mcpUse Everywhere
Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.
Your prompts, organized
Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.