migration-gen

Generate up and down database migration files from schema changes.

11|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/berkcangumusisik/claude-code-practices --skill migration-gen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migration-gen
Source: https://github.com/berkcangumusisik/claude-code-practices/tree/main/skills/migration-gen
Command: npx skills add https://github.com/berkcangumusisik/claude-code-practices --skill migration-gen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the creation of database migration files from schema changes, reducing manual effort and risk.

Core Features & Use Cases

  • Detects ORM/migration tool usage and reads current schema state.
  • Generates up and down migrations with safeguards for destructive changes, and supports additive and data migrations.
  • Provides deployment guidance and rollback strategies for production environments.

Quick Start

Describe your schema change and run the migration-gen command to generate up and down migrations.

Frequently Asked Questions about migration-gen

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

FAQPage Schema
How do I generate database migrations for schema changes automatically?

To generate database migrations, describe your desired schema change and run the migration generation process. The system reads your current schema state and automatically produces up and down migration files with built-in safety checks for destructive changes.

Does this tool support generating migrations with Prisma, Drizzle, and Knex?

Yes, migration generation works with major ORMs and tools like Prisma, Drizzle, TypeORM, Knex, and raw SQL workflows. It detects your specific ORM setup and generates compatible migration files accordingly.

Can I generate rollback-friendly down migrations for destructive schema changes?

Yes, you can generate rollback-friendly down migrations. The system automatically creates both up and down migration files and applies safety checks specifically designed to safeguard and reverse destructive schema changes.

What is the best way to handle data migrations and deployment guidance for production?

For data migrations and production deployment, the system provides dedicated deployment guidance and rollback strategies. It handles additive, destructive, and data migrations while ensuring safe production rollouts.

How do I create up and down migrations using raw SQL workflows?

You can create up and down migrations using raw SQL workflows by describing your schema change. The system detects your raw SQL setup and generates corresponding rollback-safe migration files without requiring an ORM.

Why do I need safety checks for destructive database schema migrations?

Safety checks for destructive schema migrations are needed to prevent data loss during deployment. The generation process identifies potentially harmful changes and produces rollback strategies to ensure safe production environments.