Big-Tech DB Resilience

    by Hemanth

    1

    Enforces non-blocking Postgres/SQL DDL (lock_timeout, NOT VALID/VALIDATE, CONCURRENTLY), atomic guarded updates, and query circuit breakers.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+23 more

    Big-Tech DB Resilience

    Example session with this skill installed

    Write a safe production migration to add a NOT NULL constraint, a new status index, and fix a double-claim race condition on our orders table.

    • Read your context and instructions
    • Compiled the big-tech db resilience

    1. Non-Blocking Constraint & Index Migration

    • Set SET LOCAL lock_timeout = '2s'; before DDL.
    • Added check constraint with NOT VALID, followed by VALIDATE CONSTRAINT in a separate transaction.
    • Created CREATE INDEX CONCURRENTLY idx_orders_pending ON orders (created_at) WHERE status = 'pending';.

    2. Atomic Race-Condition Fix
    Replaced read-then-update logic with single atomic UPDATE orders SET claimed_by = $1, status = 'claimed' WHERE id = $2 AND status = 'open' RETURNING *; so concurrent claims cannot double-succeed.

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

    About this skill

    Prevent production database lock queues, race conditions, and connection pool starvation.

    big-tech-db-resilience embeds production Postgres and MySQL safety patterns directly into your coding agent so schema changes and concurrent writes stay non-blocking under live traffic.

    Core Invariants

    • Non-Blocking DDL: Prepends SET LOCAL lock_timeout and builds indexes CONCURRENTLY to prevent Access Exclusive Lock pileups.
    • Two-Phase Constraints: Adds constraints NOT VALID first, then validates without blocking active writes.
    • Race-Condition Defenses: Enforces atomic conditional UPDATE ... WHERE guards and optimistic concurrency checks instead of read-then-write bugs.
    • Query Circuit Breakers: Caps runaway analytical or pool-exhausting queries via statement_timeout and lean partial indexes.

    Works across Claude Code, Cursor, Codex CLI, Gemini CLI, VS Code Copilot, and Antigravity (SKILL.md open standard). Part of AHR Autonomous Workflow (MIT).

    Supports SQL-based RDBMS like PostgreSQL and MySQL. NoSQL is not supported. Concurrent index builds may require execution outside of transaction blocks.

    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

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    • Free with an Agensi account

    Requires

    Nothing to install.

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed4 days ago

    What's inside

    Frequently Asked Questions

    This skill prevents production outages caused by database lock contention and race conditions by automatically refactoring standard SQL into safe, non-blocking patterns used by top-tier engineering teams.

    While the skill follows standard SQL protocols, it features specialized optimizations for PostgreSQL and MySQL to handle high-concurrency environments and large-scale migrations.

    The skill is designed to integrate with any AI agent or IDE extension that supports custom system instructions or tool-calling, allowing you to audit migrations directly within your development workflow.

    No, the skill specializes in relational database integrity; it does not support NoSQL databases like MongoDB or DynamoDB due to their different locking and consistency models.

    You receive the complete production-grade resilience logic, including specific patterns for lock timeouts, concurrent indexing, and optimistic concurrency control, ready to be applied to your SQL tasks.

    Yes, the skill is capable of refactoring long-running queries to include circuit-breaking session limits, preventing runaway processes from exhausting your connection pool.

    New in Data & Databases

    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.

    Free