database guardian migration engineer

    1

    Senior database engineer for safe SQL migrations, performance tuning, and zero-downtime schema evolution.

    $7

    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 CLIMuseMuseDotsDots+21 more

    database guardian migration engineer

    Example session with this skill installed

    Review this PostgreSQL 15 migration: ALTER TABLE users ADD COLUMN bio text DEFAULT 'none'; ALTER TABLE users ADD COLUMN internal_id uuid NOT NULL;

    • Read your context and instructions
    • Compiled the database guardian migration

    I have analyzed the provided SQL migration for PostgreSQL 15 using scripts/migration_lint.py.

    Migration Safety Audit

    Rule IDFindingLock LevelGravityRecommendation
    DB-001ADD COLUMN with DEFAULTACCESS EXCLUSIVEMediumSafe in PG 11+, but ensure no active long transactions.
    DB-002ADD COLUMN NOT NULLACCESS EXCLUSIVEHighCRITICAL: Fails on tables with existing data. Use 3-phase approach.
    DB-005Table RewriteFull RewriteHighAdding NOT NULL to existing data forces a full table scan and lock.

    Proposed Zero-Downtime Sequence

    Phase 1: Expand

    1. ALTER TABLE users ADD COLUMN bio text DEFAULT 'none'; (Safe in PG 15)
    2. ALTER TABLE users ADD COLUMN internal_id uuid; (Nullable initially)

    Phase 2: Migrate

    1. Backfill internal_id in batches of 5000 rows to avoid long-held locks and replication lag.
    2. Verify all rows have an internal_id.

    Phase 3: Contract

    1. ALTER TABLE users ALTER COLUMN internal_id SET NOT NULL; (Use NOT VALID if supported/required to avoid long scans).

    Preflight Checklist

    • Verify backup is current and restoration is tested.
    • Set SET lock_timeout = '2s'; before execution.
    • Check pg_stat_activity for long-running transactions.

    Next steps

    1. Confirm the estimated row count for the users table to refine batch sizes.
    2. Implement the batch backfill script for the internal_id field.
    3. Schedule Phase 3 during a low-traffic window.

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

    About this skill

    Database schema changes often cause accidental downtime, table locks, or data loss. This skill provides a specialized engineering framework to audit SQL migrations, optimize query performance, and ensure zero-downtime deployments.

    What it does

    • Audit migrations using a linting engine to detect dangerous locks, table rewrites, and incompatible schema changes.
    • Sequence deployments by breaking breaking changes into "expand, migrate, contract" phases to maintain backward compatibility.
    • Analyze performance by diagnosing slow queries through execution plans and identifying missing or redundant indexes.
    • Identify security risks by scanning application code for SQL injection vulnerabilities and enforcing least-privilege access.
    • Verify recovery plans by validating backup integrity, restoration procedures, and rollback strategies.

    How it works

    1. Scope and Inventory: Provide the database engine, version, schema files, or pending migration scripts for analysis.
    2. Deterministic Scanning: The agent runs internal linters (e.g., migration_lint.py) to categorize lock levels and potential breaking points.
    3. Profile Routing: Depending on the issue, the agent activates specific sub-profiles like zero-downtime or transaction-engineer.
    4. Actionable Reporting: Receive a technical report including lock classifications, phased execution steps, and pre-flight checklists.

    Frameworks & tools

    Primary support for PostgreSQL, with support for MySQL, SQLite, and NoSQL. Compatible with migration tools like Flyway, Liquibase, Alembic, and Prisma.

    Why this beats prompting it yourself

    Generic prompts often overlook version-specific locking behavior or suggest "reversible" migrations that actually cause data loss. This skill enforces strict safety principles, such as "expand-and-contract" patterns and automated PII redaction, ensuring production stability over raw speed.

    Use cases

    • Reviewing a complex PostgreSQL migration to avoid ACCESS EXCLUSIVE locks on large tables.
    • Converting a blocking CREATE INDEX into a CONCURRENTLY operation for zero-downtime.
    • Debugging N+1 query patterns and lazy loading issues generated by an ORM.
    • Designing a high-availability replication strategy with tested failover steps.

    Known limitations

    Does not perform direct execution on production databases. Performance gains are estimates based on plans, not live benchmarks. Requires engine version to provide accurate locking analysis.

    Requires explicit database engine and version for accurate lock analysis. No direct production execution. Performance gains are theoretical until verified on specific hardware.

    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 any payment.

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

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Listed3 days ago

    What's inside

    Frequently Asked Questions

    The Database Guardian Migration Engineer identifies dangerous schema changes that cause table locks or downtime. It provides a structured 'expand, migrate, contract' strategy to ensure your application remains operational throughout the entire deployment process.

    While optimized for PostgreSQL, the skill also supports MySQL, SQLite, and popular NoSQL engines. It is fully compatible with migration frameworks like Prisma, Alembic, Flyway, and Liquibase.

    You receive the specialized engineering framework, including access to internal migration linters and safety profiles. The purchase also includes standard documentation on how to input your schema and interpret the lock-level reports.

    No, this skill operates as an advisory layer; it audits scripts and provides safe execution plans without requiring direct access to your production environment. This ensures your sensitive data stays within your controlled infrastructure.

    Standard AI prompts often suggest commands that are technically correct but operationally dangerous, like non-concurrent index creation. This skill uses a deterministic scanning engine to detect specific version-locking behaviors that generic models frequently miss.

    Updates are released periodically to account for new database engine versions and evolving security standards. These updates are automatically integrated into the skill to ensure your migration audits remain current with the latest performance tuning best practices.

    New in Data & Databases