Migrate
Ask reviewImplement migration scripts, adapters, and data transforms
Dependencies
Hat Sequence
Integration Tester
Focus: Verify that migration scripts produce correct output against a non-production target. Test the full pipeline: extraction, transformation, loading, and post-loadd constraint enforcement. Cover the happy path, edge cases from the mapping spec, and failure/recovery scenarios.
Produces: Integration test suite with coverage of happy path, edge cases, constraint verification, and failure recovery.
Reads: Mapping specification, migration scripts from the migration-engineer, edge-case documentation.
Anti-patterns (RFC 2119):
- The agent MUST NOT test only the happy path and declaring victory
- The agent MUST NOT compar row counts without verifying field-level content
- The agent MUST NOT run tests against a stale or unrepresentative dataset
- The agent MUST test idempotency (run twice, check for duplicates)
- The agent MUST NOT skip failure injection (what happens when the target is unreachable mid-batch?)
Migration Engineer
Focus: Implement the migration scripts, adapters, and data transforms specified in the mapping document. Every script must be idempotent, logged, and runnable in dry-run mode. Prioritize correctness and recoverability over speed — a fast migration that corrupts data is not a migration.
Produces: Migration scripts, data adapters, and transformation logic with dry-run capability and execution logs.
Reads: Mapping specification, target system API/schema documentation, risk register for ordering constraints.
Anti-patterns (RFC 2119):
- The agent MUST NOT write one-shot scripts that fail silently on re-run
- The agent MUST NOT hardcode connection strings or credentials instead of parameterizing
- The agent MUST NOT skip dry-run mode because "it works on my machine"
- The agent MUST NOT migrate everything in a single transaction that can't be checkpointed
- The agent MUST NOT ignore the mapping spec and improvising transformations in code
Review Agents
Data Integrity
Mandate: The agent MUST verify migration scripts preserve data integrity.
Check:
- The agent MUST verify that row counts reconcile between source and target
- The agent MUST verify that foreign key relationships are maintained after migration
- The agent MUST verify that no data truncation from field size differences
- The agent MUST verify that idempotency: running the migration twice does not corrupt data
- The agent MUST verify that error handling captures and reports failed records without halting the entire migration
Migrate
Criteria Guidance
Good criteria examples:
- "Migration scripts are idempotent — re-running produces the same result without duplicating data"
- "Integration tests cover at least: happy path, null handling, encoding edge cases, and constraint violations"
- "Dry-run mode exists and produces a diff report without writing to the target"
Bad criteria examples:
- "Scripts work"
- "Data is migrated"
- "Tests pass"
Completion Signal
Migration scripts exist and execute against a non-production target. Each script is idempotent and logged. Integration tests verify row counts, type fidelity, constraint satisfaction, and referential integrity. Dry-run output matches expectations from the mapping spec.