doctrine-fixtures-foundry — Claude Code skill
doctrine-fixtures-foundry teaches the agent to build Doctrine test data with Zenstruck Foundry v2 factories: named states, sequences and entity relations. Triggers when you write fixtures or migrate factories from Foundry v1.
MIT ★ 234 updated 2026-10-05
npx skills add dev-toolings/superpowers-symfony --skill doctrine-fixtures-foundry -a claude-codeWhat doctrine-fixtures-foundry does
The skill sets a workflow for generating test and dev data in a Symfony project: one PersistentObjectFactory per entity, defaults() kept to required fields only, and every variation expressed as an immutable named state like admin() or published(). Related entities come from OtherFactory::new() calls inside the factory, and shared scenarios go into stories.
It also guards against common breakage: any column with a unique constraint gets self::faker()->unique() so tests stop colliding. Calling ->object() or ->_real() is off-limits since v2 factories already hand back real objects. When a failure needs to be reproducible, it seeds Faker via FOUNDRY_FAKER_SEED.
A bundled reference.md holds deeper implementation detail the agent can open on demand. Migrating legacy v1 factories is an explicit trigger, so the skill covers upgrades rather than only greenfield work.
What it helps with
- generate a Foundry v2 factory for a Doctrine entity
- express object variations as named states
- create related entities in a test without hand-written setup
- migrate Foundry v1 factories and
->object()calls to v2 - make Faker-driven test failures reproducible
Example prompts for the agent
- Write a Foundry factory for the
Userentity with anadmin()state - Migrate my old Foundry v1 factories to v2
- Build a story with a user, an order and three items for cart tests
How to install doctrine-fixtures-foundry
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill doctrine-fixtures-foundry -a claude-code2Manually: put the files in place
~/.claude/skills/doctrine-fixtures-foundry/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/doctrine-fixtures-foundry/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill doctrine-fixtures-foundry -a codex2Manually: put the files in place
.agents/skills/doctrine-fixtures-foundry/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill doctrine-fixtures-foundry -a cursor2Manually: put the files in place
.cursor/skills/doctrine-fixtures-foundry/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dev-toolings/superpowers-symfony content/skills/doctrine-fixtures-foundry2Manually: put the files in place
.github/skills/doctrine-fixtures-foundry/SKILL.md1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill doctrine-fixtures-foundry -a gemini-cli2Platform CLI
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/doctrine-fixtures-foundryManually: put the files in place
.devin/skills/doctrine-fixtures-foundry/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about doctrine-fixtures-foundry
How do I install doctrine-fixtures-foundry in Claude Code?
Run npx skills add dev-toolings/superpowers-symfony --skill doctrine-fixtures-foundry -a claude-code and the skill lands in ~/.claude/skills/doctrine-fixtures-foundry/SKILL.md.
What does doctrine-fixtures-foundry do?
It gives the agent rules for working with Zenstruck Foundry v2: PersistentObjectFactory factories returning real objects, named states, sequences, relations and stories for shared scenarios.
Does it help with migrating from Foundry v1?
Yes — migrating v1 factories and ->object() calls is a listed trigger. In v2 factories return real objects, so ->object() and ->_real() are no longer needed.
Source text
SKILL.md · MIT
--- name: doctrine-fixtures-foundry description: Create test data with Zenstruck Foundry v2 factories (PersistentObjectFactory, real objects); define states, sequences, and relationships capabilities: [read, search, edit, shell] tags: [doctrine, testing] # projected by `bun run build` — do not edit by hand allowed-tools: - Read - Glob - Grep - Write - Edit - Bash --- # Doctrine Fixtures Foundry (Symfony) ## Use when - Creating test or development data for Doctrine entities. - Writing a Foundry factory, a named state, a sequence, or a story. - Building related entities for a test without hand-written setup. - Migrating legacy Foundry v1 factories or `->object()` calls to v2. ## Default workflow 1. Generate a factory per entity and keep `defaults()` to required and unique fields. 2. Express each variation as an immutable named state (`admin()`, `published()`). 3. Let factories create default relations with `OtherFactory::new()`. 4. Group shared scenarios in stories, and reset the database per test class. 5. Assert on real objects and on the repository through `Factory::assert()`. ## Guardrails - Use `self::faker()->unique()` for every unique column, or tests collide. - Do not call `->object()` or `->_real()`: v2 factories return real objects. - Seed Faker (`FOUNDRY_FAKER_SEED`) when a failure must be reproducible. - Do not build a factory for trivial data a test can create inline. ## Progressive disclosure - Use this file for execution posture and risk controls. - Open references when deep implementation details are needed. ## Output contract - Factories with minimal defaults, named states and relation defaults. - Stories for shared scenarios, when more than one test needs them. - Test setup wired with the Foundry extension and `#[ResetDatabase]`. ## References - `reference.md`
© dev-toolings · MIT · dev-toolings/superpowers-symfony