Register Cqrs Services
Developmentregister-cqrs-servicesRegister Cqrs Services is an Agent Skill for development published in the PrestaShop/PrestaShop repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Register all domain handlers and the repository in the Symfony DI container. Handlers are auto-discovered via #[AsCommandHandler] / #[AsQueryHandler] attributes. Trigger: "register CQRS services for {Domain}".
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/PrestaShop/PrestaShop/blob/HEAD/.ai/Component/CQRS/skills/register-cqrs-services/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/register-cqrs-services, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
register-cqrs-services
Instructions
- Find the correct YAML file (check where other domain services are registered — typically per-domain or grouped by layer).
- Register
{Domain}Repositorywithautowire: trueandautoconfigure: true. - Bind handler interfaces to their concrete implementations.
- Handlers with
#[AsCommandHandler]/#[AsQueryHandler]attributes are automatically registered with the Symfony Messenger bus — no manual tags needed. Just ensureautoconfigure: trueis set. - Run
php bin/console debug:container | grep {domain}to verify registration.
Rules
Handler auto-registration via attributes is documented in CQRS/CONTEXT.md. Skill-specific reminders:
- Register handler interface → concrete class bindings so DI can resolve them
- Each handler must have exactly one attribute — duplicate registration causes errors