symfony-api-response
Symfony API response standardization — JSON payload format, exception handling, controllers, REST endpoints, error responses, debug mode. Triggers on: API,…
Symfony ports and adapters — port interfaces, adapter implementations, dependency injection, autowiring, repository interfaces. Triggers on: port, adapter, interface, repository interface, DI, autowiring, dependency injection, services.yaml, binding
$ npx -y skills add aligundogdu/symfony-hexagonal-skill --skill symfony-ports-adapters --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/symfony-ports-adaptersContext preview
The summary Claude sees to decide when to auto-load this skill.
Symfony ports and adapters — port interfaces, adapter implementations, dependency injection, autowiring, repository interfaces. Triggers on: port, adapter, interface, repository interface, DI, autowiring, dependency injection, services.yaml, binding
description: "Symfony ports and adapters — port interfaces, adapter implementations, dependency injection, autowiring, repository interfaces. Triggers on: port, adapter, interface, repository interface, DI, autowiring, dependency injection, services.yaml, binding"
You are an expert in the Ports & Adapters pattern within Symfony hexagonal architecture.
Ports are interfaces that define contracts for external dependencies. They live in `Domain/{Module}/Port/`.
| Port Type | Example | |-----------|---------| | Repository | `UserRepositoryInterface` | | External Service | `PaymentGatewayInterface` | | Notification | `NotificationServiceInterface` | | File Storage | `FileStorageInterface` | | Event Dispatcher | `EventDispatcherInterface` |
namespace App\Domain\{Module}\Port;
interface {Concern}Interface
{
public function methodUsingDomainTypes(ValueObject $param): ?Entity;
}Adapters implement ports using specific technologies. They live in `Infrastructure/{Module}/`.
namespace App\Infrastructure\{Module}\Persistence;
use App\Domain\{Module}\Port\{Repository}Interface;
final readonly class Doctrine{Entity}Repository implements {Repository}Interface
{
public function __construct(
private EntityManagerInterface $entityManager,
) {
}
// implement all port methods
}# config/services.yaml
services:
# Bind ports to adapters
App\Domain\User\Port\UserRepositoryInterface:
alias: App\Infrastructure\User\Persistence\DoctrineUserRepository
App\Domain\Payment\Port\PaymentGatewayInterface:
alias: App\Infrastructure\Payment\ExternalService\StripePaymentGateway
App\Domain\Notification\Port\NotificationServiceInterface:
alias: App\Infrastructure\Notification\ExternalService\SymfonyMailerAdapterSee `references/` for detailed guides:
A Claude Code plugin that enforces hexagonal architecture (ports & adapters) in Symfony projects. Works with both new projects (full scaffolding) and existing projects (progressive, module-by-module refactoring).
Symfony API response standardization — JSON payload format, exception handling, controllers, REST endpoints, error responses, debug mode. Triggers on: API,…
Symfony CQRS command/query handlers — commands, queries, handlers, bus configuration, use cases. Triggers on: command, query, handler, CQRS, bus, use case,…
Symfony Doctrine persistence — repository adapters, entity mapping, migrations, transactions, database patterns. Triggers on: doctrine, repository,…
Symfony domain modeling — entities, value objects, domain events, aggregates, domain exceptions. Triggers on: entity, value object, domain event, aggregate,…
Symfony hexagonal architecture setup — project structure, module scaffolding, layer responsibilities, dependency rules. Triggers on: architecture, module,…
Symfony Messenger async processing — message queues, retry strategies, failure transport, Symfony Scheduler, idempotency patterns, background jobs. Triggers…