Works with the AI Agents you already use

    scale guard

    by Sourav Kashyap

    1

    Evidence-first performance and scalability audits for Node.js services on PostgreSQL or MySQL.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    scale guard

    scale guard

    Example session with this skill installed

    My Node.js API using Prisma is throwing P2024 errors during peak traffic. The database CPU is low. Scan the repo and tell me why we are hitting connection limits.

    • Read your context and instructions
    • Compiled the scale guard

    I have analyzed the repository and the process model. The P2024 errors are caused by client-side pool queueing, not database exhaustion.

    Performance Audit: Connection Exhaustion

    FindingTypeEvidenceImpact
    Interactive Transaction LeakConfirmedsrc/services/order.ts:42Holds connection during external Stripe API call (avg 400ms)
    Pool Budget OverrunConfirmeddocker-compose.yml10 replicas × 20 max connections = 200, exceeding RDS max_connections of 150
    N+1 in LoopLikelysrc/controllers/user.ts:88await prisma.profile.findUnique inside a .map() call
    Missing Connection TimeoutSpeculative.envNo connection_limit or pool_timeout defined in PRISMA_URL

    Root Cause Analysis

    The service is over-provisioned at the container level relative to the database's capacity. Furthermore, long-running transactions involving external I/O are holding connections open, preventing other requests from acquiring one from the pool.

    Recommendations

    1. Infrastructure: Reduce Kubernetes replicas to 6 or increase RDS instance size to support a higher max_connections limit.
    2. Logic: Refactor order.ts to move the Stripe API call outside of the prisma.$transaction block.
    3. Config: Add ?connection_limit=15&socket_timeout=10 to the database connection string to enforce backpressure.

    Next steps

    • Run node scripts/conn-budget.mjs to calculate the exact headroom needed.
    • Review the order.ts transaction block to separate DB writes from external network calls.
    • Check if PgBouncer can be introduced to multiplex these connections.

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

    About this skill

    ScaleGuard is a specialized performance engineering skill designed for developers managing Node.js services backed by PostgreSQL or MySQL. It stops the guessing game of performance tuning by prioritizing evidence-based diagnostics over code aesthetics. When your API is slow but the database looks idle, or when you are hitting Prisma connection limits, this skill identifies exactly where the request is stalling.

    What it does

    • Bottleneck identification isolates latency across the pool, SQL execution, event-loop delays, or downstream calls.
    • Connection budgeting calculates optimal pool sizes using Little's Law to prevent P2024/P2028 errors.
    • ORM optimization detects N+1 queries, serial awaits, and unbounded findMany calls in Prisma or other ORMs.
    • Static repository scanning identifies risky patterns like queries inside loops or missing pagination without requiring production access.
    • Infrastructure auditing analyzes PgBouncer, RDS Proxy, and process models (PM2/K8s) to find configuration mismatches.

    How it works

    1. Scope and Trace: The skill maps the request path from ingress to the database, identifying every middleware and service sharing the connection pool.
    2. Signature Matching: It compares symptoms (e.g., daily slowness vs. deploy spikes) against a library of known performance signatures to prioritize investigation areas.
    3. Automated Scanning: Runs bundled Node.js scripts to statically analyze the repo for telemetry, pool settings, and expensive query patterns.
    4. Evidence Inventory: Produces a ranked report of findings labeled as Confirmed, Likely, or Speculative, complete with impact and risk assessments.

    Frameworks & tools

    Node.js 18+, PostgreSQL, MySQL, Prisma, Redis, PgBouncer, RDS Proxy, and telemetry suites like OpenTelemetry, Datadog, or Prometheus.

    Why this beats prompting it yourself

    Generic AI often suggests "add an index" or "increase the pool size" by default, which can crash your database. ScaleGuard follows a strict "evidence-first" protocol, refusing to recommend mutations without a connection budget and a measured bottleneck.

    Use cases

    • Debugging rising p99 latency in production Node.js APIs.
    • Resolving "too many connections" errors in serverless or containerized environments.
    • Auditing a PR for performance regressions before merging.
    • Capacity planning for an expected traffic surge or marketing event.

    Known limitations

    Requires Node.js 18+ to run bundled scanners. Cannot execute EXPLAIN ANALYZE or migrations on production without explicit user approval. Static analysis may not catch dynamic query building.

    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.

    Frequently Asked Questions

    ScaleGuard solves common Node.js performance issues like rising p99 latency, Prisma connection pool exhaustion, and N+1 query patterns by using evidence-based diagnostics instead of generic suggestions.

    The skill requires Node.js 18+ and is optimized for services using PostgreSQL or MySQL with ORMs like Prisma, alongside infrastructure tools like PgBouncer or RDS Proxy.

    Unlike generic LLMs that might suggest risky changes, ScaleGuard uses Little's Law and evidence-first protocols to ensure recommendations won't crash your database or destabilize your infrastructure.

    ScaleGuard performs static repository scanning and traces request paths to find bottlenecks; however, it will never execute production migrations or EXPLAIN ANALYZE commands without your explicit approval.

    You receive the specialized performance engineering skill, a suite of bundled Node.js static analysis scripts, and a library of performance signatures used to identify complex latency patterns.

    ScaleGuard is most effective when integrated into your existing workflow for PR audits, debugging production slowness, or conducting capacity planning before high-traffic events.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.