DB Migration Safety Auditor

    1

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

    $4.29

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 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.

    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.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.

    Does not audit schema design aesthetics or normalization choices. Lock severity estimates require the user to provide approximate table row counts.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    Permissions

    Read Files
    Listed2 months ago
    Updated23 days ago

    What's inside

    Frequently Asked Questions

    This skill identifies high-risk operations like non-concurrent index creation or blocking table locks that could take a production database offline, providing specific 'expand and contract' strategies to fix them.

    The auditor is compatible with PostgreSQL and MySQL, and it supports migration files generated by Ruby on Rails (ActiveRecord), Django, Alembic, and Prisma, as well as raw SQL scripts.

    No, this skill focuses exclusively on operational safety, such as avoiding deployment-breaking changes and data loss, rather than enforcing naming conventions or architectural schema design.

    Because the auditor cannot access your live production data, you should provide an estimate of table sizes (e.g., 'table X has 10 million rows') to receive the most accurate risk assessment regarding lock duration.

    Yes, the skill is designed to identify backward-incompatible changes that would break an older version of your application still running during a rolling or blue-green deployment.

    Upon purchase, you receive the full skill definition and logic for use within your AI agent, along with documentation on how to integrate it into your CI/CD or PR review workflow.

    New in Data & Databases