prisma-next-contract

Installation
SKILL.md

Prisma Next — Contract Authoring

Edit your data contract. Prisma handles the rest.

The data contract is the single source of truth for your data layer. You edit a contract source — contract.prisma (PSL, the canonical surface) or contract.ts (TypeScript builder) — and the framework derives types, migrations, and runtime configuration from it. The three-step user model:

  1. You edit your data contract.
  2. The system plans the migrations for you. (prisma-next-migrations)
  3. If you need data migrations, you edit migration.ts and execute it. (prisma-next-migrations)

Behind step 1 the agent runs prisma-next contract emit after every contract edit (or installs the Vite plugin so the bundler runs it on save — see prisma-next-build). Emit reads the contract source through the provider the façade picks based on the file extension of contract: in prisma-next.config.ts, then writes two artefacts colocated with the source:

  • contract.json — the canonical, content-hashed Contract IR. Read by the planner, the runtime, and db verify.
  • contract.d.ts — the precise TypeScript types the runtime + lanes propagate when you import Contract from it.

Both files are emitted artefacts. Edit the source; never the JSON or .d.ts.

When to Use

Related skills

More from prisma/prisma-next

Installs
70
GitHub Stars
333
First Seen
9 days ago