prisma-8

Guides contract-first data layer development with Prisma Next across contracts, migrations, queries, and runtime wiring.

47.6k|2.5k|Updated Jun 20, 2019
One-click install
npx skills add https://github.com/prisma/prisma --skill prisma-8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-8
Source: https://github.com/prisma/prisma/tree/main/skills/prisma-8
Command: npx skills add https://github.com/prisma/prisma --skill prisma-8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Prisma Next (Prisma 8) is a new contract-first data layer whose APIs evolve quickly, so AI agents and developers relying on outdated training knowledge produce broken code. This Skill ships version-accurate guidance inside the installed Prisma packages and routes every Prisma Next task to the correct reference file.

Core Features & Use Cases

  • Task Routing: A routing table maps tasks — contract authoring, migrations, queries, runtime wiring, build integration, Supabase/RLS, debugging, upgrades, feedback — to dedicated reference files with verified workflows.
  • Contract-First Workflows: Covers editing contract.prisma (PSL) or TypeScript builders, emitting contract.json/contract.d.ts, planning and applying migrations, and writing db.orm / db.sql queries.
  • Structured Error Diagnosis: Routes PN-* error codes, runtime envelopes, and SQL driver errors to concrete fixes.
  • Use Case: A developer asks their AI agent to add a pgvector embedding column and migrate the database; the agent opens the contract and migrations references, edits the contract source, re-emits, plans the migration, and applies it correctly for the installed Prisma version.

Quick Start

Ask your AI agent to help with any Prisma Next task, such as adding a model to your data contract or planning a migration, and it will consult the matching reference file before writing code.

Frequently Asked Questions about prisma-8

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

FAQPage Schema
How do I add a model or field in Prisma Next?

Edit the contract source file referenced by prisma.config.ts — contract.prisma (PSL) or contract.ts (TypeScript builder) — then run prisma contract emit to regenerate contract.json and contract.d.ts. Never edit the emitted artifacts directly.

How do migrations work in Prisma 8?

The system plans migrations from the contract diff via migration plan, and you review or edit the generated migration.ts for data transforms before applying with db migrate. Plan origin resolves from --from, then the db ref, then an empty database.

Does Prisma Next support Prisma ORM 7 projects?

No. This guidance applies only to Prisma Next (Prisma 8) projects using contract.prisma, prisma.config.ts, and @internal/* imports. Projects using schema.prisma with @prisma/client on ORM 7 or earlier are explicitly out of scope.

What databases does Prisma Next support?

Prisma Next supports PostgreSQL and SQLite with both a typed SQL query builder (db.sql) and an ORM client (db.orm), plus MongoDB with only the ORM lane addressed by collection storage names. Extensions add pgvector, PostGIS, and Supabase support.

Why did migration plan produce a from-scratch plan over existing migrations?

migration plan never chains from the newest migration on disk; without --from or a db ref it plans from an empty database. The CLI refuses this with MIGRATION.PLAN_ORIGIN_UNKNOWN — set a ref with migration ref set or pass --from explicitly.

How do I debug PN-* error codes in Prisma Next?

Read the structured error envelope's code, severity, why, fix, and meta fields, then route on the code — for example PN-CLI-4011 means missing extension packs in the config. For PN-RUN-3000 wrappers, check meta.code for the real underlying error.