Scaffold a new bounded context with hexagonal layers
Quando usar: You're starting a new feature and want the layering right from day one.
Pré-requisitos
- Symfony 6.x+ project — composer create-project symfony/skeleton
- Skill installed — git clone https://github.com/aligundogdu/symfony-hexagonal-skill ~/.claude/skills/symfony-hexagonal-skill
Fluxo
-
Name the contextUse symfony-hexagonal-skill. Scaffold a 'Billing' bounded context with Invoice aggregate, issue/void commands, and a query for open invoices.✓ Copiado→ src/Billing/Domain, Application, Infrastructure folders with proper separation
-
Wire the infrastructureAdd a Doctrine adapter for InvoiceRepository behind the domain port.✓ Copiado→ Interface in Domain, implementation in Infrastructure, services.yaml binding
-
Expose via controllerAdd an HTTP adapter with a POST /invoices endpoint that dispatches the IssueInvoice command.✓ Copiado→ Controller calls bus, not repository directly
Resultado: A clean bounded context that won't turn into spaghetti in 6 months.
Armadilhas
- Domain depending on Doctrine annotations — Use XML / attribute mapping in Infrastructure, not on domain entities