Skip to content

Guide · Agent skill

How to use the Prisma 8 Contract-First Guide agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The prisma-8 skill is a set of instructions that an AI coding agent reads before it works on a Prisma 8 project. It teaches the agent how Prisma 8 works: you describe your database structure in a data contract file, Prisma generates artifacts from it, and migrations are planned from the difference between contract versions. This guide covers what the skill does, how to install it, how to ask for help in plain language, and the safety limits you should know before letting an agent touch a database.

Prisma 8 Contract-First Guideprisma/orm · Apache-2.0

Quick start

  1. 1Confirm your project is on Prisma 8. Check that prisma.config.ts uses definePrismaConfig and that package.json depends on @prisma/orm-postgres, @prisma/orm-sqlite or @prisma/orm-mongo. If you use schema.prisma with @prisma/client, this skill does not apply.
  2. 2Download and unzip the skill. Download the ZIP from this page and unzip it so that SKILL.md and the references folder sit together.
  3. 3Place the skill folder. Move the folder into ~/.claude/skills/ for personal use, or into the project's .claude/skills/ folder for one project. Alternatively, upload the ZIP under Settings, Capabilities, Skills in the Claude apps.
  4. 4Make a natural request. Describe the change you want, such as adding a model or planning a migration. The skill activates from the content of your request.
  5. 5Review before applying. Ask for the migration plan or a dry run first, read it, and only then allow the agent to apply changes to a database.

What the skill makes the agent do

When the skill is active, the agent checks that your project is really on Prisma 8 before it acts. It confirms that prisma.config.ts uses definePrismaConfig and that package.json depends on @prisma/orm-postgres, @prisma/orm-sqlite or @prisma/orm-mongo. It also checks that the skill version matches the installed Prisma packages, and that the generated contract.json and contract.d.ts exist and are not older than the contract source.

The skill tells the agent to open the matching reference file before writing code, instead of relying on memory of older Prisma versions. The reference files cover contract editing, migrations, queries, runtime wiring, Supabase, upgrades and debugging. The agent is also told never to reset or drop a database to fix a problem.

  • Edit a contract.prisma file or a contract.ts builder and run prisma contract emit after changes
  • Plan migrations from the contract diff, review them, and edit migration.ts for data transforms
  • Write typed queries with db.orm or db.sql
  • Read dotted error codes such as MIGRATION.HASH_MISMATCH and route to the right fix

Install the prisma-8 skill

Download the skill as a ZIP from this page and unzip it. You have two choices for where it goes. For all your projects, place the unzipped folder in ~/.claude/skills/. For one project only, place it in that project's .claude/skills/ folder.

If you use the Claude apps instead, upload the ZIP under Settings, then Capabilities, then Skills. The skill folder must contain SKILL.md and its references folder together, because SKILL.md points to the reference files.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Trigger the skill with natural requests

You do not need to type a special command. The skill activates when your request matches its triggers, such as editing contract.prisma, running prisma contract emit, planning or applying migrations, writing db.orm or db.sql queries, or asking what Prisma 8 is or where to start. Mentioning an error code like MIGRATION.HASH_MISMATCH also works.

Name the task and the project, and say what you want changed. The agent will then open the reference it needs.

  • Add an optional Post model with a title and an author relation to User, then regenerate the contract
  • Plan a migration for my contract change and show me the review before applying anything
  • Write a query that lists the 10 most recent orders with their customer, using db.orm
  • Upgrade this app from one Prisma 8 release to the newer one and show me the steps
  • My deploy says MIGRATION.MARKER_MISMATCH. Help me find the fix without resetting the database

What the skill needs

The skill only works on a project that already uses Prisma 8 with one of the @prisma/orm packages listed above. It expects the prisma CLI to be available, because the workflow calls commands such as prisma contract emit, prisma skills sync and the migration commands. Migration and query steps need a database connection.

The skill runs scripts, but according to its metadata it does not use the network. Review the commands the agent proposes before it runs them.

  • Project on Prisma 8 (@prisma/orm-postgres, @prisma/orm-sqlite or @prisma/orm-mongo)
  • prisma CLI available in the project
  • A database connection for migration and query work

Safety notes before you let an agent run commands

Migration and update steps change real data. Keep a human in the loop for any production database. The skill says to reconcile non-essential databases with prisma db update, and to author migrations for databases that change only through migrations, such as production. Preview a plan first with prisma db update --dry-run or review the output of prisma migration plan.

The reference files were not included in the assessment of this skill, so their accuracy has not been confirmed. Check the agent's output yourself, especially for anything that touches a database.

  • Do not let an agent run migrations on production without reviewing them
  • Never accept a suggestion to reset or drop a database; the skill itself forbids it
  • Verify generated code against your own tests before merging
prisma db update --dry-run

Tips for getting good results

Start from a project that already builds and has a working database connection. Ask the agent to run prisma contract emit after each contract edit so that the generated artifacts stay current. If you use Vite, the skill's build reference suggests installing the contract emit plugin, which re-emits artifacts as you save.

When a migration is involved, ask for the plan before the apply step. If the plan refuses with PLAN_ORIGIN_UNKNOWN over existing migrations, ask the agent to explain the options rather than adding a flag blindly.

  • Name the file and the database target in your request
  • Ask for a plan or dry run before any migration is applied
  • If the agent says the skill does not apply, check whether your project is on Prisma ORM 7 or earlier

What people use it for

  • Adding or changing models, fields and relations in a contract.prisma file and regenerating artifacts
  • Planning and reviewing a migration before applying it to a development or staging database
  • Writing typed db.orm or db.sql queries against an existing Prisma 8 schema
  • Guiding an upgrade of a Prisma 8 app or extension package through the documented steps
  • Diagnosing a dotted error code from a failed emit, migration or runtime call

Frequently asked questions

How do I install the prisma-8 agent skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder for one project. In the Claude apps, you can instead upload the ZIP under Settings, then Capabilities, then Skills.

What does the prisma-8 skill require?

It requires a project on Prisma 8 that uses @prisma/orm-postgres, @prisma/orm-sqlite or @prisma/orm-mongo, the prisma CLI, and a database connection for migration and query steps. It runs scripts but does not use the network, according to its listing.

Is the prisma-8 skill free to use?

The source is licensed under Apache-2.0. The licence terms are the place to check the details of reuse. The page does not list any price for the skill.

Does this skill work with Prisma ORM 7 or earlier?

No. The skill is for projects using the @prisma/orm packages. Projects with schema.prisma and @prisma/client are Prisma 7 or earlier, and the skill says its instructions would break such a project.

What should I do if the agent's migration fails with an error code?

Paste the full error into your request. The skill's debug reference routes on the dotted error code, such as MIGRATION.HASH_MISMATCH, to the right fix. It forbids resetting or dropping the database as a fix, so do not accept that suggestion.

How does this compare with other ORMs or agent skills?

The source does not include a comparison with other ORMs or skills. The skill's own purpose is narrow: to help an agent work correctly with Prisma 8 and its contract-first workflow. If you need a different ORM, use a skill written for it.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you already have a Prisma 8 project and want an agent to edit contracts, plan migrations or write queries with fewer errors from outdated Prisma knowledge. Pick something else if you are on Prisma ORM 7 or earlier, or if you want an agent to run migrations unattended against production data, since the reference files were not verified.

Download the skill