ArchGuard — Architecture, SQL & Distributed Math Verifier

    by yashwant rana

    1

    Audit backend codebases for circular deps & 12 reliability smells, guard SQL migrations with 3-phase Expand-Contract plans, and compute exact QPS, quorum & tail-latency math.

    Free

    Security scanned

    Works with the AI Agents you already use

    ArchGuard — Architecture, SQL & Distributed Math Verifier

    Example session with this skill installed

    Audit this SQL migration for a high-traffic Postgres table: ALTER TABLE orders ADD COLUMN status_code TEXT NOT NULL;

    • Read your context and instructions
    • Compiled the archguard

    I have analyzed the provided SQL migration for PostgreSQL safety. The current DDL will cause production downtime by triggering an Access Exclusive lock while performing a full table rewrite to enforce the NOT NULL constraint on existing rows.

    Migration Safety Audit: orders Table

    Risk LevelFinding IDIssueRemediation
    CRITICALDDL-001Missing Lock TimeoutAdd SET lock_timeout = '3s'; to prevent queueing traffic.
    HIGHDDL-002Blocking NOT NULLCannot add NOT NULL column to existing table in one step.
    HIGHDDL-003Full Table RewriteAdding a column with a constraint locks the table for the duration of the scan.

    Recommended Phase 1 (Expand) Migration

    -- Set short timeout to fail fast if table is busy
    SET lock_timeout = '3s';
    
    -- 1. Add column as nullable first (Expand)
    ALTER TABLE orders ADD COLUMN status_code TEXT;
    
    -- 2. Add constraint as NOT VALID to avoid immediate validation scan
    ALTER TABLE orders ADD CONSTRAINT status_code_check 
      CHECK (status_code IS NOT NULL) NOT VALID;
    

    Next steps

    1. Deploy Phase 1 and update the application code to dual-write the new column.
    2. Run a background worker to backfill status_code for existing rows.
    3. Execute ALTER TABLE orders VALIDATE CONSTRAINT status_code_check; once backfill is complete.

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

    About this skill

    ArchGuard turns Claude Code, Cursor, Copilot, Antigravity, and Codex into a Staff-level backend reviewer backed by deterministic analysis and zero-dependency tooling:

    1. Codebase Architecture Drift & Production Reliability Audit
    • Builds multi-language import graphs (JS/TS/Python/C++/Java/Go) and detects circular dependencies with Tarjan's O(V+E) SCC algorithm + Robert C. Martin coupling metrics (Ca/Ce/I) and Mermaid dependency graphs.
    • Flags 12 production anti-patterns: N+1 DB/network calls inside loops, outbound HTTP calls missing timeouts, unbounded in-memory Map/Set caches, check-then-act races, missing Idempotency-Key guards on payment/order routes, SQL/command injection, weak Math.random() tokens, empty catches, layer violations, and God modules.
    1. Zero-Downtime SQL Migration Guardian (Expand-Contract)
    • Audits PostgreSQL, MySQL, and SQLite DDL for table locks and rolling-deploy hazards (CREATE INDEX without CONCURRENTLY, DROP/RENAME COLUMN, ADD COLUMN NOT NULL without default, ALTER COLUMN TYPE rewrites, unvalidated constraints, missing lock_timeout).
    • Auto-generates a safe 3-phase Expand-Contract rollout plan.
    1. Deterministic Distributed Systems Math & Simulators
    • Exact QPS, 5-year storage, ingress/egress Gbps, Redis RAM, dominant shard bottlenecks, and Little's Law concurrency (with Big Tech presets: TinyURL, Twitter, WhatsApp, Uber, YouTube, Stripe).
    • Exact Dynamo quorum (W+R>N), Raft odd-cluster fault tolerance, Jeff Dean fanout tail-latency amplification (1-(1-p)^K) with hedged RPCs, and FNV-1a consistent hashing skew/remap simulations.

    Works standalone via the bundled Staff-level reference playbooks or paired with the free hosted Streamable HTTP MCP server (https://arch-guard-mcp.yashwant938.workers.dev/mcp) and open-source stdio server (https://github.com/yashwant938/arch-guard-mc).

    Local repository scanning requires the ArchGuard MCP server setup via Node.js. Capacity math uses standard presets and statistical simulations which may vary from specific cloud provider overheads.

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

    • Free with an Agensi account

    Permissions

    Read Files
    Network Access
    Listed16 days ago

    What's inside

    Creator

    yashwant rana

    yashwant rana

    Frequently Asked Questions

    This skill identifies production-breaking issues like circular dependencies, N+1 query loops, and unsafe SQL migrations that often bypass standard linters or generic LLM reviews.

    The skill is compatible with any AI agent that supports the Model Context Protocol (MCP), though it is specifically optimized for developers using ArchGuard-enabled environments for static analysis.

    Yes, the SQL migration gating tool specifically validates DDL for the Expand-Contract pattern, ensuring your Postgres, MySQL, or SQLite migrations don't lock tables or cause downtime.

    To get the most out of this skill, you will need to install the ArchGuard MCP server locally to allow the agent to perform deterministic static analysis on your repository.

    Unlike generic prompts, this skill uses graph cycle detection and formal capacity planning math to provide precise, verifiable feedback rather than just 'plausible' sounding advice.

    The purchase includes the full suite of backend auditing tools, including architectural scanning, SQL safety verification, and distributed system capacity simulators.

    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