Agent skill

AWS Lambda Python Integration

by giuseppe-trisciuoglio in giuseppe-trisciuoglio/developer-kit

Provides AWS Lambda integration patterns for Python with cold start optimization.

MITAuto-check: notesBackend & APIs

Install AWS Lambda Python Integration

skills CLI
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-python-integration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install giuseppe-trisciuoglio/developer-kit aws-lambda-python-integration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/developer-kit-python/skills/aws-lambda-python-integration .claude/skills/aws-lambda-python-integration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
aws-lambda-python-integration
GitHub stars
355
Token cost
~2.4k tokens
SKILL.md length
675 words
Files
5 (incl. references)
Skills in repo
117
Repo updated
First seen
Licence
MIT

At a glance

Provides AWS Lambda integration patterns for Python with cold start optimization.

  • Works in 3 steps: Choose Your Approach → Project Structure → Implementation Examples
  • Deploying Python functions to AWS Lambda
  • SKILL.md covers Overview, When to Use, Instructions and Core Concepts, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

AWS Lambda Python Integration is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides AWS Lambda integration patterns for Python with cold start optimization. Use when deploying Python functions to AWS Lambda, choosing between AWS Chalice and raw Python approaches, optimizing cold starts, configuring API Gateway or ALB integration, or implementing serverless Python applications. Triggers include "create lambda python", "deploy python lambda", "chalice lambda aws", "python lambda cold start", "aws lambda python performance", "python serverless framework".

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/chalice-lambda.md`, `references/raw-python-lambda.md` and `references/serverless-deployment.md`).

It sits in Backend & APIs, covering Serverless, Microservices and Third-party API integration. It works with Python, AWS Lambda and Amazon Web Services. The repository describes itself as: Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI. The licence is MIT.

When your agent uses it

  • Deploying Python functions to AWS Lambda
  • Choosing between AWS Chalice and raw Python approaches
  • Optimizing cold starts
  • Configuring API Gateway

Example prompts

  • “create lambda python”
  • “deploy python lambda”
  • “chalice lambda aws”
  • “/aws-lambda-python-integration”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Glob, Grep

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Choose Your Approach
  2. Project Structure
  3. Implementation Examples

What it can do on your machine

Read from SKILL.md and the folder at commit fe73fb3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python, yaml and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

AWS Lambda Python Integration loads about 2.4k tokens when it runs, and up to ~18k if it reads all its reference files. Until then it costs about 128 tokens; SKILL.md has 675 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~128
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~18k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Glob, Grep

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from giuseppe-trisciuoglio/developer-kit at commit fe73fb3, republished under its MIT licence (© giuseppe-trisciuoglio). 675 words, ~2,432 tokens.

Download SKILL.mdSave it as .claude/skills/aws-lambda-python-integration/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
aws-lambda-python-integration
description
Provides AWS Lambda integration patterns for Python with cold start optimization. Use when deploying Python functions to AWS Lambda, choosing between AWS Chalice and raw Python approaches, optimizing cold starts, configuring API Gateway or ALB integration, or implementing serverless Python applications. Triggers include "create lambda python", "deploy python lambda", "chalice lambda aws", "python lambda cold start", "aws lambda python performance", "python serverless framework".
allowed-tools
Read, Write, Edit, Bash, Glob, Grep

AWS Lambda Python Integration

Patterns for creating high-performance AWS Lambda functions in Python with optimized cold starts and clean architecture.

Overview

AWS Lambda Python integration with two approaches: AWS Chalice (full-featured framework) and Raw Python (minimal overhead). Both support API Gateway/ALB integration with production-ready configurations.

When to Use

Use this skill when:

  • Creating new Lambda functions in Python
  • Migrating existing Python applications to Lambda
  • Optimizing cold start performance for Python Lambda
  • Choosing between framework-based and minimal Python approaches
  • Configuring API Gateway or ALB integration
  • Setting up deployment pipelines for Python Lambda

Instructions

1. Choose Your Approach
ApproachCold StartBest ForComplexity
AWS Chalice< 200msREST APIs, rapid development, built-in routingLow
Raw Python< 100msSimple handlers, maximum control, minimal dependenciesLow
2. Project Structure
AWS Chalice Structure
my-chalice-app/
├── app.py                    # Main application with routes
├── requirements.txt          # Dependencies
├── .chalice/
│   ├── config.json          # Chalice configuration
│   └── deploy/              # Deployment artifacts
├── chalicelib/              # Additional modules
│   ├── __init__.py
│   └── services.py
└── tests/
    └── test_app.py
Raw Python Structure
my-lambda-function/
├── lambda_function.py       # Handler entry point
├── requirements.txt         # Dependencies
├── template.yaml            # SAM/CloudFormation template
└── src/                     # Additional modules
    ├── __init__.py
    ├── handlers.py
    └── utils.py
3. Implementation Examples

See the References section for detailed implementation guides. Quick examples:

AWS Chalice:

python
from chalice import Chalice
app = Chalice(app_name='my-api')

@app.route('/')
def index():
    return {'message': 'Hello from Chalice!'}

Raw Python:

python
def lambda_handler(event, context):
    return {
        'statusCode': 200,
        'body': json.dumps({'message': 'Hello from Lambda!'})
    }

Core Concepts

Cold Start Optimization

Key strategies:

  1. Initialize at module level - Persists across warm invocations
  2. Use lazy loading - Defer heavy imports until needed
  3. Cache boto3 clients - Reuse connections between invocations

See Raw Python Lambda for detailed patterns.

Connection Management

Create clients at module level and reuse:

python
_dynamodb = None

def get_table():
    global _dynamodb
    if _dynamodb is None:
        _dynamodb = boto3.resource('dynamodb').Table('my-table')
    return _dynamodb
Environment Configuration
python
class Config:
    TABLE_NAME = os.environ.get('TABLE_NAME')
    DEBUG = os.environ.get('DEBUG', 'false').lower() == 'true'

    @classmethod
    def validate(cls):
        if not cls.TABLE_NAME:
            raise ValueError("TABLE_NAME required")

Best Practices

Memory and Timeout Configuration
  • Memory: Start with 256MB for simple handlers, 512MB for complex operations
  • Timeout: Set based on expected processing time
    • Simple handlers: 3-5 seconds
    • API with DB calls: 10-15 seconds
    • Data processing: 30-60 seconds
Dependencies

Keep requirements.txt minimal:

txt
# Core AWS SDK - always needed
boto3>=1.35.0

# Only add what you need
requests>=2.32.0  # If calling external APIs
pydantic>=2.5.0   # If using data validation
Error Handling

Return proper HTTP codes with request ID:

python
def lambda_handler(event, context):
    try:
        result = process_event(event)
        return {'statusCode': 200, 'body': json.dumps(result)}
    except ValueError as e:
        return {'statusCode': 400, 'body': json.dumps({'error': str(e)})}
    except Exception as e:
        print(f"Error: {str(e)}")  # Log to CloudWatch
        return {'statusCode': 500, 'body': json.dumps({'error': 'Internal error'})}

See Raw Python Lambda for structured error patterns.

Logging

Use structured logging for CloudWatch Insights:

python
import logging, json
logger = logging.getLogger()
logger.setLevel(logging.INFO)

# Structured log
logger.info(json.dumps({
    'eventType': 'REQUEST',
    'requestId': context.aws_request_id,
    'path': event.get('path')
}))

See Raw Python Lambda for advanced patterns.

Deployment Options

Quick Start

Validation Checkpoint: Always run serverless print or sam validate before deploying to catch configuration errors early.

Serverless Framework:

yaml
# serverless.yml
service: my-python-api
provider:
  name: aws
  runtime: python3.12  # or python3.11
functions:
  api:
    handler: lambda_function.lambda_handler
    events:
      - http:
          path: /{proxy+}
          method: ANY

AWS SAM:

yaml
# template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
  ApiFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: ./
      Handler: lambda_function.lambda_handler
      Runtime: python3.12  # or python3.11
      Events:
        ApiEvent:
          Type: Api
          Properties:
            Path: /{proxy+}
            Method: ANY

AWS Chalice:

bash
chalice new-project my-api
cd my-api
chalice local 8080  # Test locally before deploying
chalice deploy --stage dev

Validation Checkpoint: Test locally with chalice local or sam local invoke before deploying to production.

For complete deployment configurations including CI/CD, environment-specific settings, and advanced SAM/Serverless patterns, see Serverless Deployment.

Constraints and Warnings

Lambda Limits
  • Deployment package: 250MB unzipped maximum (50MB zipped)
  • Memory: 128MB to 10GB
  • Timeout: 15 minutes maximum
  • Concurrent executions: 1000 default (adjustable)
  • Environment variables: 4KB total size
Python-Specific Considerations
  • Cold start: Python has excellent cold start performance; avoid heavy imports at module level
  • Dependencies: Keep requirements.txt minimal; use Lambda Layers for shared dependencies
  • Native dependencies: Must be compiled for Amazon Linux 2 (x86_64 or arm64)
Show full SKILL.md (279 more words)Show less
Common Pitfalls
  1. Importing heavy libraries at module level - Defer to function level if not always needed
  2. Not handling Lambda context - Use context.get_remaining_time_in_millis() for timeout awareness
  3. Not validating input - Always validate and sanitize event data
  4. Printing sensitive data - Be careful with logs and CloudWatch

Error Recovery: If deployment fails, check CloudWatch logs for initialization errors and run sam logs to diagnose issues.

Security Considerations
  • Never hardcode credentials; use IAM roles and environment variables
  • Validate all input data
  • Use least privilege IAM policies
  • Enable CloudTrail for audit logging

References

For detailed guidance on specific topics:

Examples

Example 1: Create an AWS Chalice REST API

Input:

Create a Python Lambda REST API using AWS Chalice for a todo application

Process:

  1. Initialize Chalice project with chalice new-project
  2. Configure routes for CRUD operations
  3. Set up DynamoDB integration
  4. Configure deployment stages
  5. Deploy with chalice deploy

Output:

  • Complete Chalice project structure
  • REST API with CRUD endpoints
  • DynamoDB table configuration
  • Deployment configuration
Example 2: Optimize Cold Start for Raw Python

Input:

My Python Lambda has slow cold start, how do I optimize it?

Process:

  1. Analyze imports and initialization code
  2. Move heavy imports inside functions (lazy loading)
  3. Cache boto3 clients at module level
  4. Remove unnecessary dependencies
  5. Use provisioned concurrency if needed

Output:

  • Refactored code with lazy loading
  • Optimized cold start < 100ms
  • Dependency analysis
Example 3: Deploy with GitHub Actions

Input:

Configure CI/CD for Python Lambda with SAM

Process:

  1. Create GitHub Actions workflow
  2. Set up Python environment and dependencies
  3. Run pytest with coverage
  4. Package with SAM
  5. Deploy to dev/prod stages

Output:

  • Complete .github/workflows/deploy.yml
  • Multi-stage pipeline
  • Integrated test automation

Version

Version: 1.0.0

© giuseppe-trisciuoglio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in plugins/developer-kit-python/skills/aws-lambda-python-integration of giuseppe-trisciuoglio/developer-kit.

  • SKILL.md
  • references/chalice-lambda.md
  • references/raw-python-lambda.md
  • references/serverless-deployment.md
  • references/testing-lambda.md

Open the folder on GitHubat commit fe73fb3

Compare with similar skills

AWS Lambda Python Integration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

AWS Lambda Python Integration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
AWS Lambda Python Integration this skillgiuseppe-trisciuoglio/developer-kit355—~2.4kAutomated safety check: NotesMIT
AWS Serverless Edazxkane/aws-skills3674 repos~3.2kAutomated safety check: PassMIT
AWS Lambda Durable Functionsawslabs/agent-plugins912—~2.3kAutomated safety check: PassApache-2.0
AWS Step Functionsaws/agent-toolkit-for-aws2.8k—~3.4kAutomated safety check: PassApache-2.0
Deploying Custom Domain REST APIaws/agent-toolkit-for-aws2.8k—~4.8kAutomated safety check: PassApache-2.0
AWS Lambda Durable Functionsaws/agent-toolkit-for-aws2.8k—~2.3kAutomated safety check: PassApache-2.0

Similar skills

  • AWS Serverless Eda

    zxkane/aws-skills

    AWS serverless and event-driven architecture expert based on Well-Architected Framework.

    367 GitHub starsUsed in 4 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • AWS Lambda Durable Functions

    awslabs/agent-plugins

    Official

    Build resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions.

    912 GitHub stars~2.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • AWS Step Functions

    aws/agent-toolkit-for-aws

    Official

    Authors and edits AWS Step Functions state machines: writes Amazon States Language (ASL) in JSONata, and chooses and structures state types (Task, Choice, Map, Parallel, Pass, Wait, Succeed, Fail).

    2.8k GitHub stars~3.4k tokensUpdated today
    Backend & APIsAuto-check passed
  • Deploying Custom Domain REST API

    aws/agent-toolkit-for-aws

    Official

    Deploys a Regional REST API with a custom domain name, a Lambda backend function, and a request-based Lambda authorizer using AWS CLI.

    2.8k GitHub stars~4.8k tokensUpdated today
    Backend & APIsAuto-check passed
  • AWS Lambda Durable Functions

    aws/agent-toolkit-for-aws

    Official

    Builds resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions.

    2.8k GitHub stars~2.3k tokensUpdated today
    Backend & APIsAuto-check passed
  • AWS Serverless

    aws/agent-toolkit-for-aws

    Official

    Builds, deploys, manages, debugs, configures, and optimizes serverless applications on AWS using Lambda, API Gateway, Step Functions, EventBridge, and SAM/CDK.

    2.8k GitHub stars~2.5k tokensUpdated today
    Backend & APIsAuto-check passed

More from giuseppe-trisciuoglio/developer-kit

All 117 skills in this repo
  • Nestjs Drizzle Crud Generator

    giuseppe-trisciuoglio/developer-kit

    Generates complete CRUD modules for NestJS applications with Drizzle ORM.

    355 GitHub stars~1.3k tokensUpdated 27 days ago
    Auto-check: notes
  • Spring Boot Actuator

    giuseppe-trisciuoglio/developer-kit

    Provides patterns to configure Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, and Micrometer metrics across JVM services.

    355 GitHub stars~2.2k tokensUpdated 27 days ago
    Auto-check: notes
  • Spring Boot Crud Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides and generates complete CRUD workflows for Spring Boot 3 services.

    355 GitHub stars~2.5k tokensUpdated 27 days ago
    Auto-check: notes
  • Spring Boot Security JWT

    giuseppe-trisciuoglio/developer-kit

    Provides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based…

    355 GitHub stars~3.9k tokensUpdated 27 days ago
    Auto-check: notes
  • AWS CLI Beast

    giuseppe-trisciuoglio/developer-kit

    Provides advanced AWS CLI patterns for managing EC2, Lambda, S3, DynamoDB, RDS, VPC, IAM, and CloudWatch.

    355 GitHub stars~1.7k tokensUpdated 27 days ago
    Auto-check: notes
  • AWS SDK Java V2 Secrets Manager

    giuseppe-trisciuoglio/developer-kit

    Provides AWS Secrets Manager patterns for AWS SDK for Java 2.x, including secret retrieval, caching, rotation-aware access, and Spring Boot integration.

    355 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check: notes

Categories

Questions about AWS Lambda Python Integration

What does AWS Lambda Python Integration do?

Provides AWS Lambda integration patterns for Python with cold start optimization. AWS Lambda Python Integration is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides AWS Lambda integration patterns for Python with cold start optimization.

When should I use AWS Lambda Python Integration?

AWS Lambda Python Integration fits situations like: deploying Python functions to AWS Lambda; choosing between AWS Chalice and raw Python approaches; optimizing cold starts; configuring API Gateway.

How do I install AWS Lambda Python Integration in Claude Code?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-python-integration -a claude-code`. Or copy the skill folder (plugins/developer-kit-python/skills/aws-lambda-python-integration in giuseppe-trisciuoglio/developer-kit) into .claude/skills/aws-lambda-python-integration in your project. Claude Code loads it when a task matches its description.

How do I install AWS Lambda Python Integration in Codex?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-python-integration -a codex`. Or copy the skill folder (plugins/developer-kit-python/skills/aws-lambda-python-integration in giuseppe-trisciuoglio/developer-kit) into .agents/skills/aws-lambda-python-integration in your project. Codex loads it when a task matches its description.

Can I use AWS Lambda Python Integration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-python-integration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aws-lambda-python-integration, .gemini/skills/aws-lambda-python-integration, .github/skills/aws-lambda-python-integration and .opencode/skills/aws-lambda-python-integration in your project.

What does AWS Lambda Python Integration need to run?

SKILL.md names no scripts, command-line tools or credentials: AWS Lambda Python Integration is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Glob, Grep.

Does AWS Lambda Python Integration access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is AWS Lambda Python Integration safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does AWS Lambda Python Integration use?

AWS Lambda Python Integration is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does AWS Lambda Python Integration use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 16k tokens, read only when the agent opens those files.

What are the alternatives to AWS Lambda Python Integration?

Skills that share tags, products or a category with AWS Lambda Python Integration: AWS Serverless Eda (zxkane/aws-skills, 367 stars), AWS Lambda Durable Functions (awslabs/agent-plugins, 912 stars), AWS Step Functions (aws/agent-toolkit-for-aws, 2.8k stars) and Deploying Custom Domain REST API (aws/agent-toolkit-for-aws, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains AWS Lambda Python Integration?

giuseppe-trisciuoglio (a GitHub user) maintains it in giuseppe-trisciuoglio/developer-kit, which has 355 GitHub stars. The repository holds 117 skills in this directory. The repository was last updated on September 10, 2026.

Source: giuseppe-trisciuoglio/developer-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.