Migrate

From softspark/ai-toolkit · View interactive version

Migrate is an AI agent skill from the GitHub repository softspark/ai-toolkit. Run/create DB migrations (Alembic, Prisma, Laravel, Django, Flyway, Drizzle); checks backup. Triggers: apply migration, rollback, generate migration.

How to use this skill

Skill file

/migrate - Database Migration Workflow

$ARGUMENTS

What This Command Does

Create, run, or manage database migrations with auto-detection of the migration tool.

Project context

Migration Status Script

Detect migration tool and report status:

python3 ${CLAUDE_SKILL_DIR}/scripts/migration-status.py [directory]

Returns JSON with: tool, config_file, migrations_dir, total_migrations, latest, commands{} (status/create/upgrade/downgrade).

Auto-Detection

| File Found | Tool | Commands |

|------------|------|----------|

| alembic.ini | Alembic | alembic revision, alembic upgrade |

| prisma/schema.prisma | Prisma | npx prisma migrate dev |

| database/migrations/ + artisan | Laravel | php artisan migrate |

| manage.py | Django | python manage.py migrate |

| flyway.conf | Flyway | flyway migrate |

| drizzle.config.ts | Drizzle | npx drizzle-kit push |

Workflow

Create New Migration

  1. Detect migration tool
  2. Generate migration from model/schema changes
  3. Review generated SQL
  4. Validate syntax

Run Migrations

  1. Show pending migrations
  2. Dry-run if supported (--pretend, --sql)
  3. Backup reminder
  4. Apply with user confirmation
  5. Verify success

Rollback

  1. Show last applied migration
  2. Confirm rollback scope
  3. Execute rollback
  4. Verify state

Safety Checks (MANDATORY)

Usage Examples

/migrate                     # Show migration status
/migrate create add_users    # Create new migration
/migrate run                 # Apply pending migrations
/migrate rollback            # Rollback last migration
/migrate status              # Show applied/pending migrations

Reference Skill

Use migration-patterns skill for zero-downtime strategies and best practices.

Rules

Gotchas

When NOT to Use

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.