with one click
database-migration
// Safely run database schema migrations. Use when asked to update database schema, add columns, create tables, run alembic, or apply Django migrations.
// Safely run database schema migrations. Use when asked to update database schema, add columns, create tables, run alembic, or apply Django migrations.
Design or review REST and GraphQL API interfaces. Use when asked to design an API, review endpoint structure, define request/response schemas, or improve API ergonomics.
Perform a structured security and quality audit on source code. Use when asked to review code, audit a pull request, check for vulnerabilities, or assess code quality.
Design, build, or debug data processing pipelines. Use when asked to process a dataset, transform data, build an ETL pipeline, schedule batch jobs, or fix data quality issues.
Audit project dependencies for vulnerabilities, license issues, and bloat. Use when asked to check dependencies, audit packages, find vulnerable libraries, or reduce bundle size.
Execute a structured deployment to staging or production. Use when asked to deploy, ship, release, push to production, or promote to staging.
Write or update technical documentation for code, APIs, or systems. Use when asked to document a module, write a README, generate API docs, or update existing documentation.
| name | database-migration |
| description | Safely run database schema migrations. Use when asked to update database schema, add columns, create tables, run alembic, or apply Django migrations. |
| license | MIT |
| compatibility | Requires python 3.10+ and one of alembic, django, or prisma |
Before executing any migration, you must have clear answers to all of the following. If any is missing or ambiguous, STOP and ask. Do not infer from filenames, branch names, or previous conversation context.
An agent that guesses the environment and gets it wrong has just migrated the wrong database. Ask first.
Identify the migration tool. Check the project for:
alembic.ini → Alembic (SQLAlchemy)manage.py → Django migrationsprisma/schema.prisma → Prisma
If none are found, ask the user which tool to use. Do not guess.Generate the migration.
alembic revision --autogenerate -m "description"python manage.py makemigrationsnpx prisma migrate dev --name descriptionReview the generated migration file. Read the entire file. Check for:
Dry run. If the tool supports it:
alembic upgrade head --sql (generates SQL without executing)python manage.py sqlmigrate <app> <migration_number>Apply the migration only after reviewing the dry run output.
Verify. Query the database schema directly to confirm the change took effect:
-- PostgreSQL
SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'target_table';
-- SQLite
PRAGMA table_info(target_table);
| Excuse | Rebuttal |
|---|---|
| "It's just an ADD COLUMN, I'll skip the review" | Schema locks can occur even on simple additions. Always review. |
| "The autogenerated migration looks correct" | Autogenerate guesses. It sometimes generates DROP + CREATE instead of ALTER. Read the file. |
| "I'll just run it — we can roll back" | Not all migrations are reversible. Dropping a column destroys data permanently. |