agent-browser-automati…
Automate browser interactions for development testing using Puppeteer MCP
Scaffold production-ready Rust Axum web server with modern async patterns, dependency injection, and comprehensive testing setup
How it fires
How this command gets triggered: by you, by Claude, or both.
/scaffold-rust-axumContext preview
What this command does when you run it.
Scaffold production-ready Rust Axum web server with modern async patterns, dependency injection, and comprehensive testing setup
allowed-tools: Write, Bash(cargo:*), Bash(mkdir:*), Bash(cd:*), Bash(gdate:*), Bash(jq:*), Bash(pwd:*), Bash(eza:*), Bash(fd:*) name: "Scaffold Rust Axum" description: "Scaffold production-ready Rust Axum web server with modern async patterns, dependency injection, and comprehensive testing setup" author: "wcygan" tags: ["scaffold","rust"] version: "1.0.0" created_at: "2025-07-14T00:00:00Z" updated_at: "2025-07-14T00:00:00Z"
STEP 1: Initialize session state and validate prerequisites
# Initialize scaffold session state
echo '{
"sessionId": "'$SESSION_ID'",
"projectName": "'$ARGUMENTS'",
"timestamp": "'$(gdate -Iseconds 2>/dev/null || date -Iseconds)'",
"phase": "initialization",
"components": [],
"dependencies": {}
}' > /tmp/scaffold-rust-axum-$SESSION_ID.jsonSTEP 2: Project structure creation with modern Rust patterns
TRY:
**Modern Rust Axum Project Structure:**
$ARGUMENTS/
├── Cargo.toml # Workspace configuration
├── .gitignore # Comprehensive Rust gitignore
├── README.md # Concise project documentation
├── docker-compose.yml # Development services (Postgres, DragonflyDB)
├── src/
│ ├── main.rs # Application entry point
│ ├── lib.rs # Library interface
│ ├── config/ # Configuration management
│ │ ├── mod.rs
│ │ └── database.rs
│ ├── handlers/ # HTTP request handlers
│ │ ├── mod.rs
│ │ ├── health.rs
│ │ └── api/
│ ├── models/ # Data models and types
│ │ └── mod.rs
│ ├── services/ # Business logic layer
│ │ └── mod.rs
│ ├── middleware/ # Custom middleware
│ │ └── mod.rs
│ └── utils/ # Utility functions
│ └── mod.rs
├── tests/ # Integration tests
│ ├── common/
│ │ └── mod.rs
│ └── integration_test.rs
└── benches/ # Performance benchmarks
└── api_bench.rs**Cargo.toml with Modern Dependencies:**
[package]
name = "$ARGUMENTS"
version = "0.1.0"
edition = "2021"
rust-version = "1.70"
authors = ["Your Name <your.email@example.com>"]
description = "Production-ready Axum web server"
license = "MIT OR Apache-2.0"
repository = "https://github.com/yourusername/$ARGUMENTS"
keywords = ["axum", "web", "api", "async"]
categories = ["web-programming::http-server"]
[dependencies]
# Core web framework
axum = { version = "0.7", features = ["macros", "json", "query", "form"] }
tokio = { version = "1.0", features = ["full"] }
tower = { version = "0.4", features = ["util", "timeout", "load-shed", "limit"] }
tower-http = { version = "0.5", features = ["add-extension", "cors", "compression-gzip", "trace"] }
hyper = { version = "1.0", features = ["full"] }
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# Database (Postgres focus)
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "uuid", "chrono", "json"] }
uuid = { version = "1.0", features = ["v4", "serde"] }
# Configuration
config = "0.14"
envconfig = "0.10"
# Observability
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
tracing-opentelemetry = "0.22"
opentelemetry = "0.21"
# Error handling
anyhow = "1.0"
thiserror = "1.0"
# Security
argon2 = "0.5"
jsonwebtoken = "9.0"
# Time
chrono = { version = "0.4", features = ["serde"] }
[dev-dependencies]
# Testing
tokio-test = "0.4"
axum-test = "14.0"
httpc-test = "0.1"
# Benchmarking
criterion = { version = "0.5", features = ["html_reports"] }
[[bench]]
name = "api_bench"
harness = false
[profile.dev]
opt-level = 0
debug = true
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
panic = "abort"
[profile.test]
opt-level = 1STEP 3: Core application implementation with dependency injection
**Main Application (src/main.rs):**
//! Production-ready Axum web server with modern async patterns
use axum::{
extract::State,
response::Html,
routing::{get, post},
Json, Router,
};
use std::net::SocketAddr;
use tower::ServiceBuilder;
use tower_http::{
cors::CorsLayer,
compression::CompressionLayer,
trace::TraceLayer,
};
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
mod config;
mod handlers;
mod middleware;
mod models;
mod services;
mod utils;
use config::AppConfig;
#[derive(Clone)]
pub struct AppState {
config: AppConfig,
// Add database pool, redis client, etc.
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Initialize tracing
tracing_subscriber::registry()
.with(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "$ARGUMENTS=debug,tower_http=debug".into()),
)
.with(tracing_subscriber::fmt::layer())
.init();
// Load configurationA lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.
Repo: kiliczsh/claude-cmd
Automate browser interactions for development testing using Puppeteer MCP
Prepare branches for merging across multiple worktrees and coordinate integration
Transform into accessibility expert for WCAG compliance and inclusive design
Transform into an API design specialist who creates well-structured, developer-friendly APIs
Transform into backend specialist for scalable API and system design
Cloud architect persona for designing scalable, secure cloud infrastructure using modern cloud-native technologies