Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides AWS Lambda integration patterns for Java with cold start optimization. Use when deploying Java functions to AWS Lambda, choosing between Micronaut and Raw Java approaches, optimizing cold starts below 1 second, configuring API Gateway or ALB integration, or implementing serverless Java applications. Triggers include "create lambda java", "deploy java lambda", "micronaut lambda aws", "java lambda cold start", "aws lambda java performance", "java serverless framework".
.claude/skills/giuseppe-trisciuoglio-aws-lambda-java-integration/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 42% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 33% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 73% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 33% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 60% | 0% |
Patterns for creating high-performance AWS Lambda functions in Java with optimized cold starts.
This skill provides complete patterns for AWS Lambda Java development, covering two main approaches:
Both approaches support API Gateway and ALB integration with production-ready configurations.
| Approach | Cold Start | Best For | Complexity | |----------|------------|----------|------------| | Micronaut | < 1s | Complex apps, DI needed, enterprise | Medium | | Raw Java | < 500ms | Simple handlers, minimal overhead | Low |
Validate: Confirm the approach fits your use case before proceeding.
my-lambda-function/
├── build.gradle (or pom.xml)
├── src/main/java/com/example/Handler.java
└── serverless.yml (or template.yaml)Validate: Verify project structure matches the template.
java@FunctionBean("my-function") public class MyFunction implements Function<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> { private final MyService service; public MyFunction(MyService service) { this.service = service; } @Override public APIGatewayProxyResponseEvent apply(APIGatewayProxyRequestEvent request) { // Process request return new APIGatewayProxyResponseEvent() .withStatusCode(200) .withBody("{\"message\": \"Success\"}"); } }
javapublic class MyHandler implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> { private static final MyService service = new MyService(); @Override public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent request, Context context) { return new APIGatewayProxyResponseEvent() .withStatusCode(200) .withBody("{\"message\": \"Success\"}"); } }
Validate: Run sam local invoke to verify handler works before deployment.
java// Initialize once, reuse across invocations private static final DynamoDbClient dynamoDb = DynamoDbClient.builder() .region(Region.US_EAST_1) .build(); // Avoid: Creating clients in handler (slow on every invocation)
java@Override public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent request, Context context) { try { return successResponse(process(request)); } catch (ValidationException e) { return errorResponse(400, e.getMessage()); } catch (Exception e) { context.getLogger().log("Error: " + e.getMessage()); return errorResponse(500, "Internal error"); } }
yamlservice: my-java-lambda provider: name: aws runtime: java21 memorySize: 512 timeout: 10 package: artifact: build/libs/function.jar functions: api: handler: com.example.Handler events: - http: path: /{proxy+} method: ANY
Validate: Run serverless deploy with --stage dev first.
yamlAWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: MyFunction: Type: AWS::Serverless::Function Properties: CodeUri: build/libs/function.jar Handler: com.example.Handler Runtime: java21 MemorySize: 512 Timeout: 10 Events: ApiEvent: Type: Api Properties: Path: /{proxy+} Method: ANY
Validate: Run sam validate before deploying.
For detailed guidance on specific topics:
Input:
Create a Java Lambda function using Micronaut to handle user REST APIProcess:
Output:
Input:
My Java Lambda has 3 second cold start, how do I optimize it?Process:
Output:
Input:
Configure CI/CD for Java Lambda with SAMProcess:
Output:
Version: 1.0.0
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 12,198 | 10,665 | -13% | 1 | 1 | 0% | 2,127 | 3,672 | +73% | 0 | 0 | — |
case-02 | pass→pass | 14,367 | 7,035 | -51% | 1 | 1 | 0% | 2,197 | 2,925 | +33% | 0 | 0 | — |
case-03 | pass→pass | 10,691 | 7,313 | -32% | 1 | 1 | 0% | 1,853 | 2,961 | +60% | 0 | 0 | — |
case-04 | fail→fail | 14,535 | 9,464 | -35% | 1 | 1 | 0% | 2,179 | 3,372 | +55% | 0 | 0 | — |
case-05 | pass→pass | 11,210 | 6,941 | -38% | 1 | 1 | 0% | 1,901 | 2,937 | +54% | 0 | 0 | — |
case-06 | pass→pass | 9,045 | 5,334 | -41% | 1 | 1 | 0% | 1,701 | 2,770 | +63% | 0 | 0 | — |
case-07 | pass→pass | 11,309 | 6,557 | -42% | 1 | 1 | 0% | 1,874 | 2,897 | +55% | 0 | 0 | — |
case-08 | pass→pass | 15,477 | 13,943 | -10% | 1 | 1 | 0% | 2,481 | 4,127 | +66% | 0 | 0 | — |
case-09 | fail→pass | 11,530 | 6,349 | -45% | 1 | 1 | 0% | 1,958 | 2,786 | +42% | 0 | 0 | — |
case-10 | pass→pass | 14,072 | 11,601 | -18% | 1 | 1 | 0% | 2,364 | 3,837 | +62% | 0 | 0 | — |
case-11 | fail→fail | 8,423 | 6,053 | -28% | 1 | 1 | 0% | 1,541 | 2,799 | +82% | 0 | 0 | — |
case-12 | pass→pass | 7,896 | 8,080 | +2% | 1 | 1 | 0% | 1,314 | 2,541 | +93% | 0 | 0 | — |
case-13 | pass→pass | 5,505 | 2,617 | -52% | 1 | 1 | 0% | 924 | 2,126 | +130% | 0 | 0 | — |
case-14 | pass→pass | 12,617 | 10,669 | -15% | 1 | 1 | 0% | 1,876 | 3,475 | +85% | 0 | 0 | — |
case-15 | pass→pass | 10,927 | 7,350 | -33% | 1 | 1 | 0% | 1,870 | 3,056 | +63% | 0 | 0 | — |
case-16 | pass→pass | 7,859 | 6,438 | -18% | 1 | 1 | 0% | 1,169 | 2,896 | +148% | 0 | 0 | — |
case-17 | pass→pass | 6,128 | 1,665 | -73% | 1 | 1 | 0% | 954 | 2,034 | +113% | 0 | 0 | — |
case-18 | pass→pass | 14,590 | 8,537 | -41% | 1 | 1 | 0% | 2,401 | 3,294 | +37% | 0 | 0 | — |
case-19 | fail→pass | 17,853 | 11,881 | -33% | 1 | 1 | 0% | 2,846 | 3,772 | +33% | 0 | 0 | — |
case-20 | pass→pass | 12,820 | 12,623 | -2% | 1 | 1 | 0% | 2,303 | 4,330 | +88% | 0 | 0 | — |
case-21 | pass→pass | 12,228 | 8,685 | -29% | 1 | 1 | 0% | 2,257 | 3,413 | +51% | 0 | 0 | — |
case-22 | pass→pass | 18,104 | 14,011 | -23% | 1 | 1 | 0% | 3,149 | 4,238 | +35% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.