---
name: migrate-domain
description: Create, inspect, apply, or roll back Alembic migrations for a domain while treating autogenerated revisions as review-required output.
metadata:
  short-description: Alembic migration workflow
---

# Migrate Domain

## Default Flow Position
- Step: `implement` + feeds `verify` (`alembic upgrade head` + `/test-domain {name} run`)
- `approach options` upstream conditional — required for indexed-column changes, constraint alterations, or backfills
- Recursion guard: n/a (manual user invocation only)

## Procedure
1. Read `docs/ai/shared/skills/migrate-domain.md` for the full procedure.
2. Confirm the requested action: `generate`, `upgrade`, `downgrade`, or `status`.
3. Verify the target model change and environment configuration first.
4. For `generate`, create the revision and review before applying.
5. Treat autogenerate output as a draft: renames and destructive changes need manual review.
6. Verify the resulting revision state and recommend integration tests.
