---
name: "migration-plan-writer"
description: "Plan an incremental schema migration with compatibility and recovery checks. Use when the user needs: Get ordered phases, validation queries, cutover criteria and rollback limits."
metadata: {"version": "2026-10-17.1", "category": "code-development", "publisher": "AIDiveForge"}
---

# Migration Plan Writer

Get ordered phases, validation queries, cutover criteria and rollback limits.

## Requirements

Provide before/after schemas, database engine, volume, deployment model and recovery constraints.

## Workflow

1. Identify destructive changes, lock risks, old/new application compatibility and the required recovery point.
2. Prefer expand, backfill, validate, switch and contract phases where both application versions need to coexist.
3. Define small resumable batches, stable checkpoints and reconciliation queries for any data backfill.
4. State rollback behavior for each phase, including when rollback requires restoring or replaying data.
5. Keep the output as a plan until the user has authorized the actual migration and the target is verified.

## Worked example

Read `examples/input.txt` and `examples/expected.txt` before adapting the workflow.

## Acceptance checks

A rename alone would break old readers. Include a check and rollback condition before every irreversible phase.

## Limits

The plan is not a guarantee of zero downtime. Engine-specific locks and recovery behavior require testing on a representative environment.

Worked example included. Model-specific performance and vendor compatibility have not been benchmarked.
