neon-postgres
Skill0 starsChanged 12 days agoApache-2.0View on GitHub
Guides and best practices for working with Neon Serverless Postgres. Covers setup, connection methods, branching, autoscaling, scale-to-zero, read replicas, connection pooling, Neon Auth, and the Neon CLI, MCP server, REST API, TypeScript SDK, and Python SDK. Use when users ask about "Neon setup", "connect to Neon", "Neon project", "DATABASE_URL", "serverless Postgres", "Neon CLI", "neonctl", "Neon MCP", "Neon Auth", "@neondatabase/serverless", "@neondatabase/neon-js", "scale to zero", "Neon autoscaling", "Neon read replica", or "Neon connection pooling".
- Reads credentials
29 other projects use a version of this, 23 of them edited; 2 new projects in the last 4 weeks, against 4 the 4 before.
Adopted by
Cooling: 2 new projects took it in the last 4 weeks, 0.5× the 4 weeks before.thin data
Most recently taken up by
- namlxuit056/social-forexedited, first seen Nov 8, 2026
- figueroaignacio/ignaciofigueroa.devedited, first seen Nov 8, 2026
- matheus-rib1108/meu-kit-claude-codeedited, first seen Oct 17, 2026
- neondatabase/agent-skillsedited, first seen Oct 15, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- xai-org/plugin-marketplaceword for word, first seen Oct 13, 2026
Used with
Projects with it also use neon-ai-gateway, neon-functions and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
jaaklaSkillneon-ai-gateway
One API and one credential for frontier and open-source LLMs, built into your Neon branch and powered by Databricks. Use when a user wants to call an LLM, add AI/chat/an agent to their app, route between model providers (OpenAI, Anthropic, Google/Gemini, Meta, Alibaba, and more), or avoid juggling separate provider API keys and accounts — especially when they already use Neon and want AI requests to branch with their project. Works with the OpenAI SDK, Anthropic SDK, google-genai, the Vercel AI SDK, and Mastra by changing only the base URL. Triggers include "call an LLM", "add AI to my app", "chat completion", "model routing", "LLM proxy/gateway", "one API for all models", "use Claude/GPT/Gemini", "AI SDK", "Mastra agent", "Neon AI Gateway", and "log/rate-limit AI calls".
Also in 4 projects that use this
jaaklaSkillneon-functions
Long-running, serverless Node.js HTTP functions deployed onto your Neon branch, with DATABASE_URL injected automatically and compute that runs next to your data. Use when a user wants to host an API, an AI agent with long streaming responses, a WebSocket or server-sent-events (SSE) server, a webhook handler, a Discord bot, an MCP server, or any request/response workload that risks timing out on short, lambda-style serverless functions — and wants it to branch with their database. Also use for Function Triggers: a cron or an object-storage event that POSTs to a function. Triggers include "serverless function", "deploy an API", "long-running function", "streaming agent", "SSE server", "WebSocket server", "webhook handler", "MCP server", "cron", "function trigger", "scheduled function", "cron job", "object storage trigger", "on upload", "run code next to my database", "function that won't time out", "function logs", "Neon Functions", "Neon Compute", "DDoS protection", "rate limiting", and "production hardening".
Also in 4 projects that use this
xAISkillneon-postgres-branches
Choose and create the right Neon branch type for testing and development. Use when users ask about Neon branching, migration testing with real data, isolated test environments, schema-only branch workflows for sensitive data, or branch creation via Neon CLI or Neon MCP. Triggers include "Neon branch", "test migrations safely", "branch production data", "schema-only branch", "reset branch" and "sensitive data testing".
Also in 4 projects that use this
sayuru-akashSkillneon-postgres-egress-optimizer
Diagnose and fix excessive Postgres egress (network data transfer) in a codebase. Use when a user mentions high database bills, unexpected data transfer costs, network transfer charges, egress spikes, "why is my Neon bill so high", "database costs jumped", SELECT * optimization, query overfetching, reduce Neon costs, optimize database usage, or wants to reduce data sent from their database to their application. Also use when reviewing query patterns for cost efficiency, even if the user doesn't explicitly mention egress or data transfer.
Also in 4 projects that use this
VercelSkillnext-cache-components
Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag
Also in 3 projects that use this
SentrySkillnext-best-practices
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Also in 4 projects that use this
- +2 more from jaakla
Other versions29 projects use a version of this.
Word for word · 1
- xai-org/plugin-marketplace★ 323100% same
Edited · 23
- legions-developer/invoicely★ 92384% same
- mezotv/notra★ 25621% same
- usenotra/notra★ 25621% same
- neondatabase/agent-skills★ 11116% same
- jaakla/openmapstack★ 7620% same
- jaakla/openmapstack-skills★ 7620% same
- coinacci/TravelMintNFT★ 6984% same
- Xenonesis/code-guardian-report★ 4984% same
- iyashjayesh/tokenchit★ 1420% same
- LeonardoTrapani/better-skills★ 1183% same
13 more not listed
Wrote their own version · 5
- xfstudio/skills★ 9same name
- ai4brands-design/claude-skills★ 2same name
- Ghosteken/agent-harness★ 2same name
- liuchiawei/agent-skills★ 2same name
- chenson42/stackkeel★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. 9 are common, 11 are distinctive, and 10 are very specific to this project.
9
Common
Most of the 28 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Use this for architecture explanations and terminology (organizations, projects, branches, endpoints) before giving implementation advice.
- Distinctive: line 52
Use this section when guiding a user through first-time Neon setup.
- Distinctive: line 56
Before starting setup, inspect the user's codebase and environment:
- Very specific: line 75
If init is not suitable, the individual steps can be run non-interactively:
- Distinctive: line 87
Use MCP server or CLI to list organizations and projects.
- Very specific: line 91
Use MCP server or CLI to get the connection string.
- Distinctive: line 103
Check for existing ORM (Prisma, Drizzle, TypeORM).
- Distinctive: line 107
Check for existing migration files or ORM schemas
- Distinctive: line 108
If none: offer to create an example schema or design one together
- Very specific: line 112
If resuming setup, check what's already configured (MCP connection, .env with DATABASE_URL, dependencies, schema) and continue from the …
- Distinctive: line 120
Use this when you need to pick the correct transport and driver based on runtime constraints (TCP, HTTP, WebSocket, edge, serverless, …
- Very specific: line 126
Use this for @neondatabase/serverless patterns, including HTTP queries, WebSocket transactions, and runtime-specific optimizations.
- Distinctive: line 132
Use this for combined Neon Auth + Data API workflows with PostgREST-style querying and typed client setup.
- Very specific: line 138
Use this for local development enablement with npx -y neonctl@latest init --agent <agent-name>, VSCode extension setup, and Neon MCP server …
- Very specific: line 149
Use this for terminal-first workflows, scripts, and CI/CD automation with neonctl.
- Distinctive: line 159
Use this for direct HTTP automation, endpoint-level control, API key auth, rate-limit handling, and operation polling.
- Very specific: line 165
Use this when implementing typed programmatic control of Neon resources in TypeScript via @neondatabase/api-client.
- Very specific: line 171
Use this when implementing programmatic Neon management in Python with the neon-api package.
- Very specific: line 177
Use this for managed user authentication setup, UI components, auth methods, and Neon Auth integration pitfalls in Next.js and React apps.
- Common: line 185
Use this when the user is planning isolated environments, schema migration testing, preview deployments, or branch lifecycle automation.
- Common: line 191
Use the neonctl CLI or MCP server to create, inspect, and compare branches.
- Distinctive: line 201
If this skill is not installed you can use the following command to install it:
- Common: line 209
Use this when the user needs compute to scale automatically with workload and wants guidance on CU sizing and runtime behavior.
- Common: line 215
Use this when optimizing idle costs and discussing suspend/resume behavior, including cold-start trade-offs.
- Common: line 227
Use this when the user needs point-in-time recovery or wants to restore data state without traditional backup restore workflows.
- Common: line 239
Use this for read-heavy workloads where the user needs dedicated read-only compute without duplicating storage.
- Common: line 251
Use this when the user is in serverless or high-concurrency environments and needs safe, scalable Postgres connection management.
- Very specific: line 256
Add -pooler to endpoint hostnames to use pooled connections.
- Common: line 263
Use this when the user needs to restrict database access by trusted networks, IPs, or CIDR ranges.
- Common: line 269
Use this when integrating CDC pipelines, external Postgres sync, or replication-based data movement.
“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Neon Serverless Postgres
Guide the user through any Neon-related task: setup, connections, branching, and advanced features. Deliver a working Neon connection, a completed feature configuration, or a specific answer from the official Neon docs.
Neon is a serverless Postgres platform that separates compute and storage to offer autoscaling, branching, instant restore, and scale-to-zero. It's fully compatible with Postgres and works with any language, framework, or ORM that supports Postgres.
Neon Documentation
The Neon documentation is the source of truth for all Neon-related information. Always verify claims against the official docs before responding. Neon features and APIs evolve, so prefer fetching current docs over relying on training data.
Fetching Docs as Markdown
Any Neon doc page can be fetched as markdown in two ways:
- Append
.mdto the URL (simplest): https://neon.com/docs/introduction/branching.md - Request
text/markdownon the standard URL:curl -H "Accept: text/markdown" https://neon.com/docs/introduction/branching
Both return the same markdown content. Use whichever method your tools support.
Finding the Right Page
The docs index lists every available page with its URL and a short description:
https://neon.com/docs/llms.txtCommon doc URLs are organized in the topic links below. If you need a page not listed here, search the docs index: https://neon.com/docs/llms.txt. Don't guess URLs.
What Is Neon
Use this for architecture explanations and terminology (organizations, projects, branches, endpoints) before giving implementation advice.
Link: https://neon.com/docs/introduction/architecture-overview.md
Getting Started
Use this section when guiding a user through first-time Neon setup.
Check Status Quo
Before starting setup, inspect the user's codebase and environment:
- Existing database connection code
- Existing Neon MCP server or Neon CLI configuration
- Existence of a
.envfile andDATABASE_URLenvironment variable - Existing ORM (Prisma, Drizzle, TypeORM) configuration
Self-Driving Setup With Neon's CLI or MCP Server
Offer to inspect existing connected Neon projects or create new ones using the Neon CLI or MCP server. If neither is set up yet, run init with the --agent flag. Use npx -y to skip the package install prompt. Auth is handled automatically. If the user is not logged in, it opens their browser for OAuth and waits for completion before proceeding.
npx -y neonctl@latest init --agent <agent-name>Supported --agent values: cursor, copilot, claude, claude-desktop, codex, opencode, cline, gemini-cli, goose, zed.
This installs the Neon extension (for Cursor/VS Code) or MCP server (for other agents), creates an API key, and adds the neon-postgres agent skill to the project.
If init is not suitable, the individual steps can be run non-interactively:
- Extension:
cursor --install-extension databricks.neon-local-connect - MCP server:
npx -y add-mcp https://mcp.neon.tech/mcp -g -n Neon -y -a <agent-name> - Agent skill:
npx skills add neondatabase/agent-skills --skill neon-postgres --agent <agent-name> -y
For full CLI installation options, see https://neon.com/docs/reference/cli-install.md
Setup Flow
1. Select Organization and Project
Use MCP server or CLI to list organizations and projects. Let the user select an existing project or create a new one.
2. Get Connection String
Use MCP server or CLI to get the connection string. Store it in .env as DATABASE_URL. Read the file first before modifying to avoid overwriting existing values.
3. Pick Connection Method & Driver
Refer to the connection methods guide to pick the correct driver based on deployment platform: https://neon.com/docs/connect/choose-connection.md
4. User Authentication with Neon Auth (if needed)
Skip for CLI tools, scripts, or apps without user accounts. If the app needs auth: use MCP server provision_neon_auth tool, then see the auth overview (https://neon.com/docs/auth/overview.md) for setup. For auth + database queries, see the JavaScript SDK reference (https://neon.com/docs/reference/javascript-sdk.md).
5. ORM Setup (optional)
Check for existing ORM (Prisma, Drizzle, TypeORM). If none, ask if they want one. For Drizzle integration, see https://neon.com/docs/guides/drizzle.md.
6. Schema Setup
- Check for existing migration files or ORM schemas
- If none: offer to create an example schema or design one together
Resume Support
If resuming setup, check what's already configured (MCP connection, .env with DATABASE_URL, dependencies, schema) and continue from the next incomplete step.
Security Reminders
Remind users to use environment variables for credentials, never commit connection strings, and use least-privilege database roles.
Connection Methods & Drivers
Use this when you need to pick the correct transport and driver based on runtime constraints (TCP, HTTP, WebSocket, edge, serverless, long-running).
Link: https://neon.com/docs/connect/choose-connection.md
Serverless Driver
Use this for @neondatabase/serverless patterns, including HTTP queries, WebSocket transactions, and runtime-specific optimizations.
Link: https://neon.com/docs/serverless/serverless-driver.md
Neon JS SDK
Use this for combined Neon Auth + Data API workflows with PostgREST-style querying and typed client setup.
Link: https://neon.com/docs/reference/javascript-sdk.md
Developer Tools
Use this for local development enablement with npx -y neonctl@latest init --agent <agent-name>, VSCode extension setup, and Neon MCP server configuration.
| Tool | URL |
| CLI Init Command | https://neon.com/docs/reference/cli-init.md |
| VSCode Extension | https://neon.com/docs/local/vscode-extension.md |
| MCP Server | https://neon.com/docs/ai/neon-mcp-server.md |
| Neon CLI | https://neon.com/docs/reference/neon-cli.md |
Neon CLI
Use this for terminal-first workflows, scripts, and CI/CD automation with neonctl.
Link: https://neon.com/docs/reference/neon-cli.md
Neon Admin API
The Neon Admin API can be used to manage Neon resources programmatically. It is used behind the scenes by the Neon CLI and MCP server, but can also be used directly for more complex automation workflows or when embedding Neon in other applications.
Neon REST API
Use this for direct HTTP automation, endpoint-level control, API key auth, rate-limit handling, and operation polling.
Link: https://neon.com/docs/reference/api-reference.md
Neon TypeScript SDK
Use this when implementing typed programmatic control of Neon resources in TypeScript via @neondatabase/api-client.
Link: https://neon.com/docs/reference/typescript-sdk.md
Neon Python SDK
Use this when implementing programmatic Neon management in Python with the neon-api package.
Link: https://neon.com/docs/reference/python-sdk.md
Neon Auth
Use this for managed user authentication setup, UI components, auth methods, and Neon Auth integration pitfalls in Next.js and React apps.
Link: https://neon.com/docs/auth/overview.md
Neon Auth is also embedded in the Neon JS SDK. Depending on your use case, you may want to use the Neon JS SDK instead of Neon Auth alone. See https://neon.com/docs/connect/choose-connection.md for more details.
Branching
Use this when the user is planning isolated environments, schema migration testing, preview deployments, or branch lifecycle automation.
Key points:
- Branches are instant, copy-on-write clones (no full data copy).
- Each branch has its own compute endpoint.
- Use the neonctl CLI or MCP server to create, inspect, and compare branches.
Link: https://neon.com/docs/introduction/branching.md
For detailed branch creation workflows (normal vs schema-only branches, reset-from-parent, CLI/MCP selection), use the neon-postgres-branches skill if available
Or fetch the full branching skill from the following URL:
https://neon.com/docs/ai/skills/neon-postgres-branches/SKILL.md
If this skill is not installed you can use the following command to install it:
npx skills add neondatabase/agent-skills --skill neon-postgres-branchesAutoscaling
Use this when the user needs compute to scale automatically with workload and wants guidance on CU sizing and runtime behavior.
Link: https://neon.com/docs/introduction/autoscaling.md
Scale to Zero
Use this when optimizing idle costs and discussing suspend/resume behavior, including cold-start trade-offs.
Key points:
- Idle computes suspend automatically (default 5 minutes, configurable) (unless disabled - launch & scale plan only)
- First query after suspend typically has a cold-start penalty (around hundreds of ms)
- Storage remains active while compute is suspended.
Link: https://neon.com/docs/introduction/scale-to-zero.md
Instant Restore
Use this when the user needs point-in-time recovery or wants to restore data state without traditional backup restore workflows.
Key points:
- History windows for instant restore depend on plan limits.
- Users can create branches from historical points-in-time.
- Time Travel queries can be used for historical inspection workflows.
Link: https://neon.com/docs/introduction/branch-restore.md
Read Replicas
Use this for read-heavy workloads where the user needs dedicated read-only compute without duplicating storage.
Key points:
- Replicas are read-only compute endpoints sharing the same storage.
- Creation is fast and scaling is independent from primary compute.
- Typical use cases: analytics, reporting, and read-heavy APIs.
Link: https://neon.com/docs/introduction/read-replicas.md
Connection Pooling
Use this when the user is in serverless or high-concurrency environments and needs safe, scalable Postgres connection management.
Key points:
- Neon pooling uses PgBouncer.
- Add
-poolerto endpoint hostnames to use pooled connections. - Pooling is especially important in serverless runtimes with bursty concurrency.
Link: https://neon.com/docs/connect/connection-pooling.md
IP Allow Lists
Use this when the user needs to restrict database access by trusted networks, IPs, or CIDR ranges.
Link: https://neon.com/docs/introduction/ip-allow.md
Logical Replication
Use this when integrating CDC pipelines, external Postgres sync, or replication-based data movement.
Key points:
- Neon supports native logical replication workflows.
- Useful for replicating to/from external Postgres systems.
Link: https://neon.com/docs/guides/logical-replication-guide.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

