Skip to main content
skill CX Codex

symfony-messenger — Claude Code skill: what it does, how to install

A skill for async message handling with Symfony Messenger: configures transports, handlers, and retry strategies.

MIT ★ 234 updated 2026-10-05

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dev-toolings/superpowers-symfony --skill symfony-messenger -a claude-code
Open on GitHub

What symfony-messenger does

The skill helps move slow or risky work out of HTTP requests into a queue. You create a message class with IDs (not Doctrine entities), write a handler with the #[AsMessageHandler] attribute, route the message to a transport (Doctrine, Redis, AMQP, sync://, or in-memory://), and start a worker with messenger:consume.

Handlers must be idempotent: delivery is at-least-once, so a redelivered message should not break data. The skill defines retry policies, failure transport settings, and commands to verify wiring with debug:messenger and messenger:stats. Without restarting workers after deploy (messenger:stop-workers), new code will not apply.

In tests, use the in-memory:// transport to check logic without external dependencies. For workers, set limits by memory (--memory-limit), time (--time-limit), or message count (--limit).

What it helps with

  • move slow work out of HTTP requests into a background handler
  • configure a transport for RabbitMQ, Redis, or Doctrine and route messages to it
  • write an idempotent handler that survives redelivery without breaking data
  • define a retry strategy and failure transport for messages that fail
  • verify the configuration and run a worker with resource limits

Example prompts for the agent

  • Create a SendInvoiceEmail message class with orderId and recipientEmail fields, a handler with #[AsMessageHandler], and route it to the async transport via Doctrine.
  • Set up retry_strategy for the async transport: three attempts with delays of 5, 15, and 60 seconds, and send to failure_transport after exhaustion.
  • Run messenger:consume async -vv with a limit of 100 messages and output debug:messenger to verify wiring.

How to install symfony-messenger

1Skills CLI (Vercel)

npx skills add dev-toolings/superpowers-symfony --skill symfony-messenger -a claude-code

2Manually: put the files in place

~/.claude/skills/symfony-messenger/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/symfony-messenger/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about symfony-messenger

How to install symfony-messenger in Claude Code?

Run npx skills add dev-toolings/superpowers-symfony --skill symfony-messenger -a claude-code, then open ~/.claude/skills/symfony-messenger/SKILL.md.

What does symfony-messenger do?

The skill helps work with Symfony Messenger: create messages and handlers, configure transports and retry strategies, run workers, and verify configuration.

Why cannot I pass Doctrine entities in messages?

Proxies and detached state do not serialize cleanly. Pass IDs and refetch entities in the handler by ID.

Source text

SKILL.md · MIT
---
name: symfony-messenger
description: Async message handling with Symfony Messenger; configure transports (RabbitMQ, Redis, Doctrine); implement handlers, middleware, and retry strategies
capabilities: [read, search, edit, shell]
tags: [messenger]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep
  - Write
  - Edit
  - Bash
---

# Symfony Messenger (Symfony)

## Use when
- Moving slow or failure-prone work out of the request into a message and an `#[AsMessageHandler]` handler.
- Choosing a transport (Doctrine, Redis, AMQP, `sync://`, `in-memory://`) and routing messages to it.
- Running, sizing, and restarting workers with `messenger:consume`.
- Making handlers safe under redelivery.

## Default workflow
1. Create the message as a plain `readonly` class that carries IDs, never entities.
2. Write the handler with `#[AsMessageHandler]` and a typed `__invoke()`: refetch by ID, skip work already done.
3. Route the message with `#[AsMessage('async')]` or the `routing` key, and declare the transport DSN in `messenger.yaml`.
4. Set `retry_strategy` and `failure_transport` on the transport.
5. Consume with `messenger:consume async -vv`, bounded by `--limit`, `--memory-limit`, or `--time-limit`.
6. Check the wiring with `debug:messenger` and `messenger:stats`, and use `in-memory://` in tests.

## Guardrails
- Pass entity IDs, never Doctrine entities: proxies and detached state do not serialize cleanly.
- Delivery is at-least-once: a redelivered message must return quietly, not throw.
- `PriorityStamp`, `--fetch-size`, `--no-reset`, and `stop_worker_on_signals` are marked 8.1+ in the reference: verify the minimum version first.
- Restart workers on deploy with `messenger:stop-workers`.

## Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.

## Output contract
- The message, its handler, and the routing and transport configuration.
- The retry and failure transport settings.
- The worker command, and the `debug:messenger` or `messenger:stats` output that proves the wiring.

## References
- `reference.md`

© dev-toolings · MIT · dev-toolings/superpowers-symfony

Similar skills

All skills for Backend and APIs →

From the same set51

The whole set →
tdd-with-pest tdd-with-pest guides RED-GREEN-REFACTOR in Symfony projects using Pest v4. Use it to write new tests, reproduce bugs before a fix, or move PHPUnit tests to Pest syntax. CX Codex +1 ★ 234repo stars api-platform-versioning api-platform-versioning keeps API Platform clients alive through renames and removals: deprecation with a sunset date first, parallel versions as the last resort. CX Codex +1 ★ 234repo stars functional-tests functional-tests guides Claude Code in writing functional Symfony tests using WebTestCase, KernelTestCase, loginUser, and DAMA rollback. CX Codex +1 ★ 234repo stars doctrine-migrations Create and review Doctrine migrations, prepare rollbacks, and check pending changes before deployment. Useful when a Symfony app’s entity mapping changes. CX Codex +1 ★ 234repo stars api-platform-security api-platform-security secures API Platform operations with security expressions, voters, and validation-phase access checks in Symfony. CX Codex +1 ★ 234repo stars e2e-panther-playwright The e2e-panther-playwright skill guides Symfony E2E tests with Panther for browser flows and Playwright for more involved cases. Use it when JavaScript behavior is beyond what WebTestCase can observe. CX Codex +1 ★ 234repo stars doctrine-relations Skill guides you through defining Doctrine relationships (OneToMany, ManyToMany, ManyToOne) with correct owning and inverse sides, cascade strategies, and N+1 query prevention. CX Codex +1 ★ 234repo stars doctrine-fetch-modes doctrine-fetch-modes guides Doctrine ORM and DBAL 4 query optimization in Symfony. Fixes N+1 queries, configures lazy loading, and implements DTO hydration. CX Codex +1 ★ 234repo stars

Project sponsors

Companies that keep this analytics open