ddd-message-handler-specialist

Automate asynchronous background processing in DDD PHP apps with Symfony Messenger.

3|Updated Feb 12, 2024
One-click install
npx skills add https://github.com/mgamadeus/ddd --skill ddd-message-handler-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-message-handler-specialist
Source: https://github.com/mgamadeus/ddd/tree/main/.claude/skills/ddd-message-handler-specialist
Command: npx skills add https://github.com/mgamadeus/ddd --skill ddd-message-handler-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes and enables asynchronous background processing in the mgamadeus/ddd framework by providing a proven AppMessage/AppMessageHandler pattern, including auth propagation, workspace routing guards, and structured logging.

Core Features & Use Cases

  • Standardized message and handler scaffolds for async tasks within the DDD core
  • Automatic propagation of authentication context from the initiator to background work
  • Transport wiring, supervisor-based consumption, and robust error handling

Quick Start

Follow the guide to add a new FooBarMessage and FooBarHandler, wire them to a Messenger transport, and implement the appropriate service call.

Frequently Asked Questions about ddd-message-handler-specialist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle asynchronous background processing in a DDD PHP application?

Asynchronous background processing in a DDD PHP application is handled using the AppMessage/AppMessageHandler pattern with Symfony Messenger. This approach routes tasks outside the request lifecycle while maintaining auth context and structured logging.

How does Symfony Messenger propagate authentication context to background tasks?

Symfony Messenger propagates authentication context to background tasks by automatically passing the initiator's auth details to the asynchronous work. This ensures background handlers execute with consistent user permissions and workspace routing guards.

What is the best way to structure async message handlers in a DDD core?

The best way to structure async message handlers in a DDD core is using standardized AppMessage and AppMessageHandler scaffolds. This pattern separates asynchronous task execution from the request lifecycle while enforcing consistent routing and error handling.

How do I wire Symfony Messenger transports for a new AppMessage?

To wire Symfony Messenger transports for a new AppMessage, you create the message and handler classes, bind them to a specific transport, and configure a supervisor-based consumer workflow. This routes the task to the correct background processing queue.

Why do I need a supervisor-based consumer workflow for PHP async tasks?

A supervisor-based consumer workflow is needed for PHP async tasks to ensure robust consumption and error handling. It manages the background worker processes, keeping transport routing reliable when tasks execute outside the main request lifecycle.

Can I use this AppMessageHandler pattern for tasks that require workspace routing?

Yes, the AppMessageHandler pattern supports tasks requiring workspace routing by implementing specific routing guards. It ensures background tasks are securely directed to the correct workspace with proper authentication context.