migration-safety

Detect dangerous database migration patterns and generate rollback plans.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/j-cogburn/d3 --skill migration-safety-j-cogburn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migration-safety
Source: https://github.com/j-cogburn/d3/tree/main/tests/project-t01/.d3/skills/migration-safety
Command: npx skills add https://github.com/j-cogburn/d3 --skill migration-safety-j-cogburn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database migrations are a leading cause of production incidents, irreversible data loss, and application downtime due to their high-risk nature and potential for unrecoverable schema or data changes.

Core Features & Use Cases

  • Dangerous Pattern Detection: Flags high-risk migration patterns including adding NOT NULL constraints without prior backfills, dropping columns/tables, unbatched large table updates, and adding unique constraints without duplicate checks.
  • Zero-Downtime Migration Guidance: Implements the expand-contract pattern to deploy destructive schema changes like column type changes or removals without application downtime.
  • Pre-Release Validation & Rollback Planning: Provides checklists to verify migration safety, confirm rollback paths exist, and document irreversible changes before production deployment.
  • Use Case Example: Use this skill when preparing a migration to add a new non-null column to a 10M row user table, ensuring you follow safe backfill steps instead of locking the table for hours.

Quick Start

Use the migration-safety skill to review your upcoming user table schema migration for dangerous patterns and generate a complete rollback plan before deploying to production.

Frequently Asked Questions about migration-safety

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent production incidents during database schema migrations?

Prevent production incidents during database schema migrations by enforcing safe migration patterns, detecting dangerous operations like unbatched updates, and mandating rollback path documentation before deployment. This validation approach avoids irreversible data loss and application downtime.

What is the expand-contract pattern for zero-downtime migrations?

The expand-contract pattern for zero-downtime migrations deploys destructive schema changes in phases: expanding the schema first, deploying application changes, then contracting by removing old columns. This avoids locking tables and prevents application downtime during column type changes or removals.

How do I safely add a NOT NULL column to a large production table?

Safely add a NOT NULL column to a large production table by following safe backfill steps rather than locking the table for hours. The migration-safety process flags dangerous patterns and validates pre-migration safety checks to ensure data integrity on large datasets.

Does migration safety validation work with NoSQL databases and ORM frameworks?

Migration safety validation works with all relational and NoSQL database systems and ORM migration frameworks. It applies to migration authoring, pull request review, and pre-release validation tasks to enforce safe patterns across diverse database environments.

What are the most dangerous database migration patterns to avoid?

Dangerous database migration patterns to avoid include adding NOT NULL constraints without prior backfills, dropping columns or tables, unbatched large table updates, and adding unique constraints without duplicate checks. Detecting these high-risk patterns prevents unrecoverable schema or data changes.

How do I create a rollback plan for a database migration?

Create a rollback plan for a database migration by using pre-release validation checklists to confirm rollback paths exist and document irreversible changes before production deployment. This ensures mandatory rollback procedures are prepared to prevent unrecoverable data loss.