Skip to content
Prisma ORM Setup

Prisma ORM Setup Skill

Prisma's official skill for setting up Prisma ORM or repairing an app's database connection: it detects the app's Prisma version, defaults new apps to Prisma 8 and its package-owned skill, and keeps Prisma 6 and 7 apps on their own major.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from prisma/skills.

$ npx skills add prisma/skills --skill prisma-orm-setup

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/prisma-orm-setup/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/prisma/skills.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/prisma-orm-setup ~/.claude/skills/prisma-orm-setup

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/prisma-orm-setup/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Detects the app's Prisma version, provider and runtime before changing anything
  • Defaults new apps to Prisma ORM 8 and loads its package-owned prisma-8 skill via prisma skills sync
  • Keeps Prisma 6 and 7 apps on their major for setup and connection repair
  • Provider references for PostgreSQL, MySQL, SQLite/Turso, SQL Server, CockroachDB, MongoDB and Prisma Postgres
  • Loads the right environment files without printing secrets
  • Verifies with a read-only query and reports the ORM version

Prisma ORM Setup is the skill in the prisma/skills repository that owns ORM version selection for setup and connection work. It replaces the older prisma-database-setup skill, which now only points here. It is for adding Prisma to an application, connecting its database, or fixing the connection of an existing Prisma 6, 7 or 8 app, and its guiding rule is to preserve the app's ORM version and intended database: a broken connection is not a reason for a major upgrade.

The agent first reads the package manifest, lockfile, Prisma configuration, schema and imports to work out the ORM version, database provider and runtime, noting that the CLI version alone does not tell you the app's version. A Prisma 8 app goes straight to loading its guidance. A new app defaults to Prisma ORM 8: the agent checks provider support and runtime requirements, pins a published Prisma 8 CLI, runs prisma orm init for the chosen target, then runs prisma skills sync and reads the synced prisma-8 skill that ships with the ORM package. Requested major upgrades go to dedicated upgrade skills, and Prisma Postgres provisioning to prisma-postgres-setup.

For earlier versions it keeps packages on their major and links bundled references for Prisma 7 on PostgreSQL, MySQL/MariaDB/PlanetScale, SQLite/Turso, SQL Server/Azure SQL, CockroachDB and Prisma Postgres, plus MongoDB on Prisma 6. The last step loads the right environment file for both CLI and app without printing secrets, diagnoses the connection before any schema-changing command, and verifies with a read-only query through the app's client, reporting the ORM version and the result. MIT licensed.

SKILL.md

The instructions your agent loads, as published by Prisma.

SKILL.md
name
prisma-orm-setup
description
Set up Prisma ORM in an application, connect its database, or troubleshoot the connection of an existing Prisma 6, 7, or 8 app. Defaults new applications to Prisma ORM 8 and loads the package-owned prisma-8 skill; keeps existing Prisma 6/7 apps on their version with provider references for PostgreSQL, MySQL, SQLite, SQL Server, CockroachDB, MongoDB, and Prisma Postgres.
license
MIT
metadata
author: prisma version: "1.0.0"

Prisma ORM setup

This skill owns ORM version selection for setup and connection work. Preserve the application's ORM version and intended database. A connection repair does not require a major upgrade.

New applications default to Prisma ORM 8. Detailed Prisma 8 configuration, queries, migrations, and runtime code belong to the versioned prisma-8 skill shipped with the ORM package.

1. Detect the starting point

Read the package manifest, lockfile, Prisma configuration, schema, and application imports. Identify the ORM version, database provider, and runtime. The CLI version alone does not identify the application's version: a Prisma 8 CLI can coexist with a legacy client, so inspect @prisma/client, @prisma/prisma7, and the schema and configuration.

Starting pointPath
Prisma 8 applicationStep 4, without reinitializing
New application without a version choiceStep 3
Prisma 6 or 7 application, or an explicit earlier major[Step 5](#5-set-up-or-repair-an-earlier-version)

For a new application, check the selected Prisma 8 release's provider support and runtime requirements before installing. If the provider is unsupported, explain the limitation and offer an explicitly selected earlier version. Keep the requested database; do not silently fall back or invent a supported target.

Use an existing database when supplied. Load prisma-postgres-setup only when Prisma Postgres is needed and no connection has been selected yet; return here once connected.

2. Handle requested major upgrades separately

When the user requests a major upgrade, load a workflow that supports the source version and provider. For PostgreSQL 6 or 7 to 8 in one pass, use [prisma-postgres-upgrade](../prisma-postgres-upgrade/SKILL.md); for PostgreSQL 7-to-8 one route at a time, use the route-by-route guide; for MongoDB 6-to-8, use [prisma-mongodb-upgrade](../prisma-mongodb-upgrade/SKILL.md). Other providers need an explicitly supported migration path. prisma-upgrade-v7 covers 6 to 7; the package-owned prisma-8 upgrade reference covers updates within 8.

3. Bootstrap a new Prisma 8 application

Check the selected release's runtime requirements and initialization guide. Resolve and pin a published Prisma CLI 8 release, including its prerelease suffix if needed; verify its version before initialization. Do not rely on a floating latest remaining version 8.

Use the project's package manager to run the installed CLI. For PostgreSQL and Prisma schema language authoring:

prisma orm init --yes --target postgres --authoring psl

Use the supported target for the selected provider. Preserve existing application files and connection configuration; do not let setup provision an unrelated database. Verify that the resolved ORM package is version 8 before proceeding.

4. Load the installed Prisma 8 guidance

Run the installed CLI through the project's package manager:

prisma skills sync

Then read the synced prisma-8/SKILL.md, for example .agents/skills/prisma-8/SKILL.md, and follow its preconditions and selected references. Syncing alone does not load the instructions. If the package-owned guidance cannot be loaded, report the blocker. Continue with step 6.

5. Set up or repair an earlier version

For a new setup that explicitly selects an earlier version, pin packages to that major and use its runtime requirements. Keep the CLI, client, and SQL adapter releases compatible. Existing dependencies need not change for a connection repair.

  • Prisma 7 SQL: use the provider reference below and [client setup](references/v7-client-setup.md).
  • Prisma 6 MongoDB: use [MongoDB setup](references/v6-mongodb.md). SQL driver adapters do not apply.
  • Prisma 6 SQL: preserve its generator, schema URL, and client initialization. Use the provider's connection details below and the Prisma 6 documentation; do not copy the Prisma 7 configuration or adapter examples into it.
DatabaseReference
PostgreSQL[PostgreSQL](references/v7-postgresql.md)
MySQL / MariaDB / PlanetScale[MySQL](references/v7-mysql.md)
SQLite / Turso[SQLite](references/v7-sqlite.md)
Microsoft SQL Server / Azure SQL[SQL Server](references/v7-sqlserver.md)
CockroachDB[CockroachDB](references/v7-cockroachdb.md)
MongoDB / Atlas on Prisma 6[MongoDB](references/v6-mongodb.md)
Prisma Postgres with Prisma 7[Prisma Postgres](references/v7-prisma-postgres.md)

The Prisma 7 SQL examples were verified with Prisma 7.10.0; the MongoDB examples with Prisma 6.19.3.

6. Connect and verify

The CLI and the application can load different environment files. Load the intended environment for each without printing secrets, and keep credentials in ignored environment files or the host's secret configuration. For SQL adapters, make the adapter's runtime options address the same database as the CLI connection URL.

For an existing app, preserve schema, migrations, and generator configuration unless the requested work requires changes. Diagnose the connection before running schema-changing commands.

Run the project's relevant checks and a read-only query through the application's client against the intended database. Report the ORM version, the loaded prisma-8 skill version where applicable, and the query result. Package installation or a successful skill sync alone is not a completed setup.

Install

Prisma's official Prisma Client reference skill: client setup with driver adapters, CRUD and bulk queries, select/include/omit, filters, relation reads and nested writes, transactions and safe raw SQL.

Prisma's official skill for migrating an ORM project from v6 to v7 - the prisma-client generator, driver adapters, prisma.config.ts, ESM entrypoints and every removed API.

Prisma's official skill for getting an app a Prisma Postgres database: reuse an existing connection, use the Vercel Marketplace flow, spin up a no-account database with npx create-db, or provision a persistent one, then connect and verify it.

Browse all skills →