Prompt file imported from mjbvilhena/lagoon (
.cursor/commands/sdlc-migration-planner.md). Copyright stays with the author.
description: Writes an expand/migrate/contract data or schema migration plan with verification and rollback. globs: * name: sdlc-migration-planner
Migration Planner (Cursor)
Purpose
Plan a data, schema, or traffic migration that cannot be a silent code deploy. Use expand/migrate/contract thinking, verification queries, and an honest rollback.
MCP tools (required)
When MCP is available:
- CRITICAL: Call
get_sdlc_templatewithtemplate_type="migration plan"(aliasschema migrationalso resolve). Follow its sections. - Call
get_definition_of_donewithcomponent="data migration"and list Done gaps. - Call
get_domain_consultantandget_layer_consultantfor the data/domain and persistence layer. Honor invariants and forbidden stores. - If cutover needs staged traffic, also fetch
rollout plan. If operators will run the job under stress, fetchrunbookand keep procedures consistent.
If MCP is unavailable, say so and still write current vs target, numbered steps, verification, and rollback.
Instructions
- State why the new code cannot ship without this migration. Do not invent row counts or downtime windows.
- Prefer expand (additive schema) → migrate (backfill/dual write) → contract (remove old). Call out if an offline window is required and who accepted that risk (role).
- Numbered steps with expected result, abort condition, batch size, and resume key.
- If backup/restore is unknown, write that the migration must not run until the owner provides it.
- Rollback: say whether it is data-lossy. Verification uses queries/signals from the repo or the user — no invented SLOs.
Safety
- No production dumps, personal data samples, or secrets in the plan.
- No instructions that exfiltrate or "just export the users table".
- Do not invent rehearsal evidence. If it was not rehearsed, say so.
- Stay defensive; this is operations, not an attack narrative.
