DB Migration Safety Auditor

    1

    Audit SQL, Rails, Django, and Prisma migrations for blocking locks, data loss, and deployment breaking changes.

    $15

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    DB Migration Safety Auditor

    Example session with this skill installed

    Review this Rails migration adding a foreign key: add_reference :orders, :users, foreign_key: true, index: false. The orders table has 50 million rows.

    • Read your context and instructions
    • Compiled the db migration safety

    I have reviewed the migration for orders. While the syntax is correct, this will cause a significant blocking lock on a 50M-row table.

    Migration Review — orders

    Risk LevelTypeFindingImpact
    BlockingTable Lockadd_reference :orders, :usersAdding a foreign key constraint requires a full table scan to validate existing data, locking the orders table for the duration.
    BlockingIndex Lockadd_index :orders, :user_idIf you later add the index manually, a standard add_index will lock writes to orders.
    Data-riskConstraintforeign_key: trueValidation will fail if there are orphaned user IDs in the orders table.

    Safer approach:
    To avoid a production outage, split this into three steps:

    1. Add the column without the constraint: add_column :orders, :user_id, :bigint.
    2. Add the index concurrently (PostgreSQL): add_index :orders, :user_id, algorithm: :concurrently.
    3. Add the foreign key without validation, then validate it separately:
    add_foreign_key :orders, :users, column: :user_id, validate: false
    
    # In a separate migration
    validate_foreign_key :orders, :users
    

    Next steps

    • Verify if any orders rows contain user_id values that do not exist in the users table.
    • Confirm you are running PostgreSQL to use the concurrently algorithm.
    • Schedule the validate_foreign_key step for a lower-traffic window.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Prevent production outages caused by long-running table locks.Identify migrations that will break currently running app versions.Generate multi-step 'expand and contract' scripts for safe schema changes.Ensure all database changes have reliable rollback and downgrade paths.

    About this skill

    The problem

    Migrations that run instantly on a local machine can take production tables offline for minutes. Standard AI agents focus on schema correctness but ignore how databases execute changes under load or during rolling deploys.

    What it does

    • Scans migration files for blocking locks, non-concurrent indexes, and unsafe type changes.
    • Identifies backward-incompatible changes that break blue-green deployments.
    • Detects irreversible operations like empty downgrades or lossy retypes.
    • Provides concrete "expand and contract" rewrite strategies for high-risk operations.

    Frameworks & tools

    Supports raw SQL, Ruby on Rails (ActiveRecord), Python (Django, Alembic), and TypeScript (Prisma). Works with PostgreSQL and MySQL engines.

    Why this beats prompting it yourself

    Generic prompts often miss the multi-step nature of safe migrations. This skill applies a specific risk rubric to distinguish between safe changes on small tables and outage-causing locks on high-traffic ones, providing the actual code for the fix.

    Use cases

    • Reviewing PRs that modify schema files or add new migration scripts.
    • Auditing a migration plan for a table with millions of rows.
    • Ensuring zero-downtime compatibility for rolling application updates.
    • Validating that all database changes have a functional rollback path.

    Known limitations

    Does not audit schema design or naming conventions. Requires manual input or inference regarding table row counts to determine final lock severity.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 20 days ago

    • Passed all security checks, Safe to install

    Listed20 days ago
    Updated9 days ago

    What's inside

    Frequently Asked Questions