Reviews database schema migrations for destructive or risky operations before production deployment. Detects dropped columns/tables, non-nullable adds without defaults, renames that drop data, type changes, and long-locking operations.
Ships in AI for Developers Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Catch data-loss and downtime risks in a schema migration before it runs in production, and suggest a safer rewrite (often an expand/contract split). The risks are the same in every tool; only the syntax differs.
Works on a target: a migration file, a migrations folder, a project/repo, or a GitHub URL. Review the most recent unapplied migration(s) first. Always read both directions (up/down) when the tool has them, and look at the SQL that will actually run, not just the ORM DSL.
| Manifest / signal | Tool | Where migrations live | See the real SQL with |
|---|---|---|---|
*.csproj + Microsoft.EntityFrameworkCore.Design | EF Core | Migrations/*.cs (skip *.Designer.cs, *ModelSnapshot.cs) | dotnet ef migrations script <from> <to> |
package.json + prisma | Prisma Migrate | prisma/migrations/*/migration.sql | the migration.sql itself; prisma migrate diff |
package.json + typeorm / drizzle-kit / knex | TypeORM / Drizzle / Knex | src/migrations, drizzle/*.sql, migrations/*.js | generated SQL / up() body |
alembic.ini, sqlalchemy | Alembic | alembic/versions/*.py | alembic upgrade <rev> --sql (offline mode) |
django in deps | Django | <app>/migrations/*.py | python manage.py sqlmigrate <app> <name> |
pom.xml/build.gradle + flyway | Flyway | db/migration/V*__*.sql | the SQL file |
pom.xml/build.gradle + liquibase | Liquibase | db/changelog/*.xml/yaml/sql | liquibase update-sql |
go.mod + golang-migrate / goose | golang-migrate / goose | *.up.sql + *.down.sql / -- +goose Up/Down | the SQL file |
# find candidate migration files
find <target> \( -path "*Migrations*" -name "*.cs" ! -name "*.Designer.cs" ! -name "*Snapshot.cs" \) \
-o -path "*prisma/migrations*" -name "migration.sql" -o -path "*alembic/versions*" -name "*.py" \
-o -path "*/migrations/*" -name "*.py" -o -name "V*__*.sql" -o -name "*.up.sql" | grep -v node_modules
Also establish the database engine (locking behavior differs a lot) and, if the user knows, table sizes.
NOT NULL; or add with a default.varchar to int, precision change) - can truncate, fail on existing rows, or force a full table rewrite.NOT NULL, FK or CHECK constraint validation, column type rewrite. Use online/concurrent variants (see engine notes).UPDATE inside the migration transaction holds locks for its whole run. Batch it, or run it as a separate job.CREATE INDEX CONCURRENTLY (cannot run inside a transaction); add FKs/CHECKs as NOT VALID then VALIDATE CONSTRAINT; set lock_timeout so a blocked DDL doesn't queue every query behind it. Adding a column with a constant default is metadata-only on 11+.CREATE INDEX ... WITH (ONLINE = ON) (edition-dependent); adding a NOT NULL column with a default is metadata-only on Enterprise 2012+, otherwise a size-of-data operation.ALGORITHM=INPLACE|INSTANT, LOCK=NONE support for the specific change; for big tables consider gh-ost or pt-online-schema-change.ALTER changes mean a table rebuild - fine for small DBs, plan for it otherwise.Read Up() and Down(). Watch for DropColumn/DropTable, AddColumn(nullable: false) without defaultValue, and drop+add pairs that should be RenameColumn/RenameTable. For concurrent/online builds use migrationBuilder.Sql(...) with suppressTransaction: true. Generate an idempotent script for production (dotnet ef migrations script --idempotent) rather than Database.Migrate() at app startup on multi-instance deployments.
Prisma: always read migration.sql; Prisma warns about data loss in dev but the SQL is the source of truth - edit it (e.g. CREATE INDEX CONCURRENTLY, rename instead of drop+add) before migrate deploy. TypeORM/Knex: check up()/down() pairs; disable the per-migration transaction where the engine requires it for concurrent DDL. Drizzle: review the generated .sql, especially rename prompts.
Alembic: autogenerate never detects renames - check for drop_column + add_column pairs; for concurrent indexes use op.create_index(..., postgresql_concurrently=True) inside with op.get_context().autocommit_block():. Django: check RemoveField/DeleteModel, AlterField to non-null, and RunPython without reverse_code; set atomic = False for AddIndexConcurrently; use SeparateDatabaseAndState for staged removals.
Never edit an applied V__ script; add a new one. Liquibase: check every changeSet has a rollback (or is auto-rollbackable) and runInTransaction="false" where concurrent DDL needs it. Make sure spring.jpa.hibernate.ddl-auto is validate or none in production, not update.
Every .up.sql needs a matching .down.sql (goose: -- +goose Down). For concurrent index builds in goose use -- +goose NO TRANSACTION; golang-migrate runs files as given, so keep concurrent DDL in its own file.
For risky renames/type changes on live systems, split across deploys:
## Verdict: safe / risky / data-loss
<tool + engine detected; files reviewed>
## Findings
🔴 <op> at <file:line> - <risk> -> <safer approach>
🟡 ...
## Suggested rewrite
<migration code in the same tool's format, or the expand/contract plan>
## Before you run
<backup / backfill / lock_timeout / off-peak / table-size notes>
"Review this migration before I deploy", "will this Prisma migration lose data", "make this column rename safe on a live table", "split this risky Alembic revision into expand/contract", "is this Flyway script safe on a 50M-row table". Pairs with db-index-advisor.
What SKILL.md sets; muted values are Claude Code's defaults
/ai-dev-toolkit:db-migration-reviewerfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkit45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure.Other plugins' skills for the same job