Symfony Skills for Claude Code
Production-ready Claude Code skills that teach the agent your Symfony conventions — not generic PHP from a 2019 blog post.
Jump to: Quick start · Before / After · Skill catalog · Why · Stack assumptions · Anatomy of a skill · Contributing
Why
AI coding agents are fluent in scripting languages but hallucinate in Symfony. Left alone, an agent will:
- inject dependencies via the service container instead of the constructor,
- return Doctrine entities straight out of a controller,
- reinvent an exception hierarchy instead of using
HttpException,
- write
EAGER associations and N+1 queries,
- put business logic in controllers and persistence in services.
A skill is a markdown file the agent reads before it touches your code. It encodes your stack, your patterns, and the exact mistakes agents make in that domain (the Gotchas section).
Stack assumptions
These skills target a modern Symfony stack:
- Symfony 7.x, PHP 8.3+ (attributes, readonly classes, enums, first-class callable syntax)
- Doctrine ORM 3 with attribute mapping and migrations
- API Platform 4 for REST/GraphQL resources
- Symfony Serializer + Validator for DTOs
- Symfony Messenger for async / CQRS
- Lexik JWT + Symfony Security for authentication
- PHPUnit 11 + Foundry/Zenstruck for tests
Most patterns apply to Symfony 6.4 LTS too; differences are noted inline.
Tested against
The code in these skills was written and reviewed against these exact versions. Newer patch/minor releases are expected to work; if something breaks on a different version, open an issue.
| Component | Version |
|---|
| PHP | 8.3 |
| Symfony | 7.2.x |
| Doctrine ORM | 3.3 |
| Doctrine Migrations | 3.8 |
| API Platform | 4.0 |
| Symfony Messenger | 7.2 |
| LexikJWTAuthenticationBundle | 3.x |
| PHPUnit | 11.x |
| zenstruck/foundry | 2.x |
Opinionated by design — and easy to override
These skills ship sensible defaults, not the only way. Each SKILL.md states why it picks a pattern, so when your project differs you can override it: edit the copied skill in your .claude/skills/ (it's yours now), or add a project-specific note to its Gotchas. Common override points — UUID vs. auto-increment IDs, API Platform vs. hand-rolled controllers, Lexik vs. another JWT bundle, Foundry vs. fixture files — are called out in the relevant skill.
Quick start
As a Claude Code plugin (recommended — installs all skills, auto-updates):
/plugin marketplace add fatonh/symfony-skills
/plugin install symfony-skills@symfony-skills
Skills become available as symfony-skills:<name> in a new session — no file copying, and they update when you re-sync the marketplace.
Or as plain files in your project (no plugin system, pick a subset). From the root of your Symfony project:
# every skill:
curl -sSL https://raw.githubusercontent.com/fatonh/symfony-skills/main/install.sh | bash
# ...or only the ones you want (pass skill names):
curl -sSL https://raw.githubusercontent.com/fatonh/symfony-skills/main/install.sh | bash -s -- doctrine-orm api-platform-resources dto-and-validation
The script copies the chosen skills into .claude/skills/ (re-run any time to update). Don't have Claude Code yet? npm install -g @anthropic-ai/claude-code.
Prefer to install by hand (or without curl | bash)?
git clone https://github.com/fatonh/symfony-skills /tmp/symfony-skills
mkdir -p .claude/skills
# a few skills...
cp -r /tmp/symfony-skills/skills/doctrine-orm .claude/skills/
# ...or the whole set
cp -r /tmp/symfony-skills/skills/* .claude/skills/
# or run the installer from the clone:
/tmp/symfony-skills/install.sh doctrine-orm dto-and-validation
Claude Code auto-discovers anything in .claude/skills/ and loads a skill automatically when your task matches its description trigger — no flags, no config.
Verify it loaded: inside Claude Code, run /skills to list discovered skills, or just ask "add an orders endpoint" and watch it pull in layered-architecture / dto-and-validation before writing code.
Commit the skills to your repo. Putting .claude/skills/ under version control means every teammate (and every CI agent run) gets the same conventions. That's the point — the skills are your team's shared standards.
Skill catalog (17)