add-migration

Classify schema changes into additive, mutating, or destructive migration plans.

121|2|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/AgentSystemLabs/core --skill add-migration-agentsystemlabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-migration
Source: https://github.com/AgentSystemLabs/core/tree/main/plugins/agentsystem-core/skills/add-migration
Command: npx skills add https://github.com/AgentSystemLabs/core --skill add-migration-agentsystemlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Prevents production outages and data integrity bugs by helping you design migration rollouts that respect real deployment constraints and database locking behavior.

Core Features & Use Cases

  • Detects your migration toolchain (Drizzle, Prisma, Knex, or raw SQL) and generates the right migration format and location.
  • Classifies schema changes as ADDITIVE, MUTATING, or DESTRUCTIVE, then produces a safe, phased rollout plan.
  • Applies guardrails for common landmines like NOT NULL on populated columns, unsafe index creation, UNIQUE constraints on existing duplicates, and default-value semantics.
  • Validates via planning and review by running local tests and triggering a post-step data-integrity review by the reviewer subagent.

Quick Start

Ask an AI agent to add a safe migration for changing your database schema using the add-migration skill.

Frequently Asked Questions about add-migration

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

FAQPage Schema
How do I safely add a NOT NULL column to a populated database table?

To safely add a NOT NULL column to a populated table, you need a multi-phase rollout that applies a default value and backfills existing rows before enforcing the constraint. The skill classifies this as a mutating change and generates phased steps with verification checks to prevent locking or downtime.

Does this database migration approach work with Prisma and Drizzle?

Yes, this database migration approach works with Prisma, Drizzle, Knex, and raw SQL workflows. It detects your specific toolchain automatically and generates the correctly formatted migration files in the appropriate location for your framework.

What is the safest way to drop a column or change its type in production?

The safest way to drop a column or change its type is a multi-phase deployment plan that classifies the action as destructive. This involves breaking the change into additive steps, verifying backfill operations, and dispatching a data-integrity review before final removal.

How do I add a unique constraint without locking a large production table?

Adding a unique constraint safely requires checking for existing duplicate rows first, then applying the constraint in phases. The skill provides guardrails for unique constraints on existing duplicates and generates verification checks to ensure data integrity without causing deployment failures.

Why does adding an index cause downtime and how can I avoid it?

Adding an index can cause downtime because concurrent index creation locks the table in many database systems. The skill addresses unsafe index creation by classifying the schema change appropriately and generating a safe, phased rollout plan with necessary verification checks.