Review handler
Skill lep511/claude-rust-lambda-plugin/skills/review-handler
Review a Rust Lambda handler for AWS best practices, correctness, and performance. Use when the user wants feedback on their handler code, wants to check compliance with AWS guidelines, or is preparing to deploy and wants a pre-flight check.From its SKILL.md
npx -y skills add lep511/claude-rust-lambda-plugin --skill review-handlerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.7 KB, as published. Nobody here has run it
AWS Lambda Rust — Handler Review
Review the provided Rust Lambda handler code against AWS official best practices.
Input
The user should provide their handler code in $ARGUMENTS or paste it in the conversation.
If no code is provided, ask the user to share their main.rs or handler file.
Review checklist
Evaluate the code against each of the following categories. For each issue found, show the problematic code and suggest the corrected version.
1. Handler structure
- Uses
async fnfor the handler - Handler is registered with
service_fninsidemain() -
#[tokio::main]macro is present onmain() - Entry point calls
run(service_fn(function_handler)).await - Handler signature matches:
async fn name(event: LambdaEvent<T>) -> Result<U, Error> - Output type
Uimplementsserde::Serialize
2. Separation of concerns
- Handler function contains only orchestration logic — business logic is in helper functions
- Helper functions are independently unit-testable
3. SDK client initialization
- AWS SDK clients (S3, DynamoDB, etc.) are initialized outside the handler for shared state
- Clients are NOT re-initialized on every invocation (performance anti-pattern)
- If shared state is used, the closure captures the client correctly with
move
4. Environment variables
- All resource names (bucket names, table names, queue URLs) come from
env::var() - No hard-coded AWS resource ARNs or names
-
env::var()errors are handled gracefully (not unwrapped without a message)
5. Error handling
- No bare
.unwrap()on fallible operations in production paths - The
?operator is used to propagate errors - Errors return
Err(Error)— they will be logged to CloudWatch automatically
6. Dependencies (Cargo.toml)
- Only necessary SDK crates are imported (minimize package size)
- No unused dependencies
- Layers are NOT used for Rust dependencies (anti-pattern — include everything in the binary)
7. Safety and idempotency
- No recursive Lambda invocations (function invoking itself)
- No use of non-documented internal Lambda APIs
- Function handles duplicate events correctly (idempotent behavior)
- No sensitive user data stored in the execution environment between invocations
8. Logging
- Logging uses
println!(basic) ortracingcrate (recommended for structured logs) - If using
tracing: subscriber is initialized inmain()beforerun() - Log levels are appropriate (
infofor normal flow,errorfor failures) - ANSI color codes are disabled for CloudWatch:
.with_ansi(false) - Timestamps are disabled (CloudWatch adds ingestion time):
.without_time()
9. HTTP handlers (if applicable)
- Uses
lambda_httpcrate for unified HTTP support (preferred over manualApiGatewayProxyResponse) - Does NOT import
lambda_runtimeseparately when usinglambda_http - Feature flags are used in
aws_lambda_eventsto reduce compilation time
10. Runtime and deployment
-
Cargo.tomlspecifies correctedition - The deployment will use
--runtime provided.al2023
Output format
Provide:
- Summary: overall assessment (Ready / Needs minor fixes / Needs significant changes)
- Issues found: for each problem, show affected code + suggested fix
- Strengths: patterns done correctly
- Next step: recommend
/rust-lambda:buildif ready, or list items to fix first