Works with the AI Agents you already use
scale guard
Evidence-first performance and scalability audits for Node.js services on PostgreSQL or MySQL.
$9
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
| Finding | Type | Evidence | Impact |
|---|---|---|---|
| Interactive Transaction Leak | Confirmed | src/services/order.ts:42 | Holds connection during external Stripe API call (avg 400ms) |
| Pool Budget Overrun | Confirmed | docker-compose.yml | 10 replicas × 20 max connections = 200, exceeding RDS max_connections of 150 |
| N+1 in Loop | Likely | src/controllers/user.ts:88 | await prisma.profile.findUnique inside a .map() call |
| Missing Connection Timeout | Speculative | .env | No 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
- Infrastructure: Reduce Kubernetes replicas to 6 or increase RDS instance size to support a higher
max_connectionslimit. - Logic: Refactor
order.tsto move the Stripe API call outside of theprisma.$transactionblock. - Config: Add
?connection_limit=15&socket_timeout=10to the database connection string to enforce backpressure.
Next steps
- Run
node scripts/conn-budget.mjsto calculate the exact headroom needed. - Review the
order.tstransaction 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
findManycalls 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
- Scope and Trace: The skill maps the request path from ingress to the database, identifying every middleware and service sharing the connection pool.
- Signature Matching: It compares symptoms (e.g., daily slowness vs. deploy spikes) against a library of known performance signatures to prioritize investigation areas.
- Automated Scanning: Runs bundled Node.js scripts to statically analyze the repo for telemetry, pool settings, and expensive query patterns.
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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 18 days ago
Permissions
What's inside
Frequently Asked Questions
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.