home / skills / shotaiuchi / dotclaude / migration-data
This skill guides safe database migrations and schema changes, ensuring data integrity and backward compatibility across formats, configurations, and records.
npx playbooks add skill shotaiuchi/dotclaude --skill migration-dataReview the files below or copy the command above to add this skill to your agents.
---
name: migration-data
description: >-
Data migration and schema changes. Apply when handling database schema
migrations, data format conversions, serialization updates, configuration
migration, and data integrity verification.
user-invocable: false
---
# Data Migration
Handle data and schema migrations safely.
## Migration Checklist
### Schema Migration
- Define forward and reverse schema migration scripts
- Verify schema changes are backward compatible where needed
- Check for data type changes that may cause truncation or loss
- Ensure index and constraint updates are included
### Data Format Conversion
- Identify all serialization format changes
- Implement data transformation for existing records
- Verify date, time, and locale format compatibility
- Check for encoding changes affecting stored data
### Configuration Migration
- Map old configuration keys to new equivalents
- Provide default values for newly required settings
- Validate migrated configuration against new schema
- Ensure environment-specific overrides are preserved
### Data Integrity
- Verify referential integrity after migration
- Run checksums or row counts to confirm completeness
- Check for orphaned records or dangling references
- Validate business logic constraints on migrated data
## Output Format
Report findings with risk ratings:
| Risk | Description |
|------|-------------|
| Critical | Data loss or corruption possible, blocks migration |
| High | Data integrity at risk, requires careful validation |
| Medium | Format change may affect downstream consumers |
| Low | Minor configuration update, low risk of issues |
This skill helps plan and execute data and schema migrations safely. It groups checks for schema changes, data format conversions, configuration migration, and integrity verification into actionable steps and risk-rated findings. Use it to reduce data loss, preserve compatibility, and validate results before cutover.
The skill inspects proposed schema changes and generates forward and reverse migration scripts, highlighting type changes, index updates, and compatibility concerns. It analyzes data format shifts and configuration mappings, recommending transformations and default values. After migration, it runs integrity checks such as referential verification, checksums, and row-count comparisons and produces a risk-rated report.
What risk levels mean for migration decisions?
Critical indicates potential data loss that should block the migration. High means integrity risks that need remediation. Medium signals downstream compatibility impacts. Low denotes minor, low-risk changes.
How do I verify a rollback will work?
Maintain reverse scripts, test reversions on staging snapshots, and validate post-rollback integrity with the same checks used after forward migration.