Symfony workflow

From event4u-app/agent-config · View interactive version

Symfony workflow is an AI agent skill from the GitHub repository event4u-app/agent-config. Writes Symfony PHP — DI container, bundles, Doctrine, Messenger, Security voters, console commands. For Laravel / Eloquent / Artisan use `laravel`. For framework-free PHP use `php-coder`.

How to use this skill

Skill file

symfony-workflow

When to use

Use this skill for all Symfony-specific code generation and editing tasks, especially when working with:

This skill extends the base php-coder skill and applies Symfony conventions on top of the project's general PHP rules.

When to use the analysis sibling

When the task is understanding how a Symfony app boots, wires its container, routes requests, or fails at runtime — defer to project-analysis-symfony first, then return here for the edit. This skill assumes the kernel/container layout is already known.

Procedure: write Symfony code

→ First apply the php-coder skill for general PHP rules.

Then add these Symfony-specific checks:

  1. Confirm Symfony — bin/console exists, composer.json lists symfony/framework-bundle.
  2. Confirm version — composer.lock for the framework-bundle major. 5.x → 6.x → 7.x differs in attribute routing, voter signatures, and Messenger DSN shape.
  3. Inspect app structure — standard, modular (src/Module/<Name>/), or DDD-style. Do not enforce a layout the project does not use.
  4. Check config layout — config/packages/<env>/, services.yaml autowiring vs explicit bindings, config/bundles.php.
  5. Check test conventions — PHPUnit/Codeception; unit vs integration vs functional split.

Core Symfony principles

HTTP layer rules

Validation rules

Service layer and DI rules

Routing rules

Response rules

Messenger and async work

Events and subscribers

Security, voters, authorization

Config and environment

Doctrine and persistence

Migrations

Twig

Bundles and compiler passes

Console commands

Output format

  1. Symfony code following framework conventions and project architecture.
  2. All related files (controller, service, DTO, repository, test, config) as needed.
  3. Schema changes — migration file plus updated entity/mapping.

Do NOT

Gotcha

When NOT to use — components without the framework

A DEPENDENCY PROVES A LIBRARY IS AVAILABLE. ONLY THE ENTRY POINT AND THE
ROUTER PROVE WHICH APPLICATION SHAPE IS RUNNING.
`symfony/*` PACKAGES WITH NO SKELETON MARKER IS A THIRD STATE, AND THIS SKILL
DOES NOT APPLY TO IT.

Symfony ships its ORM, container, collections and HTTP layer as

independently installable packages, usable with no framework present — a

published distribution model, not one consumer's arrangement. An application

built that way has a custom entry point and a custom router. Routing it here

offers a CLI that does not exist, a request-validation primitive that is not

wired, and a routes file that was never there: every suggestion confidently

wrong, and the reason visible only from the entry point.

The probe set, and its cost. A fixed set of filesystem existence checks plus

one manifest read — no directory walk, no content scan, and never re-derived per

session. Any ONE marker present means the framework is real:

| Probe | Meaning |

|---|---|

| bin/console | the console entry point the skeleton writes |

| config/bundles.php | the bundle registry |

| config/services.yaml | the DI service config |

symfony/* in composer.json with none of those markers is

components-without-the-framework. Say so and route away from this skill rather

than answering as though the framework were there.

Implemented deterministically in src/install/detect_php_shape.ts

(detectPhpShape), whose PROBE_PATHS is this table and whose verdict names

what a wrong route would have offered.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.