Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add magic3007/dotfiles --skill prisma-connection-pool-exhaustiongit clone --depth 1 https://github.com/magic3007/dotfilesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion)<a href="https://agentmods.dev/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00100 | $0.01160 |
| Opus 5 | $0.00050 | $0.00580 |
| Sonnet 5 | $0.00020 | $0.00232 |
| Haiku 4.5 | $0.00010 | $0.00116 |
Grade A, and why
prisma-connection-pool-exhaustion scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to prisma-connection-pool-exhaustion — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prisma Connection Pool Exhaustion in Serverless
Problem
Serverless functions create a new Prisma client instance on each cold start. Each instance opens multiple database connections (default: 5 per instance). With many concurrent requests, this quickly exhausts the database's connection limit (often 20-100 for managed databases).
Context / Trigger Conditions
This skill applies when you see:
P2024: Timed out fetching a new connection from the connection pool- PostgreSQL:
FATAL: too many connections for role "username" - MySQL:
Too many connections - Works fine locally with
npm run devbut fails in production - Errors appear during traffic spikes, then resolve
- Database dashboard shows connections at or near limit
Environment indicators:
- Deploying to Vercel, AWS Lambda, Netlify Functions, or similar
- Using Prisma with PostgreSQL, MySQL, or another connection-based database
- Database is managed (PlanetScale, Supabase, Neon, RDS, etc.)
Solution
Step 1: Use Connection Pooling Service
The recommended solution is to use a connection pooler like PgBouncer or Prisma Accelerate, which sits between your serverless functions and the database.
For Supabase:
# .env
# Use the pooled connection string (port 6543, not 5432)
DATABASE_URL="postgresql://user:[email protected]:6543/postgres?pgbouncer=true"
For Neon:
# .env
DATABASE_URL="postgresql://user:[email protected]/dbname?sslmode=require"
# Neon has built-in pooling
For Prisma Accelerate:
npx prisma generate --accelerate
Step 2: Configure Prisma Connection Limits
In your schema.prisma:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
// Limit connections per Prisma instance
relationMode = "prisma"
}
In your connection URL or Prisma client:
// lib/prisma.ts
import { PrismaClient } from '@prisma/client'
const globalForPrisma = global as unknown as { prisma: PrismaClient }
export const prisma = globalForPrisma.prisma || new PrismaClient({
datasources: {
db: {
url: process.env.DATABASE_URL + '?connection_limit=1'
}
}
})
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 162 lines · 100 tokens per session scan A 5d9610dfbbf1
prisma-connection-pool-exhaustion is a skill published in the GitHub repository magic3007/dotfiles (11 stars, last pushed 2d ago), licensed MIT. It adds 100 tokens to every session and 1,160 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to prisma-connection-pool-exhaustion, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
diagnose-ci
Investigate failing REMOTE CI runs on GitHub Actions: find the failed run, pull the failed-step logs with gh, identify the root cause (compile error, test failure, lint, missing secret, timeout), and recommend a fix. Read-only: it does not commit, push, or edit. Use when CI is red, a GitHub Actions run failed, or the…
triage-dotfiles-env
Playbook of known failure modes in this dotfiles stack: pipx "bad interpreter" after Python rebuilds, gpg commit-signing failures, direnv/nix shellHook running bash instead of zsh, Powerlevel10k instant-prompt warnings, and Neovim plugin errors from removed Lua APIs. Use when a shell startup error, git signing…
fix-and-retry
Diagnose a failing CI run, apply the code fix, commit it, push, and watch the re-run until it passes or fails -- the full fix-and-retry loop in one shot. Use after a pipeline fails and the user says "fix it and retry", "fix the CI and push", or "make CI green". Do NOT use for a read-only investigation that stops at a…
diagnose-runtime
Triage LOCAL runtime failures on your own machine: crashes and errors, hangs and deadlocks, slowness and high CPU/memory, and hardware/serial/USB issues. Method: reproduce, isolate (bisect, log, strace/dtruss, sample), form a hypothesis, verify the fix holds. Read-mostly: it inspects processes and logs, it does not…
use-next-devtools
Reference for using the NextJS Dev Tools via the nextjs-agent. Use to debug or observe Next.js framework internals.
orchestrate-agents
Orchestrate multiple agent CLIs (Claude, Codex, Antigravity) via tmux with a shared fleet store, dispatching one guardian subagent per pane. Survey-first: inspects and adopts existing tmux sessions, windows, and agent panes before creating anything new. Use when running a multi-agent session, dispatching parallel…