nextjs-prisma

Set up a singleton Prisma client for Next.js App Router server components and actions.

42|9|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/drvoss/everything-copilot-cli --skill nextjs-prisma
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-prisma
Source: https://github.com/drvoss/everything-copilot-cli/tree/main/skills/development/nextjs-prisma
Command: npx skills add https://github.com/drvoss/everything-copilot-cli --skill nextjs-prisma

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the challenge of safely integrating Prisma with Next.js App Router projects by providing a reliable singleton client and server-friendly data access patterns.

Core Features & Use Cases

  • Singleton Prisma client setup across hot reloads
  • Data fetching in server components
  • Server actions with Prisma
  • Environment setup and pitfall guidance

Quick Start

Create a centralized Prisma client and integrate it into your Next.js App Router project, then fetch data from server components.

Frequently Asked Questions about nextjs-prisma

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a singleton Prisma client in Next.js App Router to survive hot reloads?

A singleton Prisma client in Next.js App Router prevents exhausting database connections during development hot reloads by storing the client instance globally. This skill provides the reliable singleton setup pattern to ensure safe server-side data access across reloads.

How do I fetch data with Prisma inside Next.js server components?

Fetching data with Prisma in Next.js server components involves directly querying the database using the singleton Prisma client within the server component. This skill outlines server-friendly data access patterns for type-safe queries directly inside server components without additional API routes.

Can I use Prisma with Next.js server actions for data mutations?

Yes, you can use Prisma with Next.js server actions for data mutations by calling the singleton client directly inside the action handler. This skill covers implementing type-safe queries and mutations securely within server actions.

What are common pitfalls when integrating Prisma with Next.js 13 or 14 App Router?

Common pitfalls when integrating Prisma with Next.js App Router include creating new client instances on every request and misconfiguring environment variables. This skill provides environment setup guidance and pitfall avoidance for robust server data access.

Does this Prisma data access pattern work for both fetching and mutations in server components?

Yes, this Prisma data access pattern works for both fetching and mutations in server components and server actions. It provides functional requirements for type-safe queries, server component data fetching, and mutations tailored for Next.js 13 and 14 App Router projects.