Agent Native

neon-serverless

Configures the Neon Serverless Driver for database connectivity in serverless and edge environments like Vercel Edge Functions, AWS Lambda, and Cloudflare…

by NeonOfficial publisherNot reviewed

Identity proven by GitHub's verified organisation badge (neondatabase)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
License
MIT (permissive)
Pin
1ceaf89pinned Oct 9, 2026
Context cost
about 680 tokenswhen the skill loads
GitHub stars
86on neondatabase/ai-rules
Scripts
3 scripts

What it does

“Configures Neon Serverless Driver for Next.js, Vercel Edge Functions, AWS Lambda, and other serverless environments. Installs @neondatabase/serverless, sets up environment variables, and creates working API route examples with TypeScript types. Use when users need to connect their application to Neon, fetch or query data from a Neon database, integrate Neon with Next.js or serverless frameworks, or set up database access in edge/serverless environments where traditional PostgreSQL clients don't work.”
The author's description, from SKILL.md

Generated summary from the skill's own text

Configures the Neon Serverless Driver for database connectivity in serverless and edge environments like Vercel Edge Functions, AWS Lambda, and Cloudflare Workers. Installs the @neondatabase/serverless package, sets up environment variables, and provides TypeScript code templates for HTTP client and WebSocket pool patterns. Includes validation scripts to test connections before deployment.

When to use it

  • Building APIs with Vercel Edge Functions or Cloudflare Workers
  • Connecting AWS Lambda or Google Cloud Functions to Neon
  • Implementing low-latency database access in serverless apps
  • Setting up connection pooling for high-throughput applications

When not to

  • Complex multi-statement transactions requiring WebSocket pool instead
  • Applications running on persistent servers needing native PostgreSQL drivers
  • Offline-first applications without real-time database access needs

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add neondatabase/ai-rules --skill neon-serverless

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install neondatabase/ai-rules neon-serverless@1ceaf89a4e0acfbaf152ac2e85d45afd55f49c0f

Installs the commit we checked (1ceaf89).

Copy by hand

Download the folder at 1ceaf89 and put it in .claude/skills/neon-serverless for Claude Code and in .agents/skills/neon-serverless for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at 1ceaf89

Claude Code plugin

/plugin install neon@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "neon-serverless" by Neon.

Source, pinned to commit 1ceaf89a4e0acfbaf152ac2e85d45afd55f49c0f:
https://github.com/neondatabase/ai-rules/tree/1ceaf89a4e0acfbaf152ac2e85d45afd55f49c0f/neon-plugin/skills/neon-serverless

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/neon-serverless/ for Claude Code and .agents/skills/neon-serverless/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/neon/neon-serverless

SKILL.md at the pin

---
name: neon-serverless
description: Configures Neon Serverless Driver for Next.js, Vercel Edge Functions, AWS Lambda, and other serverless environments. Installs @neondatabase/serverless, sets up environment variables, and creates working API route examples with TypeScript types. Use when users need to connect their application to Neon, fetch or query data from a Neon database, integrate Neon with Next.js or serverless frameworks, or set up database access in edge/serverless environments where traditional PostgreSQL clients don't work.
allowed-tools: ["bash"]
---

# Neon Serverless Skill

Configures the Neon Serverless Driver for optimal performance in serverless and edge computing environments.

## When to Use

- Setting up connections for edge functions (Vercel Edge, Cloudflare Workers)
- Configuring serverless APIs (AWS Lambda, Google Cloud Functions)
- Optimizing for low-latency database access
- Implementing connection pooling for high-throughput apps

**Not recommended for:** Complex multi-statement transactions (use WebSocket Pool), persistent servers (use native PostgreSQL drivers), or offline-first applications.

## Code Generation Rules

When generating TypeScript/JavaScript code:
- BEFORE generating import statements, check tsconfig.json for path aliases (compilerOptions.paths)
- If path aliases exist (e.g., "@/*": ["./src/*"]), use them (e.g., import { x } from '@/lib/utils')
- If NO path aliases exist or unsure, ALWAYS use relative imports (e.g., import { x } from '../../../lib/utils')
- Verify imports match the project's configuration
- Default to relative imports - they always work regardless of configuration

## Reference Documentation

**Primary Resource:** See `[neon-serverless.mdc](https://raw.githubusercontent.com/neondatabase-labs/ai-rules/main/neon-serverless.mdc)` in project root for comprehensive guidelines including:
- Installation and compatibility requirements
- HTTP vs WebSocket adapter selection
- Connection pooling strategies
- Query optimization patterns
- Error handling and troubleshooting

## Quick Setup

### Installation
```bash
npm install @neondatabase/serverless
```

### Connection Patterns

**HTTP Client** (recommended for edge/serverless):
```typescript
import { neon } from '@neondatabase/serverless';
const sql = neon(process.env.DATABASE_URL!);
const rows = await sql`SELECT * FROM users WHERE id = ${userId}`;
```

**WebSocket Pool** (for Node.js long-lived connections):
```typescript
import { Pool } from '@neondatabase/serverless';
const pool = new Pool({ connectionString: process.env.DATABASE_URL! });
const result = await pool.query('SELECT * FROM users WHERE id = $1', [userId]);
```

See `templates/` for complete examples:
- `templates/http-connection.ts` - HTTP client setup
- `templates/websocket-pool.ts` - WebSocket pool configuration

## Validation

Use `scripts/validate-connection.ts` to test your database connection before deployment.

## Related Skills

- **neon-auth** - Add authentication
- **neon-js** - Full SDK with auth + data API
- **neon-drizzle** - For ORM with serverless connections
- **neon-toolkit** - For ephemeral database testing

---

**Want best practices in your project?** Run `neon-plugin:add-neon-docs` with parameter `SKILL_NAME="neon-serverless"` to add reference links.

From neondatabase/ai-rules at 1ceaf89, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at 1ceaf89

Files

4 files, 20 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 1ceaf89
All 19 skills from Neon

More from Neon

  • neon

    Neon is a cloud backend platform providing Postgres, auth, object storage, serverless functions, and an AI gateway with branching, zero-scale compute, and…

    Claude Code, Codex, Cursor +4 · about 8.5K tokens · pinned 6 days ago

  • neon-ai-gateway

    The Neon AI Gateway provides a single API endpoint and credential to access frontier and open-source LLMs from multiple providers (OpenAI, Anthropic, Google…

    Claude Code, Codex, Cursor +4 · about 4.9K tokens · pinned 6 days ago

  • neon-auth

    This skill adds Better Auth-based login to new apps using Neon's managed authentication system, where users and sessions live in a Postgres schema.

    Claude Code, Codex, Cursor +4 · about 2.9K tokens · pinned 6 days ago

  • neon-functions

    Neon Functions deploys long-running Node.js HTTP handlers to your Neon database branch, injecting DATABASE_URL and hosting stateful workloads like AI agents…

    Claude Code, Codex, Cursor +4 · about 11.9K tokens · pinned 6 days ago

  • neon-object-storage

    Neon Object Storage provides S3-compatible file storage that branches with your Neon Postgres database, keeping files and database rows in sync across…

    Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 6 days ago

  • neon-postgres

    This skill guides agents on working with Postgres databases on Neon, covering connection setup, pooled vs direct connections, schema migrations, branching…

    Claude Code, Codex, Cursor +4 · about 4K tokens · pinned 6 days ago

  • vercel-storage

    This skill guides agents through Vercel's storage ecosystem, including Blob for file uploads, Global Config for edge-accessible configuration, and Marketplace…

    by VercelOfficial publisher

    Claude Code, Codex, Cursor +3 · about 3.4K tokens · pinned 6 days ago

  • dsql

    This skill enables agents to build and manage Aurora DSQL, a serverless PostgreSQL-compatible distributed SQL database.

    by Amazon (AWS)Official publisher

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 6.5K tokens · pinned 6 days ago

  • neon-postgres-branches

    This skill helps users create and manage Neon PostgreSQL branches for testing and development.

    by NeonOfficial publisher

    Claude Code, Codex, Cursor +4 · about 3.2K tokens · pinned 6 days ago

  • prisma-postgres-setup

    This skill provisions or reuses a Prisma Postgres database and connects it to an application.

    by PrismaOfficial publisher

    Claude Code, Codex, Cursor +4 · about 850 tokens · pinned 6 days ago

  • prisma-8

    This skill helps agents work with Prisma 8, a contract-first data layer for TypeScript projects.

    by PrismaOfficial publisher

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 3.5K tokens · pinned 6 days ago

  • aws-database

    Routes database questions to the correct AWS service skill based on the user's task, selecting a database, configuring one, or comparing options.

    by Amazon (AWS)Official publisher

    Claude Code, Codex, Cursor +4 · about 1.8K tokens · pinned 6 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use