/claude-db:db-connection-poolingfrom Claude DB
Audits Postgres connection management: flags serverless functions opening direct connections, transaction-mode pooler misuse (PgBouncer/Supabase/prepared statements), and pool sizing against backend max_connections. Feeds Performance & Scale score.
Ships in Claude DB. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Connection exhaustion is a top cause of production outages and a pure Performance & Scale (axis
performance) concern. Feeds relational Pooling w10 (and the Conexión category in every NoSQL
profile). The dominant modern failure is serverless functions opening one direct connection each and
saturating the backend.
max_connections. Recommend a transaction-mode pooler or a serverless driver
(Neon/@neondatabase/serverless, Supabase pooler, PlanetScale HTTP).transaction
mode, Supabase port 6543) while relying on session features it breaks: server-side prepared
statements, SET/session GUCs, LISTEN/NOTIFY, advisory-session locks.max × instance count exceeding backend max_connections, or a
pool so small it serializes requests.(cores*2) + effective_spindles as the server-side ceiling on usefully-busy backend
connections — not a per-app-pool target.max_connections — leave superuser_reserved_connections (and room for
other apps/replication) free so an admin can still connect when the pool saturates.SET/session GUCs, LISTEN/NOTIFY, session-scoped advisory locks).Feeds performance only (relational Pooling w10; Conexión/Pooling in NoSQL profiles).
Detect the runtime (serverless markers per references/detection-signals.md) and the client/driver
(pg, postgres, @neondatabase/serverless, @prisma/client, connection URL host/port). Flag direct
connections from serverless, port-6543/pgbouncer=true URLs combined with prepared-statement usage,
and pool config. Backend max_connections and live connection counts are runtime → needs_api at
Tier-0.
SELECT current_setting('max_connections') AS max_conn,
count(*) AS open_conns,
count(*) FILTER (WHERE state = 'idle') AS idle
FROM pg_stat_activity;
Method connection_introspect. open_conns approaching max_conn confirms an exhaustion finding as
established. The serverless-direct and pooler-mode findings are confirmable from config alone
(directional); their impact under load is needs_api without Tier-2.
Emit findings per schema/finding.schema.json. Examples:
M15.app.serverless_direct_pg — serverless function with a direct Postgres connection, no pooler
(severity:4, warn, axis performance, confidence directional, fixable: proposed — switch to
pooler/serverless driver).M15.app.prepared_stmt_on_txn_pooler — server-side prepared statements over a transaction-mode
pooler (severity:3, warn, directional, fixable: proposed).M15.app.pool_exceeds_max_connections — pool × instances > backend max (severity:3, warn,
established Tier-1 / directional, fixable: proposed).Each finding: evidence.observed quotes the connection config / driver import verbatim with the
credential redacted; verification.reproduce is the catalog query above referencing $DATABASE_URL;
expected_impact is banded + confidence-tagged (no naked %).
established.proposed/advisory, never auto.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub hainrixz/claude-db --plugin claude-db36 skills in this plugin
/auditAudit a database schema, ORM model, or migrations for design and performance — produces two independent 0-100 scores (Design & Integrity + Performance & Scale) plus a prioritized, evidence-backed report. Read-only; never writes or migrates. Use when the user asks to audit, analyze, review, check, or score a database, schema, data model, migrations, indexes, keys, referential integrity, types, constraints, query patterns, partitioning, or connection pooling — for Postgres, MySQL, Mongo, DynamoDB, Cassandra, pgvector, ClickHouse, Neo4j, and friends./checklistRender a production-readiness GO/NO-GO grid for a database — runs a read-only audit, then maps the findings onto a fixed launch checklist (PITR/backups, RLS on tenant tables, FK indexes, money-as-numeric, timestamptz/UTC, connection pooling sized, migration reversibility, secrets-not-in-schema, charset/utf8mb4). Each row is PASS/WARN/FAIL/NEEDS-LIVE with the finding id, topped by a plain-language verdict. Read-only. Use when the user asks if a database is production-ready, ready to launch/ship, a go/no-go, a pre-launch or readiness checklist, or what to fix before going live./db-antipatternsUnified cross-paradigm anti-pattern catalog (M19) — relational and NoSQL smells that no single structural module owns cleanly: EAV / generic key-value tables, the "god table" with hundreds of columns, comma-separated lists in a column, polymorphic associations without FK, boolean-flag soup, Mongo unbounded array growth, deeply nested documents, the document fan-out / "join in app code" trap, Redis as a relied-on durable primary store. Each finding is re-homed to inherit the natural module's category. Feeds the Design & Integrity AND Performance & Scale scores depending on the smell./db-concurrencyAudit concurrency correctness — transaction isolation level, lost-update / read-modify-write races, queue-worker contention (SKIP LOCKED), and idempotency for key-value / document / wide-column writes. Module M14. Feeds the Performance & Scale score./db-constraintsAudit data-integrity constraints — missing NOT NULL on required columns, absent CHECK constraints for domain rules, missing UNIQUE on natural keys, and the over-nullable UNIQUE trap where NULLs silently permit duplicates. Module M5. Feeds the Design & Integrity score (Constraints category)./db-defaults-generatedAudit column defaults and generated columns — application-side timestamps that should be DB defaults, non-deterministic or wrong defaults, derived values that should be GENERATED ALWAYS / computed columns instead of drift-prone duplicated data, and identity/sequence defaults. Module M6. Feeds the Design & Integrity score (Tipos category, shared with M4).Other plugins' skills for the same job