mgiovani/ai-arsenal / skills/db-migrate
db-migrate
VerifiedCreates, checks the status of, and validates database migrations by auto-detecting the project's migration framework (Alembic, Prisma, Knex, Django, Rails/ActiveRecord, Flyway, Atlas, TypeORM, Sequelize, SQLx, golang-migrate, Liquibase) from marker files, then driving that framework's own CLI. Use when the user wants to create a new migration, check pending vs. applied migration status, or validate a migration for a missing rollback script, a missing foreign-key index, or a destructive operation like DROP TABLE / TRUNCATE / DELETE FROM. Trigger phrases include "create a migration", "check migration status", "any pending migrations", "validate this migration", "does this migration have a rollback". Not for designing the schema change itself or writing ORM model code (use implement-feature), this skill only manages migration files and framework tooling once the schema change is already decided.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.4 KB |
| evals/evals.json | config | 3.9 KB |
| evals/trigger-eval.json | config | 2.1 KB |
| references/framework-commands.md | markdown | 6.7 KB |
evals/evals.json
View on GitHub{
"skill": "db-migrate",
"evals": [
{
"id": "alembic-create-happy-path",
"prompt": "This is a Python project with alembic.ini at the root and SQLAlchemy models. Create a new migration named add_users_email_index.",
"assertions": [
"The run detects Alembic from the presence of alembic.ini before doing anything else, and does not guess a different framework's command.",
"The command actually executed to create the migration is `alembic revision --autogenerate -m \"add_users_email_index\"` (or an equivalent alembic revision invocation with that migration name) — no invented CLI flags or a non-alembic tool.",
"The final report shows the real generated file path and reads back its actual up/down content rather than asserting success without showing the file.",
"The report reminds the user to review the autogenerated migration and check for missing indexes/rollback, consistent with the skill's ground rules."
]
},
{
"id": "destructive-drop-table-judgment",
"prompt": "Validate the migration file migrations/20260716_cleanup.js — it drops the legacy_sessions table. Repo uses Knex (knexfile.js present).",
"assertions": [
"The run greps the migration file for destructive patterns (DROP TABLE/DROP COLUMN/TRUNCATE/DELETE FROM equivalents) and identifies the dropTable('legacy_sessions') call as destructive, citing the file and the relevant line/content.",
"The run explicitly warns about the destructive operation and states it requires the user's explicit confirmation before being treated as safe to apply — it does not silently approve the migration or downgrade the severity.",
"The run does not modify, rewrite, or 'auto-fix' the migration file — no Edit/Write call altering migrations/20260716_cleanup.js.",
"The run also checks whether a rollback (down/exports.down) exists for this migration and reports its presence or absence as a separate, distinct finding from the destructive-operation warning.",
"No migration-apply command (e.g. npx knex migrate:latest) is executed as part of validation — validate only inspects, it never applies."
]
},
{
"id": "no-framework-detected-refusal",
"prompt": "Create a migration to add a phone_number column to the users table.",
"assertions": [
"The run checks for marker files (alembic.ini, prisma/schema.prisma, knexfile.*, flyway.conf/toml, db/migrate/, manage.py, atlas.hcl, typeorm.config.*/ormconfig.*, liquibase.properties) and dependency hints in package.json/pyproject.toml/requirements.txt/Gemfile before concluding no framework is detected.",
"Given no marker file or dependency hint exists in the project, the run does not invent or guess a migration framework or CLI command.",
"No migration file is created and no framework CLI (alembic, prisma, knex, rails, manage.py, etc.) is invoked anywhere in the run.",
"The run's final message asks the user which migration framework/tool they use (or confirms none exists yet) and stops there — it does not proceed further or block on additional unrelated questions."
]
},
{
"id": "multi-framework-monorepo-disambiguation",
"prompt": "Check migration status. This repo has both api/alembic.ini and web/prisma/schema.prisma.",
"assertions": [
"The run detects both Alembic (api/) and Prisma (web/) as candidate frameworks from their respective marker files.",
"Because two frameworks are present, the run asks the user which one/service they mean rather than picking one arbitrarily or running both without confirmation.",
"No status command (alembic current, npx prisma migrate status, etc.) is executed before the disambiguating question is asked and answered.",
"The question names both concrete options (Alembic in api/, Prisma in web/) rather than asking a vague 'which framework' with no context."
]
}
]
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |