doctrine-migrations — Claude Code skill for Doctrine migrations
Create and review Doctrine migrations, prepare rollbacks, and check pending changes before deployment. Useful when a Symfony app’s entity mapping changes.
MIT ★ 234 updated 2026-10-05
npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a claude-codeWhat doctrine-migrations does
The skill guides migration work from a mapping change to execution. It uses make:migration or doctrine:migrations:diff to generate a file, then calls for reviewing each SQL statement and making sure down() reverses up(). It also covers checking migration status and running a dry run before applying changes.
For reversals, it describes doctrine:migrations:migrate prev and doctrine:migrations:execute --down. With multiple entity managers, pass --em to each migration command. Never modify a migration that has already been applied; create another one instead. Keep data changes separate from schema diffs.
all_or_nothing is mostly effective on PostgreSQL. Most MySQL DDL commits implicitly, so that setting does not provide the same group rollback there. The skill guides the developer through review and execution, but production SQL still needs to be checked before it runs.
What it helps with
- generate a migration after changing entity mapping
- inspect SQL produced by a migration diff
- write a
down()method that reversesup() - check pending migrations before applying them
- prepare a rollback command for a deployed version
Example prompts for the agent
- Create a Doctrine migration for the new field in my entity mapping.
- Review this migration for a column drop-and-add and verify that
down()reversesup(). - Check migration status, run a dry run, and prepare the production rollback command.
How to install doctrine-migrations
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a claude-code2Manually: put the files in place
~/.claude/skills/doctrine-migrations/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/doctrine-migrations/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a codex2Manually: put the files in place
.agents/skills/doctrine-migrations/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a cursor2Manually: put the files in place
.cursor/skills/doctrine-migrations/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dev-toolings/superpowers-symfony content/skills/doctrine-migrations2Manually: put the files in place
.github/skills/doctrine-migrations/SKILL.md1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a gemini-cli2Platform CLI
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/doctrine-migrationsManually: put the files in place
.devin/skills/doctrine-migrations/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-migrations
How do I install doctrine-migrations in Claude Code?
Run npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a claude-code. The skill file is at ~/.claude/skills/doctrine-migrations/SKILL.md.
What does the doctrine-migrations skill do?
It guides the creation and review of Doctrine migration files, including SQL checks and rollback logic. It also covers status checks and dry runs before applying migrations.
How does the skill handle multiple entity managers and MySQL?
It advises passing --em to every migration command when several entity managers are involved. all_or_nothing is mostly effective on PostgreSQL because MySQL often commits DDL implicitly.
Source text
SKILL.md · MIT
--- name: doctrine-migrations description: Create and manage Doctrine migrations (bundle 4.x, library 3.9) for schema versioning; handle dependencies, rollbacks, and production deployment capabilities: [read, search, edit, shell] tags: [doctrine] # projected by `bun run build` — do not edit by hand allowed-tools: - Read - Glob - Grep - Write - Edit - Bash --- # Doctrine Migrations (Symfony) ## Use when - A mapping change needs a schema migration (new column, index or table). - Reviewing a generated `make:migration` or `doctrine:migrations:diff` file before it is applied. - Rolling back a version, or deploying pending migrations to production. - Tuning `doctrine_migrations.yaml` (`transactional`, `all_or_nothing`, `enable_service_migrations`). ## Default workflow 1. Change the entity mapping, then generate the migration with `make:migration` or `doctrine:migrations:diff`. 2. Read every `addSql()` line: a rename can appear as drop plus add, and index churn is common. 3. Write a real `down()` that reverses `up()`, and keep one concern per migration. 4. Check `doctrine:migrations:status`, preview with `doctrine:migrations:migrate --dry-run`, then run `doctrine:migrations:migrate`. 5. Roll back with `doctrine:migrations:migrate prev` or `doctrine:migrations:execute` with `--down`. 6. With several entity managers, pass `--em` to every migrations command. ## Guardrails - Never edit an already-applied migration: add a new one. - Keep diff-generated migrations schema only; put data changes in a dedicated, idempotent migration or command. - Keep the typed signatures `up(Schema $schema): void` and `down(Schema $schema): void`. - `all_or_nothing` is mostly effective on PostgreSQL, since most MySQL DDL commits implicitly. ## Progressive disclosure - Use this file for execution posture and risk controls. - Open references when deep implementation details are needed. ## Output contract - Migration files with a reviewed `up()` and a working `down()`. - Output of `doctrine:migrations:status` and the dry-run, plus the rollback command. - Any `doctrine_migrations.yaml` change and why. ## References - `reference.md`
© dev-toolings · MIT · dev-toolings/superpowers-symfony