CLAUDE.md TemplatesCLAUDE.md Template
CLAUDE.md Template for Rust Axum + DynamoDB + AWS Cognito + AWS SDK Rust Native Driver (CLAUDE.md template)
A copyable CLAUDE.md template page for Rust Axum + DynamoDB + Cognito + AWS SDK Rust Native Driver.
CLAUDE.md templateRustAxumDynamoDBCognitoAWS SDK RustRust Web APIJWTIAMSecurityClaude Code
Target User
Rust backend developers building secure Axum-based APIs with DynamoDB and Cognito
Use Cases
- Scaffold a secure Axum API using DynamoDB as the datastore
- Integrate Cognito for authentication and authorization
- Provide a copyable CLAUDE.md template for Claude Code workflows
- Demonstrate production-ready security, testing, and deployment practices
Markdown Template
CLAUDE.md Template for Rust Axum + DynamoDB + AWS Cognito + AWS SDK Rust Native Driver (CLAUDE.md template)
Overview
CLAUDE.md template for Rust Axum + DynamoDB + AWS Cognito + AWS SDK Rust Native Driver provides a ready-to-paste CLAUDE.md block that guides Claude Code to generate, validate, and deploy a secure Rust Axum API backed by DynamoDB with Cognito authentication. It is stack-focused, concrete, and production-oriented.
Direct answer: This page delivers a complete, copyable CLAUDE.md template tailored for a Rust Axum service using DynamoDB and Cognito via the native AWS SDK for Rust.
When to Use This CLAUDE.md Template
- You are building a Rust Axum API that stores data in DynamoDB and authenticates users with AWS Cognito.
- You want a single, copyable CLAUDE.md template to guide Claude Code through architecture, file layout, and production rules.
- You need concrete, stack-specific implementation constraints Claude must follow and not deviate from.
Copyable CLAUDE.md Template
# CLAUDE.md
Project role
- You are a Rust backend engineer building a high-traffic Axum-based API. Your stack uses DynamoDB as the data store, AWS Cognito for authentication, and the AWS SDK Rust Native Driver for all AWS calls.
Architecture rules
- Use a hexagonal/ports-and-adapters approach: Axum routes → handlers → services (DynamoDB, Cognito) → infrastructure adapters.
- The core domain should be free of AWS specifics; DynamoDB/Cognito calls are through interfaces.
- All AWS SDK usage must use the official Rust native driver crates (aws-sdk-dynamodb, aws-sdk-cognitoidentityprovider).
- Favor async, idempotent operations with robust error handling and clear tracing.
- Do not perform long-lived blocking operations on the async runtime.
File structure rules
- src/main.rs: application bootstrap and router wiring.
- src/config.rs: environment configuration (region, Cognito user pool, client ID, DynamoDB table name).
- src/routes/mod.rs: route groups (e.g., /items, /auth).
- src/handlers/auth.rs: Cognito JWT validation and authentication middleware.
- src/handlers/items.rs: CRUD handlers for DynamoDB items.
- src/services/dynamodb.rs: DynamoDB client and data access methods.
- src/services/cognito.rs: Cognito token verification and user claims extraction.
- src/models/item.rs: data models for API payloads.
- tests/: integration and unit tests.
- Cargo.toml: dependencies including axum, serde, tokio, aws-sdk-dynamodb, aws-sdk-cognitoidentityprovider, aws-config, bcrypt/jwt if needed.
Authentication rules
- Validate JWTs issued by the Cognito User Pool using the JWKS endpoint; verify exp, iss, aud, andOverview
CLAUDE.md template for Rust Axum + DynamoDB + AWS Cognito + AWS SDK Rust Native Driver provides a ready-to-paste CLAUDE.md block that guides Claude Code to generate, validate, and deploy a secure Rust Axum API backed by DynamoDB with Cognito authentication. It is stack-focused, concrete, and production-oriented.
Direct answer: This page delivers a complete, copyable CLAUDE.md template tailored for a Rust Axum service using DynamoDB and Cognito via the native AWS SDK for Rust.
When to Use This CLAUDE.md Template
- You are building a Rust Axum API that stores data in DynamoDB and authenticates users with AWS Cognito.
- You want a single, copyable CLAUDE.md template to guide Claude Code through architecture, file layout, and production rules.
- You need concrete, stack-specific implementation constraints Claude must follow and not deviate from.
Copyable CLAUDE.md Template
# CLAUDE.md
Project role
- You are a Rust backend engineer building a high-traffic Axum-based API. Your stack uses DynamoDB as the data store, AWS Cognito for authentication, and the AWS SDK Rust Native Driver for all AWS calls.
Architecture rules
- Use a hexagonal/ports-and-adapters approach: Axum routes → handlers → services (DynamoDB, Cognito) → infrastructure adapters.
- The core domain should be free of AWS specifics; DynamoDB/Cognito calls are through interfaces.
- All AWS SDK usage must use the official Rust native driver crates (aws-sdk-dynamodb, aws-sdk-cognitoidentityprovider).
- Favor async, idempotent operations with robust error handling and clear tracing.
- Do not perform long-lived blocking operations on the async runtime.
File structure rules
- src/main.rs: application bootstrap and router wiring.
- src/config.rs: environment configuration (region, Cognito user pool, client ID, DynamoDB table name).
- src/routes/mod.rs: route groups (e.g., /items, /auth).
- src/handlers/auth.rs: Cognito JWT validation and authentication middleware.
- src/handlers/items.rs: CRUD handlers for DynamoDB items.
- src/services/dynamodb.rs: DynamoDB client and data access methods.
- src/services/cognito.rs: Cognito token verification and user claims extraction.
- src/models/item.rs: data models for API payloads.
- tests/: integration and unit tests.
- Cargo.toml: dependencies including axum, serde, tokio, aws-sdk-dynamodb, aws-sdk-cognitoidentityprovider, aws-config, bcrypt/jwt if needed.
Authentication rules
- Validate JWTs issued by the Cognito User Pool using the JWKS endpoint; verify exp, iss, aud, and