nextjs-prisma

A workflow for Next.js applications using the App Router and Prisma, a tool that lets application code query a database with typed models.

In plain words
What is it for?
Use it to set up Prisma, fetch data in Server Components, debug client-instantiation problems, and build typed create, read, update, and delete operations.
Why use it?
It helps avoid repeated database-client instances during development and keeps database operations type-safe across server-side code and API endpoints.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/drvoss/everything-copilot-cli/nextjs-prisma
Any agent
npx skills add drvoss/everything-copilot-cli --skill nextjs-prisma
Clone the repo
git clone --depth 1 https://github.com/drvoss/everything-copilot-cli

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 738 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00038 $0.00738
Opus 5 $0.00019 $0.00369
Sonnet 5 $0.00008 $0.00148
Haiku 4.5 $0.00004 $0.00074

Measured 3d ago against content hash a6cd81522756, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nextjs-prisma scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/development/nextjs-prisma/SKILL.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Next.js + Prisma Combo Skill

When to Use

  • Setting up Prisma in a new Next.js App Router project
  • Reviewing or refactoring data-fetching logic in Server Components
  • Debugging Prisma client instantiation issues (hot-reload client explosion)
  • Implementing type-safe CRUD operations across Server Actions and API routes

Workflow

1. Singleton Client Setup

Ensure Prisma client is instantiated only once across hot reloads:

Next.js version note: The global cache pattern below is recommended for Next.js 13/14. In Next.js 15 (with React 19), module-level singletons are stable across hot reloads — you can use export const prisma = new PrismaClient(...) directly in lib/prisma.ts.

// lib/prisma.ts  (Next.js 13/14 pattern)
import { PrismaClient } from "@prisma/client"

const globalForPrisma = global as unknown as { prisma: PrismaClient }

export const prisma =
  globalForPrisma.prisma ??
  new PrismaClient({
    log: process.env.NODE_ENV === "development" ? ["query", "error"] : ["error"],
  })

if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma

2. Data Fetching in Server Components

// app/users/page.tsx
import { prisma } from "@/lib/prisma"

export default async function UsersPage() {
  // Runs on the server — safe to use Prisma directly
  const users = await prisma.user.findMany({
    select: { id: true, name: true, email: true },
    orderBy: { createdAt: "desc" },
  })
  return <UserList users={users} />
}

3. Server Actions with Prisma

// app/users/actions.ts
"use server"
import { prisma } from "@/lib/prisma"
import { revalidatePath } from "next/cache"

export async function createUser(data: { name: string; email: string }) {
  await prisma.user.create({ data })
  revalidatePath("/users")
}

4. Avoiding Common Pitfalls

  • Never import prisma in "use client" components — it will fail at runtime
  • Use prisma.$transaction() when a page requires multiple dependent writes
  • Apply select to limit fields — avoid sending sensitive columns to the client
  • Run prisma generate after every schema change before running the dev server

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 102 lines · 38 tokens per session scan A a6cd81522756

Subscribe to this mod's changes

nextjs-prisma is a skill published in the GitHub repository drvoss/everything-copilot-cli (45 stars, last pushed 6d ago), licensed MIT. It adds 38 tokens to every session and 738 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

code-apps

Power Apps Code Apps(コードファースト)の初期化・Dataverse 接続・UI 設計・開発・デプロイ。TypeScript + React + Tailwind CSS で開発する。CSP 構成・メール送信パターンも含む。.

geekfujiwara/CodeAppsDevelopmentStandard · 66 tokens

data-access-abstraction

Data access abstraction patterns for apps that need to swap between local databases (SQLite) and cloud databases (Cosmos DB, PostgreSQL) without changing application code. Covers Node.js/TypeScript, Python/FastAPI, and .NET. Use when building apps that run locally with SQLite and deploy to Azure with Cosmos DB or…

DanWahlin/github-azure-agentic-journeys · 73 tokens

n8n-azure

Application-specific configuration for deploying n8n to Azure Container Apps with PostgreSQL. Infrastructure should be generated fresh by the azure-prepare → azure-validate → azure-deploy pipeline.

DanWahlin/github-azure-agentic-journeys · 27 tokens

persisting-data-with-drift

Implements type-safe reactive SQL persistence in Flutter using Drift v2.32 (formerly Moor) built on SQLite with automatic code generation. Activates when defining table schemas with Drift DSL, writing type-safe join or subquery operations, handling schema migrations with MigrationStrategy, using reactive watch()…

Poorgramer-Zack/dart-expert-skills · 136 tokens

managing-hive-storage

Hive CE (Community Edition v2.19.x) NoSQL object database for Flutter providing blazing-fast key-value and object storage with TypeAdapters. Use this skill when implementing offline-first architecture, high-performance local data caching, NoSQL document-style object stores, custom TypeAdapter serialization for complex…

Poorgramer-Zack/dart-expert-skills · 146 tokens

marklogic-fasttrack

Build a MarkLogic FastTrack search UI — designing the search options set that drives facets, timelines, and maps, and scaffolding the React app that consumes it. Use when configuring search options for a faceted UI, adding facet or date-bucket or geospatial constraints, deciding between path-index and json-property…

tternquist/marklogic-mcp · 104 tokens