Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Enterprise Schema Migration Shield

    1

    DDL risk auditor & zero-downtime Expand/Contract blueprint synthesizer for PostgreSQL 12+.

    $14.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Enterprise Schema Migration Shield

    Enterprise Schema Migration Shield

    Example session with this skill installed

    Audit this SQL migration file for production database risks and generate a zero-downtime Expand/Contract blueprint:

    -- migrations/20261102_user_refactor.sql

    ALTER TABLE users ADD COLUMN phone_number VARCHAR(20) NOT NULL;
    ALTER TABLE users DROP COLUMN legacy_status;
    CREATE INDEX idx_users_email ON users(email);
    
    • Read your context and instructions
    • Compiled the enterprise schema migration

    DATABASE MIGRATION AUDIT: migrations/20261102_user_refactor.sql

    Migration Risk Score: 95/100 [CRITICAL (Destructive / Breaking Change)]
    Deployment Clearance: [REJECTED] (Violations: 3)

    1. Detected DDL Risks & Lock Class

    LineStatementRisk FindingPostgreSQL Lock
    1ADD COLUMN ... NOT NULLTable rewrite & default freeze on Postgres < 11; instant lock on active tablesACCESS EXCLUSIVE
    2DROP COLUMN legacy_statusImmediate breaking change for running application instancesACCESS EXCLUSIVE
    3CREATE INDEX idx_users_emailMissing CONCURRENTLY; blocks all concurrent reads/writes on tableSHARE (Blocks INSERT/UPDATE)

    2. Zero-Downtime Expand/Contract Blueprint Synthesized

    1. Phase 1 (Expand):
      • Add column without NOT NULL: ALTER TABLE users ADD COLUMN phone_number VARCHAR(20);
      • Add NOT NULL as NOT VALID constraint: ALTER TABLE users ADD CONSTRAINT check_phone_not_null CHECK (phone_number IS NOT NULL) NOT VALID;
      • Create index concurrently: CREATE INDEX CONCURRENTLY idx_users_email ON users(email);
    2. Phase 2 (Dual-Write): Deploy application dual-writing to phone_number. Backfill background worker.

    Phase 3 (Contract): Validate constraint concurrently: ALTER TABLE users VALIDATE CONSTRAINT check_phone_not_null; Safely drop old column after old service versions decommission.

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

    About this skill

    Enterprise PostgreSQL Schema Migration Shield (v2.2.0)

    When AI coding agents or development teams modify production databases, naive DDL statements trigger severe table locks, connection pool exhaustion, and unexpected production downtime.

    Common hazards include:

    • Adding NOT NULL columns without backfills or default lock avoidance.
    • Dropping or renaming live columns before retiring application versions.
    • Creating indexes synchronously without CONCURRENTLY, halting all transactional writes.

    This skill equips your AI coding agent with a preflight DDL risk auditor (33 codified rules) and an automated 3-phase Expand/Contract zero-downtime migration blueprint synthesizer.


    Key Capabilities:

    • Offline DDL Preflight Scanner: Audits raw SQL migration scripts for 33 distinct dangerous operations, assigning risk scores from 0-100 and determining exact PostgreSQL lock modes (ACCESS EXCLUSIVE, SHARE UPDATE EXCLUSIVE).
    • Expand/Contract Blueprint Synthesizer: Deconstructs hazardous migrations into safe 3-phase blueprints:
      • Phase 1 (Expand): Add backward-compatible nullable columns, concurrent indexes, and unvalidated check constraints.
      • Phase 2 (Dual-Write & Backfill): Application reads old, writes both; batch backfills run in small chunks.
      • Phase 3 (Contract): Validate constraints concurrently, drop obsolete columns and old indexes.
    • Backward-Compatibility Verification: Includes automated contract tests ensuring database clients continue reading seamlessly during rollout.

    Included Production Assets:

    • SKILL.md: Universal agent instructions adhering to open skill standards.
    • scripts/audit_migration.py: Standalone CLI auditor checking 33 DDL invariants (Python 3.8+ stdlib).
    • scripts/generate_expand_contract.py: Automated zero-downtime SQL migration generator.
    • templates/backward_compatibility_test.py: In-memory dual-client simulation test template.
    • references/destructive_ddl_catalog.md: Exhaustive index of Postgres locks and hazards.
    • references/expand_contract_playbook.md: Operational guide for phased schema evolution.

    Built by Conversionlogic (https://conversion-logic.github.io/)

    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 dynamic SQL inside DO blocks. Connection poolers in transaction mode require direct session port access for certain phases. Requires Python 3 standard library.

    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 15 days ago

    Software
    PythonprismaNode.jsdrizzle-kittypeorm

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed15 days ago

    What's inside

    Frequently Asked Questions

    This skill prevents production outages by auditing SQL for operations that trigger 'ACCESS EXCLUSIVE' locks. It transforms risky, single-step migrations into safe, 3-phase 'Expand/Contract' blueprints that maintain application availability.

    It is compatible with any agent that can execute Python scripts and handle SQL files, including AutoGPT, BabyAGI, and custom LangChain agents. It supports PostgreSQL 12+ environments like AWS Aurora, Supabase, and Neon.

    You receive the core audit engine (audit_migration.py), the blueprint generator (generate_expand_contract.py), a library of 33 production-hardened locking rules, and a detailed 6-stage rollout guide.

    Yes, the skill is designed to ingest raw SQL exported from popular ORMs like Prisma, Drizzle, Alembic, and Django. It identifies the risks inherent in ORM-generated code and provides the necessary workarounds.

    The skill provides specific keyset-based batch update scripts for backfilling. This ensures data is moved in throttled chunks, preventing the CPU and IO spikes that typically crash high-volume databases during large updates.

    New in Data & Databases