chunking-strategy
Provides chunking strategies for RAG systems. Generates chunk size recommendations (256-1024 tokens), overlap percentages…
Provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework. Creates Lambda handler classes, configures runtime layers, sets up SQS/SNS event triggers, implements warm-up strategies, and optimizes cold starts. Use when deploying PHP/Symfony
Claude Code
$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-php-integration --agent claude-code
Codex
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-php-integration -a codex -y
Cursor
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-php-integration -a cursor -y
Gemini CLI
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-php-integration -a gemini-cli -y
GitHub Copilot
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-php-integration -a github-copilot -y
OpenCode
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-php-integration -a opencode -y
Windsurf
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill aws-lambda-php-integration -a windsurf -y
name: aws-lambda-php-integration description: Provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework. Creates Lambda handler classes, configures runtime layers, sets up SQS/SNS event triggers, implements warm-up strategies, and optimizes cold starts. Use when deploying PHP/Symfony applications to AWS Lambda, configuring API Gateway integration, implementing serverless PHP applications, or optimizing Lambda performance with Bref. Triggers include "create lambda php", "deploy symfony lambda", "bref lambda aws", "php lambda cold start", "aws lambda php performance", "symfony serverless", "php serverless framework". allowed-tools: Read, Write, Edit, Glob, Grep, Bash
Patterns for deploying PHP and Symfony applications on AWS Lambda using the Bref framework.
Two approaches available:
Both support API Gateway integration with production-ready configurations.
| Approach | Cold Start | Best For | Complexity | |----------|------------|----------|------------| | Bref | < 2s | Symfony apps, full-featured APIs | Medium | | Raw PHP | < 500ms | Simple handlers, maximum control | Low |
my-symfony-lambda/ ├── composer.json ├── serverless.yml ├── public/ │ └── index.php # Lambda entry point ├── src/ │ └── Kernel.php # Symfony Kernel ├── config/ │ ├── bundles.php │ ├── routes.yaml │ └── services.yaml └── templates/
my-lambda-function/
├── public/
│ └── index.php # Handler entry point
├── composer.json
├── serverless.yml
└── src/
└── Services/**Symfony with Bref:**
// public/index.php use Bref\Symfony\Bref; use App\Kernel; use Symfony\Component\HttpFoundation\Request; require __DIR__.'/../vendor/autoload.php'; $kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? true); $kernel->boot(); $bref = new Bref($kernel); return $bref->run($event, $context);
**Raw PHP Handler:**
// public/index.php
use function Bref\Lambda\main;
main(function ($event) {
$path = $event['path'] ?? '/';
$method = $event['httpMethod'] ?? 'GET';
return [
'statusCode' => 200,
'body' => json_encode(['message' => 'Hello from PHP Lambda!'])
];
});1. **Lazy loading** - Defer heavy services until needed 2. **Disable unused Symfony features** - Turn off validation, annotations 3. **Optimize composer autoload** - Use classmap for production 4. **Use Bref optimized runtime** - Leverage PHP 8.x optimizations
// Cache AWS clients at function level
use Aws\DynamoDb\DynamoDbClient;
class DatabaseService
{
private static ?DynamoDbClient $client = null;
public static function getClient(): DynamoDbClient
{
if (self::$client === null) {
self::$client = new DynamoDbClient([
'region' => getenv('AWS_REGION'),
'version' => 'latest'
]);
}
return self::$client;
}
}{
"require": {
"php": "^8.2",
"bref/bref": "^2.0",
"symfony/framework-bundle": "^6.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist"
}
}try {
$result = processRequest($event);
return [
'statusCode' => 200,
'body' => json_encode($result)
];
} catch (ValidationException $e) {
return [
'statusCode' => 400,
'body' => json_encode(['error' => $e->getMessage()])
];
} catch (Exception $e) {
error_log($e->getMessage());
return [
'statusCode' => 500,
'body' => json_encode(['error' => 'Internal error'])
];
}error_log(json_encode([
'level' => 'info',
'message' => 'Request processed',
'request_id' => $context->getAwsRequestId(),
'path' => $event['path'] ?? '/'
]));# serverless.yml
service: symfony-lambda-api
provider:
name: aws
runtime: php-82
memorySize: 512
timeout: 20
package:
individually: true
exclude:
- '**/node_modules/**'
- '**/.git/**'
functions:
api:
handler: public/index.php
events:
- http:
path: /{proxy+}
method: ANY# 1. Install Bref
composer require bref/bref --dev
# 2. Test locally (validate before deploy)
sam local invoke -e event.json
# 3. Deploy
vendor/bin/bref deploy
# 4. Verify deployment
aws lambda invoke --function-name symfony-lambda-api-api \
--payload '{"path": "/", "httpMethod": "GET"}' /dev/stdout# serverless.yml for Symfony
service: symfony-lambda-api
provider:
name: aws
runtime: php-82
stage: ${self:custom.stage}
region: ${self:custom.region}
environment:
APP_ENV: ${self:custom.stage}
APP_DEBUG: ${self:custom.isLocal}
iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
Resource: '*'
functions:
web:
handler: public/index.php
timeout: 30
memorySize: 1024Modular 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.
Provides chunking strategies for RAG systems. Generates chunk size recommendations (256-1024 tokens), overlap percentages…
Provides workflows to write, debug, and optimize prompts for LLMs, including few-shot example selection, chain-of-thought…
Implements document chunking, embedding generation, vector storage, and retrieval pipelines for Retrieval-Augmented Generation…
Provides AWS CloudFormation patterns for Auto Scaling including EC2, ECS, and Lambda. Use when creating Auto Scaling groups,…
Provides AWS CloudFormation patterns for Amazon Bedrock resources including agents, knowledge bases, data sources, guardrails,…
Provides AWS CloudFormation patterns for CloudFront distributions, origins (ALB, S3, Lambda@Edge, VPC Origins), CacheBehaviors,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.