.claude/skills/ecotone-symfony-setup/SKILL.md
Sets up Ecotone in a Symfony project: composer installation, bundle registration, YAML configuration, Doctrine ORM integration, SymfonyConnectionReference for DBAL, Symfony Messenger channels, async consumer commands, and ServiceContext. Use when installing Ecotone in Symfony, configuring Symfony-specific connections, or setting up Symfony async consumers.
npx skillsauth add ecotoneframework/ecotone-dev ecotone-symfony-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill covers setting up and configuring Ecotone within a Symfony application. Use it when installing Ecotone, registering the bundle, configuring database connections via Doctrine, setting up async messaging with Symfony Messenger, integrating Doctrine ORM aggregates, or configuring multi-tenancy.
composer require ecotone/symfony-bundle
Optional packages:
composer require ecotone/dbal # Database support (DBAL, outbox, dead letter, event sourcing)
composer require ecotone/amqp # RabbitMQ support
composer require ecotone/redis # Redis support
composer require ecotone/sqs # SQS support
composer require ecotone/kafka # Kafka support
In config/bundles.php:
<?php
use Ecotone\SymfonyBundle\EcotoneSymfonyBundle;
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
EcotoneSymfonyBundle::class => ['all' => true],
];
In config/packages/ecotone.yaml:
ecotone:
serviceName: 'my_service'
loadSrcNamespaces: true
failFast: true
defaultSerializationMediaType: 'application/json'
defaultErrorChannel: 'errorChannel'
#[ServiceContext]
public function databaseConnection(): SymfonyConnectionReference
{
return SymfonyConnectionReference::defaultManagerRegistry('default');
}
Enable Doctrine ORM repositories:
#[ServiceContext]
public function dbalConfig(): DbalConfiguration
{
return DbalConfiguration::createWithDefaults()
->withDoctrineORMRepositories(true);
}
Annotate aggregates with both #[ORM\Entity] and #[Aggregate]:
#[ORM\Entity]
#[ORM\Table(name: 'orders')]
#[Aggregate]
class Order
{
#[ORM\Id]
#[ORM\Column(type: 'string')]
#[Identifier]
private string $orderId;
}
#[ServiceContext]
public function asyncChannel(): SymfonyMessengerMessageChannelBuilder
{
return SymfonyMessengerMessageChannelBuilder::create('async');
}
bin/console ecotone:run <channel_name>
bin/console ecotone:run orders --handledMessageLimit=100
bin/console ecotone:run orders --memoryLimit=256
bin/console ecotone:run orders --executionTimeLimit=60000
bin/console ecotone:list
#[ServiceContext]
public function multiTenant(): MultiTenantConfiguration
{
return MultiTenantConfiguration::create(
tenantHeaderName: 'tenant',
tenantToConnectionMapping: [
'tenant_a' => SymfonyConnectionReference::createForManagerRegistry('tenant_a_connection'),
'tenant_b' => SymfonyConnectionReference::createForManagerRegistry('tenant_b_connection'),
],
);
}
SymfonyConnectionReference::defaultManagerRegistry() is the recommended approach (uses Doctrine ManagerRegistry)SymfonyMessengerMessageChannelBuilder::create() channel name must match a transport defined in config/packages/messenger.yaml#[ORM\Entity] and #[Aggregate] attributesDbalConfiguration::createWithDefaults()->withDoctrineORMRepositories(true) for Doctrine entity persistence#[ServiceContext] methods in a class registered as a service for configurationecotone.yaml with all options and comments, all configuration option descriptions with defaults, SymfonyConnectionReference API table, and doctrine.yaml DBAL connection setup. Load when you need the complete YAML configuration or all available config options.messenger.yaml, DBAL-backed channels, multi-tenant setup with full doctrine.yaml for multiple entity managers, and Doctrine ORM entity mappings. Load when you need full working class files with imports and complete configuration examples.development
Implements workflows in Ecotone: Sagas (stateful process managers), stateless workflows with InternalHandler and outputChannelName chaining, and Orchestrators (Enterprise) with routing slip pattern. Use when building Sagas, process managers, multi-step workflows, long-running processes, handler chaining, or Orchestrators.
development
Writes and debugs tests for Ecotone using EcotoneLite::bootstrapFlowTesting, aggregate testing, async-tested-synchronously patterns, projections, and common failure diagnosis. Use when writing tests, debugging test failures, adding test coverage, or implementing any new feature that needs tests. Should be co-triggered whenever a new handler, aggregate, saga, projection, or interceptor is being implemented.
development
Implements message resiliency in Ecotone: RetryTemplateBuilder for retry strategies, error channels, ErrorHandlerConfiguration, DBAL dead letter queues, outbox pattern for guaranteed delivery, and FinalFailureStrategy for permanent failures. Use when handling failed messages, configuring retries, setting up dead letter queues, implementing outbox pattern, or managing error channels.
development
Scaffolds new Ecotone packages and modules: AnnotationModule pattern, module registration, Configuration building, and package template usage. Use when creating new framework modules, extending the module system, or scaffolding new packages.