prisma-8

작성자: prisma

Comprehensive guide for building with Prisma 8 (Prisma Next), the contract-first data layer. Use whenever working on Prisma code in a project that uses it —…

npx skills add https://github.com/prisma/prisma --skill prisma-8

Prisma Next (Prisma 8)

Edit your data contract. Prisma handles the rest.

Prisma Next is a contract-first data layer. This skill routes every Prisma Next task to the right reference file — open the reference before writing code; do not answer from this file alone.

The canonical model (one paragraph)

You author a data contract (a contract.prisma file, or a TypeScript builder). The framework emits machine-readable artifacts (contract.json, contract.d.ts) and gives you two runtime surfaces on SQL targets: a typed SQL query builder (db.sql.<ns>.<table>) and a typed ORM client (db.orm.<ns>.<Model>). On MongoDB targets only the ORM lane exists, and its keys are collection storage names (db.orm.users) rather than PSL model names — references/queries.md § MongoDB ORM addressing covers the rule. Migrations are planned from the contract diff; you review them, optionally edit the migration.ts for data transforms, and apply.

Three steps the user does:

  1. Edit your data contract. (references/contract.md)
  2. The system plans the migrations for you. (references/migrations.md)
  3. If you need data migrations, you edit migration.ts and execute it. (references/migrations.md)

Everything else — queries, runtime wiring, build integration, debugging, feedback — sits on top of those three.

Routing table

Open the reference whose triggers match the task. If more than one matches, open each — they are written to compose.

TaskReferenceTriggers
Adopt / set up / first stepsreferences/quickstart.mdnew project, existing database, "what can I do with Prisma Next", "where do I start", "just ran createprisma", npx create-prisma, first steps, first query, prisma-next init greenfield setup, contract infer + db sign brownfield adoption, connect-write-read first arc, day-to-day commands (contract emit, db init, db update, migration plan, migrate, db schema, db verify), flags --target / --authoring / --schema-path / --probe-db / --output
Edit the data contractreferences/contract.mdschema, models, fields, attributes, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (@@discriminator / @@base), extension namespaces (pgvector.Vector(...), cipherstash.EncryptedString(...)), prisma.config.ts / defineConfig, prisma-next contract emit, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, @internal/postgres/config, @internal/postgres/contract-builder, @internal/mongo/config, extensions:, pgvector, cipherstash, postgis, paradedb, @@control, control policy (managed / tolerated / external / observed), soft delete, validations, callbacks
Author migrationsreferences/migrations.mddb update vs migration plan, migrate, migration new, migration show, db update --dry-run, db verify, db sign, data migration, dataTransform, placeholder sentinels in framework-rendered migration.ts, MIGRATION.HASH_MISMATCH, PN-MIG-2001 unfilled placeholder, schema drift
Review migrations on deployreferences/migration-review.md"what migrations are going to run", "what runs on deploy / merge", merge conflict, diamond convergence, concurrent migrations, migration status, ref management for CI, staging / production environment refs, MIGRATION.DIVERGED, MIGRATION.NO_MARKER, MIGRATION.MARKER_NOT_IN_HISTORY, migrate status, migrate diff, migrate resolve
Write queriesreferences/queries.mdquery, where, select, project, orderBy, take, skip, include, lookup, first, all, count, aggregate, groupBy, create, update, delete, upsert, returning, transaction, db.orm, db.sql, db.query.from(...) (Mongo pipeline), namespace-aware accessors, .all() Thenable, single-use iterators (RUNTIME.ITERATOR_CONSUMED), target-declared aggregate types (count, integer sum, and integer avg are number; count and integer sum throw outside ±(2^53 − 1) rather than round, while avg is a fraction already and carries no guard; countBigInt / sumBigInt / avgDecimal are the lossless forms, avgDecimal on PostgreSQL only), drizzle-style, kysely-style. Postgres/SQLite specifics: references/queries-postgres.md; Mongo specifics: references/queries-mongo.md
Wire the runtimereferences/runtime.mddb.ts, postgres<Contract>(...) / sqlite<Contract>(...) / mongo<Contract>(...) façades, middleware composition (telemetry, lints, budgets), DATABASE_URL, .env, connection pool / poolOptions, dev vs prod config, transactions, read replicas, multi-database, script won't exit / hangs, db.close / pool.end, await using / [Symbol.asyncDispose]
Build-tool integrationreferences/build.mdVite plugin (@internal/vite-plugin-contract-emit, Vite 7/8), vite.config.ts, contract emit on save, HMR / dev server, Next.js / Webpack / esbuild / Rollup / Turbopack (named gaps, not fabricated)
Supabasereferences/supabase.md@internal/extension-supabase, RLS, row level security, policies (policy_select / policy_update / @@rls, auth.uid()), role binding (asUser(jwt) / asAnon() / asServiceRole()), auth.users, cross-space FKs to supabase:auth.AuthUser, JWT / JWKS (SUPABASE_JWKS_URL, SUPABASE_JWT_SECRET), SUPABASE.JWT_INVALID, SUPABASE.CONFIG_INVALID, RoleBoundDb, session pooler
Debug an errorreferences/debug.mdany structured error envelope (code, domain, severity, why, fix, meta), emit failed, query won't typecheck, query crashed, migration won't apply, MIGRATION.HASH_MISMATCH, BUDGET.ROWS_EXCEEDED, BUDGET.TIME_EXCEEDED, RUNTIME.ABORTED, PLAN.HASH_MISMATCH, CONTRACT.MARKER_MISSING, PN-RUN-* / PN-MIG-* / PN-CLI-* / PN-SCHEMA-* codes, drift, capability missing, planner conflict, EXPLAIN, query log, script won't exit / close connection
File feedback / ask the teamreferences/feedback.mdbug report, file an issue, feature request, missing feature, capability gap, "this is broken", surprising behaviour, Q&A / design discussion, ask the Prisma team, Prisma Discord (pris.ly/discord), extension-author questions

Routing rules

If the task clearly matches a row, open that reference directly without asking.

For a vague prompt, ask one disambiguating question. Pick from:

If you still can't tell which reference applies, ask the user what they want to do. Do not guess.

Checklist

  • If the task matches a routing-table row, open that reference before writing code.
  • If the prompt is vague, ask one disambiguating question.
  • Do not attempt to answer from this file alone — the references carry the verified tool surface.
  • If the user describes a missing feature or a misbehaviour they want fixed, open references/feedback.md.

prisma의 다른 스킬

prisma-cli-migrate-reset
prisma
prisma 마이그레이션 리셋
official
prisma-cli-validate
prisma
prisma 검증. 이 Prisma 기능을 사용할 때 참조하세요.
official
prisma-next-extension-upgrade
prisma
Upgrade Prisma Next in your extension. Bumps every `@prisma-next/*` dependency to the requested target (or npm `latest`), runs the per-transition upgrade…
official
adr-review
prisma
하나 이상의 ADR을 새로운 시각으로(사전 맥락이 없는 팀원으로서) 검토하고, 서사 및 구조적 문제를 식별한 후 재작성합니다. 다음과 같은 경우에 사용하세요…
official
prisma-next-upgrade
prisma
Upgrade Prisma Next in your app. Bumps every `@prisma-next/*` dependency from the version pinned in the lockfile to the requested target (or npm `latest`),…
official
prisma-cli
prisma
Prisma CLI 명령어, 옵션, 워크플로우에 대한 완전한 참조로, 설정, 마이그레이션, 데이터베이스 작업 전반을 다룹니다. 우선순위별로 정리된 20개 이상의 명령어를 포함합니다: 설정(init), 생성(generate), 개발(dev), 데이터베이스 작업(db pull/push/seed/execute), 마이그레이션(migrate dev/deploy/reset/status/diff/resolve). Prisma 7.x 변경 사항을 포함합니다: 새로운 prisma.config.ts 설정 파일, 제거된 플래그(--skip-generate, --skip-seed, --schema, --url), 명시적...
official
prisma-client-api
prisma
Prisma Client API 전체 참조: 모델 쿼리, CRUD 작업, 필터링, 관계 및 트랜잭션. findUnique, findMany, create, update, delete, upsert 및 반환 변형이 있는 대량 작업을 포함한 17가지 모델 쿼리 메서드를 다룹니다. select, include, omit, orderBy, take, skip, cursor 및 distinct를 포함한 결과 형태를 지정하는 쿼리 옵션을 제공합니다. equals, in, contains, startsWith, lt, gt와 같은 스칼라 및 논리 필터 연산자와 some,...을 포함한 관계 필터를 포함합니다.
official
prisma-compute
prisma
Prisma Compute deployment and hosting guide. Use whenever the user mentions Prisma Compute, `prisma.compute.ts`, `defineComputeConfig`, deploying or hosting a Prisma app, `@prisma/cli app deploy`, `compute:deploy`, `create-prisma --deploy`, `PRISMA_SERVICE_TOKEN`, `auth workspace`, Compute apps/deployments/build logs/domains, `@prisma/cli agent install`, localhost vs `0.0.0.0`, deploy port binding, or framework deploy readiness for Hono, Elysia, Next.js, TanStack Start, Astro, Nuxt, Svelte,...
developmentdevopsofficial