<< All versions
Skill v1.0.0
currentLLM-judged scan90/100shubhamtaywade82/node-agent-skills/neon
──Details
PublishedOctober 23, 2026 at 02:25 AM
Content Hashsha256:2038f9b30866dcff...
Git SHA41278e4389dd
──Files
Files (1 file, 3.5 KB)
SKILL.md3.5 KBactive
SKILL.md · 63 lines · 3.5 KB
version: "1.0.0" name: neon description: Use when a Node.js backend uses Neon Postgres (serverless Postgres with connection pooling and branching).
Neon Postgres Adapter
Purpose
Translate the framework-neutral persistence contract onto Neon's serverless Postgres, where connections are pooled at the proxy and compute can suspend to zero between requests.
Activate when
- Detect
@neondatabase/serverlessorpgwith aneon.techconnection string in package.json or env. - See
NEON_DATABASE_URLorDATABASE_URL=postgres://user:pass@ep-*.neon.tech.
Repository inspection
package.json—@neondatabase/serverless(HTTP/HTTPS driver) orpg(TCP driver).- Connection string — read
DATABASE_URLfrom env (do not log it). - Pool config —
max: 1for serverless,max: 10-20for long-running; Neon's pooler (PgBouncer) handles multiplexing. - Schema — Neon branches for preview environments; confirm the
mainbranch vs preview branches. @neondatabase/serverless— uses HTTP transport; queries aresqltagged template orneon()client.
Decision rules
| Concern | Rule | |
|---|---|---|
| Driver choice | Use @neondatabase/serverless on edge/serverless (no persistent TCP). Use pg on long-running Node. | |
| Pool size | For serverless: 1 connection per request. Neon's pooler handles multiplexing at the proxy. For long-running: 10-20 max. | |
| Prepared statements | Always use parameterized queries. sql\SELECT ...\`` is parameterized by default. | |
| Branches | Preview branches are ephemeral; do not run destructive migrations on them. Merge schema changes via PR to main. | |
| Cold start | Neon compute suspends after inactivity (~5s cold start on free, ~300ms on paid). Set up a keep-warm ping if latency is critical. | |
| Connection mode | Use ?sslmode=require for TLS. Use pgbouncer=true for transaction-mode pooling (no session features). | |
| Migrations | Use neonctl or apply via psql against the connection string. Mark destructive migrations explicitly. | |
| Backups | Neon PITR to any time in the retention window (typically 7 days free, 30 days paid). |
Implementation procedure
- Detect the driver:
@neondatabase/serverlessfor serverless/edge,pgfor long-running. - Build the connection:
neon(process.env.DATABASE_URL)for HTTP,new Pool({ connectionString, max: 1 })for serverless TCP. - Run migrations with
neonctlorpsqlagainstmainbranch. - Implement the persistence seam with parameterized queries.
- Add a Testcontainers or live-Neon integration test.
- Configure keep-warm (cron ping) if cold-start latency is critical.
Failure modes
- Cold start 5s on the first request after inactivity → readiness probe times out, pod marked unready.
- Serverless function holds a
pgpool withmax: 10→ 100 concurrent functions × 10 = 1000 connections, Neon refuses. - Session-mode queries sent through PgBouncer transaction-mode pooler →
SETstatements lost between transactions. - Preview branch used in production by mistake → ephemeral data, lost on next cleanup.
- No TLS on connection string → blocked by Neon.
Verification
- Run
neonctl branches listandneonctl connection-string. - Confirm TLS in the connection URL.
- Run a load test from a cold start and measure the wake-up latency.
- Confirm the pool size matches the deployment shape (serverless = 1, long-running = 10-20).
- Source references: https://neon.tech/docs, https://neon.tech/docs/serverless/serverless-driver, https://neon.tech/docs/connect/connection-pooling, https://neon.tech/docs/guides/branching.