skills/data-migration-specialist/SKILL.md
Large-scale data migrations with validation, rollback, and zero-downtime strategies. Activate on: data migration, database migration, zero-downtime migration, dual-write, backfill, cutover, data validation, schema migration. NOT for: schema evolution in streams (use schema-evolution-manager), API versioning (use api-versioning-backward-compatibility).
npx skillsauth add curiositech/windags-skills data-migration-specialistInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Plan and execute large-scale data migrations with zero-downtime strategies, comprehensive validation, and reliable rollback plans.
Activate on: "data migration", "database migration", "zero-downtime migration", "dual-write", "backfill", "cutover", "data validation", "schema migration", "platform migration", "cloud migration"
NOT for: Streaming schema evolution → schema-evolution-manager | API backward compatibility → api-versioning-backward-compatibility | Warehouse optimization → data-warehouse-optimizer
| Domain | Technologies | |--------|-------------| | Strategies | Dual-write, CDC-based, big bang, strangler fig | | CDC Tools | Debezium, AWS DMS, GCP Datastream, pglogical | | Validation | Great Expectations, custom checksums, row-count reconciliation | | Schema | Flyway, Liquibase, Prisma Migrate, Alembic | | Orchestration | Airflow, Temporal, custom migration scripts |
Phase 1: Dual-Write (days/weeks)
──────────────────────────────────
App writes → Old DB (primary)
→ New DB (shadow, async)
Reads from: Old DB only
Phase 2: Shadow Read Validation
──────────────────────────────────
App writes → Old DB + New DB
Reads from: Old DB (primary)
New DB (shadow, compare results)
Phase 3: Cutover
──────────────────────────────────
App writes → New DB (primary)
→ Old DB (shadow, for rollback)
Reads from: New DB
Phase 4: Cleanup
──────────────────────────────────
App writes → New DB only
Remove old DB writes
Decommission old DB (after rollback window expires)
class MigrationValidator:
"""Run after each migration phase to verify data integrity."""
def validate_row_counts(self):
"""Source and target row counts must match within tolerance."""
for table in self.tables:
source = self.source_db.count(table)
target = self.target_db.count(table)
tolerance = 0.001 # 0.1% tolerance for in-flight writes
assert abs(source - target) / source < tolerance, \
f"{table}: source={source}, target={target}"
def validate_checksums(self):
"""Hash comparison on sampled rows."""
for table in self.tables:
sample_ids = self.source_db.sample_ids(table, n=10000)
for batch in chunked(sample_ids, 1000):
source_hash = self.source_db.hash_rows(table, batch)
target_hash = self.target_db.hash_rows(table, batch)
assert source_hash == target_hash, \
f"{table}: checksum mismatch in batch"
def validate_business_rules(self):
"""Domain-specific invariants."""
# Example: total revenue must match
source_rev = self.source_db.query("SELECT SUM(amount) FROM orders")
target_rev = self.target_db.query("SELECT SUM(amount) FROM orders")
assert source_rev == target_rev, "Revenue mismatch!"
def validate_constraints(self):
"""All FKs, unique constraints, and NOT NULLs hold on target."""
violations = self.target_db.check_constraints()
assert len(violations) == 0, f"Constraint violations: {violations}"
Migration issue detected?
│
├─ Data loss or corruption? → IMMEDIATE ROLLBACK
│ Switch reads/writes back to old DB
│ Replay writes from new DB → old DB (if needed)
│
├─ Performance regression? → EVALUATE
│ ├─ < 2x slower → optimize, do not rollback
│ └─ > 2x slower → rollback, investigate
│
└─ Minor data discrepancy? → FIX FORWARD
Run reconciliation job to sync
Do NOT rollback for fixable issues
Rollback window: keep old DB live for 7-14 days post-cutover
data-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.