Rust + Axum + SQLx

Developer Toolsclaude-md-templatesproject_nameone-line descriptionauth_approach

Rust has strict idioms. 'No unwrap() in production' and 'compile-time checked queries' are constraints Claude can enforce consistently, producing code that compiles cleanly.

Prompt
# 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

{{project_name}}{{one-line description}}{{auth_approach}}

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 OPTIMIZE

AI Optimization

One-click improvement with structure analysis and pattern suggestions.

VERSION DIFF

Version History

Track every edit. Compare versions side-by-side with word-level diffs.

ORGANIZE
Development
Code Review
Testing
Marketing

Folders & Tags

Organize your library with nested folders, tags, and drag-and-drop.

MCP
$ npm i -g @promptingbox/mcp
Claude · Cursor · ChatGPT

Use 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.