What problem does it solve?
This skill solves the problem of improper Prisma usage with Next.js 16 App Router on Neon serverless databases by enforcing shared client instances, safe server/client boundaries, and efficient query patterns.
Core Features & Use Cases
- Singleton PrismaClient: Always import and reuse a single Prisma client from app/_lib/prisma.ts to avoid connection exhaustion.
- Server Components & Data Fetching: Fetch data in Server Components with selective fields and memoization to reduce payload and latency.
- Server Actions & Mutations: Place mutations under app/_actions with input validation and automatic revalidation to keep data fresh.
- Performance & Security: Follow Neon serverless best practices and optionally implement RLS with Prisma for multi-tenant isolation.
Quick Start
Set up the shared Prisma client by importing from '@/app/_lib/prisma' and replace direct new PrismaClient() instances. Then run a sample server component query to verify a single shared client is used and that data is fetched with minimal payload.