Skip to content
Back to skills

Migration Gen

ASecurity

Generates a database migration file for schema changes

  • 10 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 1, 2026
ai-agentsbashsqldatabase

Security analysis

A100/100

Scanned June 1, 2026

npx -y skills add berkcangumusisik/claude-code-practices --skill migration-gen --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Migration Gen?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Migration Gen
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/berkcangumusisik-migration-gen/badge)](https://www.skillsdirectory.com/skills/berkcangumusisik-migration-gen)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: migration-gen
description: Generates a database migration file for schema changes
argument-hint: <description-of-change>
user-invocable: true
allowed-tools: Read Glob Bash Edit
effort: low
---

## Generate Database Migration

Change: **$ARGUMENTS**

1. Detect ORM/migration tool:
```bash
cat package.json | grep -E '"prisma"|"drizzle"|"typeorm"|"knex"|"sequelize"|"migrate"'
ls prisma/ migrations/ db/migrations/ 2>/dev/null | head -10
```

2. Read the current schema:
```bash
cat prisma/schema.prisma 2>/dev/null || ls migrations/ 2>/dev/null | tail -3 | xargs -I{} cat migrations/{}
```

3. Generate the migration based on the requested change:
   - Additive changes (new table, new column with default) - safe
   - Destructive changes (drop column, rename) - add warning and suggest renaming strategy
   - Data migrations - separate from schema migrations

4. For Prisma: generate migration name and schema change, then ask to run:
```bash
npx prisma migrate dev --name $ARGUMENTS
```

For raw SQL: generate up/down migration files.

5. **Always generate a `down` migration** (rollback).

6. Flag any changes that require a deployment strategy (e.g., add-then-backfill, not rename directly).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.