CtrlK
BlogDocsLog inGet started
Tessl Logo

giuseppe-trisciuoglio/developer-kit

Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.

89

Quality

89%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Risky

Do not use without reviewing

Overview
Quality
Evals
Security
Files

guide-skills-architecture.mdplugins/developer-kit-php/docs/

Architecture Skills Guide

Quick reference for PHP architecture skills covering Clean Architecture/DDD patterns and AWS Lambda serverless integration.


Skills Overview

SkillPurposeFrameworks
clean-architectureClean Architecture, Hexagonal Architecture, DDD patternsLaravel, Symfony
aws-lambda-php-integrationServerless PHP deployment with AWS LambdaSymfony (Bref), Raw PHP

clean-architecture

File: skills/clean-architecture/SKILL.md

Provides implementation patterns for Clean Architecture, Hexagonal Architecture (Ports & Adapters), and Domain-Driven Design in PHP 8.3+ with Symfony 7.x.

When to Use

  • Architecting new Laravel/Symfony applications with clear separation of concerns
  • Refactoring tightly coupled code into testable, layered architectures
  • Implementing domain logic independent of frameworks and infrastructure
  • Designing ports and adapters for swappable implementations
  • Applying Domain-Driven Design tactical patterns (entities, value objects, aggregates)
  • Creating testable business logic without framework context dependencies

Architecture Layers

LayerResponsibilityPHP Equivalent
DomainEntities, value objects, domain events, repository interfacesDomain/ - pure PHP classes
ApplicationUse cases, application services, DTOs, portsApplication/ - services, use cases
InfrastructureFrameworks, database, external APIsInfrastructure/ - Doctrine/Eloquent
InterfaceControllers, presenters, external gatewaysInterface/ - HTTP/Console

Package Structure

src/
└── Modules/
    └── Order/
        ├── Domain/
        │   ├── Model/          # Entities, value objects
        │   ├── Events/         # Domain events
        │   ├── Repository/     # Repository interfaces (ports)
        │   └── Exception/      # Domain exceptions
        ├── Application/
        │   ├── UseCase/        # Use case classes
        │   ├── Service/        # Application services
        │   └── DTO/           # Request/response DTOs
        ├── Infrastructure/
        │   ├── Persistence/   # Repository adapters
        │   └── External/      # External service adapters
        └── Interface/
            └── Http/
                └── Controller/

Key Patterns

  • Value Objects: Immutable objects defined by attributes (e.g., Money, Email, UUID)
  • Entities: Objects with identity and lifecycle (e.g., Order, Customer)
  • Aggregates: Consistency boundary with root entity controlling access
  • Domain Events: Capture significant business occurrences for decoupled side effects
  • Repositories: Persistence abstraction - domain defines interface, infrastructure implements

Best Practices

  1. Dependency Rule: Domain has zero dependencies on frameworks (Laravel/Symfony)
  2. Immutable Value Objects: Use PHP readonly properties and typed classes
  3. Rich Domain Models: Place business logic in entities, not services
  4. Repository Pattern: Domain defines interface, infrastructure implements
  5. Domain Events: Decouple side effects from primary operations
  6. Constructor Injection: Mandatory dependencies via constructor
  7. DTO Mapping: Separate domain models from API contracts
  8. Transaction Boundaries: Place transactions in application services

aws-lambda-php-integration

File: skills/aws-lambda-php-integration/SKILL.md

Provides AWS Lambda integration patterns for PHP with Symfony using the Bref framework.

When to Use

  • Deploying PHP/Symfony applications to AWS Lambda
  • Configuring API Gateway integration for PHP
  • Implementing serverless PHP applications
  • Optimizing Lambda cold start performance
  • Setting up SQS/SNS event triggers

Trigger Keywords

  • "create lambda php", "deploy symfony lambda"
  • "bref lambda aws", "php lambda cold start"
  • "aws lambda php performance"
  • "symfony serverless", "php serverless framework"

Deployment Options

Bref (Symfony)

Best for Symfony applications requiring full framework features.

Bref + Symfony = Full Symfony on Lambda
  • Symfony HTTP Kernel integration
  • Warm container optimization
  • Doctrine ORM support
  • Messenger component support

Raw PHP Handlers

Best for lightweight functions with minimal dependencies.

Raw PHP + PSR-15 = Minimal Lambda function
  • Minimal cold start (~10-50ms)
  • PSR-15 request/response handlers
  • AWS SDK integration (DynamoDB, S3)
  • Lazy service loading

Architecture Patterns

┌─────────────────────────────────────────────────────────────┐
│ AWS Lambda                                                   │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────┐   ┌────────────────────────────────────┐ │
│  │ API Gateway  │──▶│ PHP Runtime (Bref)                 │ │
│  │ HTTP/REST    │   │  ┌────────────────────────────────┐ │ │
│  └──────────────┘   │  │ Symfony / Raw PHP Handler     │ │ │
│                     │  └────────────────────────────────┘ │ │
│  ┌──────────────┐   │                                     │ │
│  │ SQS / SNS    │──▶│ Event Handler                      │ │
│  │ Async Events │   │                                     │ │
│  └──────────────┘   └────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

Cold Start Optimization

StrategyImpactComplexity
Disable unnecessary servicesMediumLow
Lazy service loadingHighMedium
Smaller container sizeMediumLow
Provisioned concurrencyN/ALow (cost)
SnapStart (Java)N/AN/A (Java only)

Deployment Tools

  • Serverless Framework: serverless.yml configuration
  • AWS SAM: CloudFormation-based deployment
  • CI/CD: GitHub Actions, GitLab CI pipelines
  • Custom Domains: Route 53 + ACM certificates

See Also

  • Clean Architecture Skill - Complete patterns reference
  • AWS Lambda Skill References - Detailed deployment guides
  • WordPress Sage Theme Skill - WordPress development

plugins

CHANGELOG.md

context7.json

CONTRIBUTING.md

README_CN.md

README_ES.md

README_IT.md

README.md

tessl.json

tile.json