trove-lambda
/trove-lambda
AWS Lambda handler patterns with CDK infrastructure conventions. Auto-activates when working with Lambda handler or CDK files. Covers handler structure, SQS/SNS parsing, IPC patterns, Powertools logging, and CDK best practices. Use when: lambda handler; aws lambda; sqs handler; sns handler.
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 2
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 08.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- SKILL.md zawiera komentarze HTML (2). Nie widać ich w podglądzie Markdown, a model je czyta.
What it does and when to use it
AWS Lambda handler patterns with CDK infrastructure conventions. Auto-activates when working with Lambda handler or CDK files. Covers handler structure, SQS/SNS parsing, IPC patterns, Powertools logging, and CDK best practices. Use when: lambda handler; aws lambda; sqs handler; sns handler.
Original author description
AWS Lambda handler patterns with CDK infrastructure conventions. Auto-activates when working with Lambda handler or CDK files. Covers handler structure, SQS/SNS parsing, IPC patterns, Powertools logging, and CDK best practices. Use when: lambda handler; aws lambda; sqs handler; sns handler.
How it works
- Session Init
- Handler Structure
- SQS/SNS Event Parsing
- Logging
- IPC Pattern (Backend Communication)
- CDK Patterns
- AI Gotchas
SKILL.md preview
---
name: trove-lambda
description: "AWS Lambda handler patterns with CDK infrastructure conventions. Auto-activates when working with Lambda handler or CDK files. Covers handler structure, SQS/SNS parsing, IPC patterns, Powertools logging, and CDK best practices. Use when: lambda handler; aws lambda; sqs handler; sns handler."
---
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
<!-- Regenerate: bun run build:skills -->
## Session Init
This skill ships Trove conventions. Prefer existing project patterns over generic best practices when they conflict.
# AWS Lambda Conventions
## Handler Structure
```python
from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities.typing import LambdaContext
logger = Logger()
@logger.inject_lambda_context(log_event=True)
def handler(event: dict, context: LambdaContext) -> dict:
records = parse_event(event)
for record in records:
process_record(record)
return {"statusCode": 200}
```
## SQS/SNS Event Parsing
```python
def parse_sqs_event(event: dict) -> list[dict]:
return [json.loads(record["body"]) for record in event["Records"]]
def parse_sns_via_sqs(event: dict) -> list[dict]:
messages = []
for record in event["Records"]:
body = json.loads(record["body"])
message = json.loads(body["Message"])
messages.append(message)
return messages
```
## Logging
Follow the same logging rules as trove-python, plus:
- Use `@logger.inject_lambda_context(log_event=True)` on handlers
- Use `logger.append_keys()` for request-scoped context
- Use `logger.exception()` in error handlers (captures stack trace for Sentry)
## IPC Pattern (Backend Communication)
```python
async def call_backend(endpoint: str, payload: dict) -> dict:
async with httpx.AsyncClient() as client:
response = await client.post(
f"{BACKEND_URL}/api/ipc/{endpoint}",
json=payload,
headers={"Authorization": f"Bearer {IPC_TOKEN}"},
timeout=30.0,
)
response.raise_for_status()
return response.json()
```
## CDK Patterns
- One construct per Lambda function
- Use `PythonFunction` from `@aws-cdk/aws-lambda-python-alpha`
- Environment variables via CDK `environment` prop, secrets via Secrets Manager
- Set `memorySize`, `timeout`, and `reservedConcurrentExecutions`
## AI Gotchas
- **Cold starts**: Keep handler imports minimal; use lazy initialization
- **Timeout**: Default 3s is too low — set explicitly (30s for API, 300s for batch)
- **Event source**: Always validate event structure before processing
- **Idempotency**: SQS may deliver messages more than once — design for at-least-once
Versions
The database has no other skills named trove-lambda.
Identical content appears in 3 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version ee8275b3bd68 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90aws-serverless
Use when implementing production serverless workloads on AWS — writing Lambda handler code, wiring API Gateway / DynamoDB Streams / SQS / SNS event-driven flows, SAM or CDK deployment, or fixing cold starts. Triggers: 'write a Lambda function', 'SAM template', 'API Gateway +… - 100trove-cdk
AWS CDK (TypeScript) conventions for infrastructure as code. Auto-activates on CDK project files. Use when: cdk stack; aws cdk; infrastructure as code. - 100aws-serverless
Provides AWS serverless architecture patterns for Lambda, API Gateway, DynamoDB, SQS, and SAM/CDK. Use when working with AWS serverless files (serverless.yml, CDK stacks) or when the user mentions Lambda, API Gateway, serverless, or AWS SAM. - 100aws
AWS SDK integration for Node.js (v3) and Python (boto3). Core services: S3, Lambda, DynamoDB, SQS, SNS, CloudWatch, IAM. Configuration, credentials, and production patterns. USE WHEN: user mentions "AWS", "Amazon Web Services", "Lambda", "DynamoDB", "SQS", "SNS", "CloudWatch",… - 100powertools-lambda
Powertools for AWS Lambda is an open-source toolkit that adds structured JSON logging, X-Ray tracing, CloudWatch metrics (EMF), idempotency, batch processing, parameter fetching and API event handlers to Lambda functions in Python, TypeScript, Java and .NET. Use when a user… - 95serverless-aws
Patterns for AWS Lambda, DynamoDB, SQS, and Secrets Manager. Use when working on serverless AWS projects.