Prisma ORM setup

Picks the Prisma ORM version for a setup or connection fix, keeps existing 6 and 7 apps on theirs, starts new apps on Prisma 8 and proves the link with a read query. Use when adding Prisma to a project or when a Prisma app cannot reach its database.

Databases & SQLPack: Prisma skills82 linesprisma-orm-setup
Author
Source
prisma/skills/prisma-orm-setup @ a6f1929
License
MIT · Copyright (c) 2025 Prisma

About this skill

What it does

The skill picks the Prisma ORM major version for a setup or connection job, then connects the database. It first reads the manifest, lockfile, schema, prisma.config.ts and imports, because a Prisma 8 CLI can sit next to a legacy client. An existing Prisma 6 or 7 app keeps its version; a broken connection is no reason to upgrade.

A new app gets Prisma 8. The skill pins a published 8.x CLI rather than latest, runs prisma orm init and prisma skills sync, then reads the prisma-8 skill that ships inside the ORM package, where the detailed Prisma 8 rules live.

For Prisma 7, references/ has a page per database: PostgreSQL, MySQL/MariaDB/PlanetScale, SQLite/Turso, SQL Server/Azure SQL, CockroachDB and Prisma Postgres, each with its driver adapter (@prisma/adapter-pg, @prisma/adapter-mariadb and so on), plus v7-client-setup.md for generating and creating the client. v6-mongodb.md covers MongoDB on Prisma 6. The examples were checked with Prisma 7.10.0 and 6.19.3.

The job is done only when a read-only query through the app's own client returns data from the intended database. Secrets stay in ignored env files and are never printed.

When to use it, and when not

Use it to add Prisma to a project, connect a new database, or fix an app that cannot reach its database.

It does not run major upgrades: 6 to 7 goes to Upgrade Prisma ORM to v7, a move to Prisma 8 to prisma-postgres-upgrade for PostgreSQL or prisma-mongodb-upgrade for MongoDB. Those two, like prisma-postgres-setup, are Prisma skills outside our catalog.

How to run it

The install command below puts the whole folder in place. The agent picks the skill up when Prisma setup or a connection problem comes up; to call it yourself:

  • Claude Code: /prisma-orm-setup, or ask for the skill by name.
  • Codex: $prisma-orm-setup.
  • Cursor: type / in the Agent chat and pick prisma-orm-setup.

Example: /prisma-orm-setup Add Prisma to this Next.js app with our PostgreSQL database from DATABASE_URL and prove it with a read query.

It needs the Prisma CLI, run through the project's package manager, and the database URL.

How it differs from similar skills

Prisma CLI and Prisma Client API are Prisma 7 references for a project that already works; this skill picks the version and gets the first connection running. Neon serverless Postgres covers the Neon side: Prisma Migrate needs the direct connection string and can fail through the pooler with prepared statement "s0" already exists.

Install

Run one command — it saves SKILL.md and the files it uses into your agent's skills folder. Claude Code and Codex pick up a new skill without a restart; if it does not show up, restart the agent.

Claude Code — macOS, Linux
curl -fsSL --create-dirs -o ~/.claude/skills/prisma-orm-setup/SKILL.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/SKILL.md -o ~/.claude/skills/prisma-orm-setup/LICENSE https://anymodel.org/en/skills/prisma/prisma-orm-setup/LICENSE -o ~/.claude/skills/prisma-orm-setup/references/v6-mongodb.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v6-mongodb.md -o ~/.claude/skills/prisma-orm-setup/references/v7-client-setup.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-client-setup.md -o ~/.claude/skills/prisma-orm-setup/references/v7-cockroachdb.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-cockroachdb.md -o ~/.claude/skills/prisma-orm-setup/references/v7-mysql.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-mysql.md -o ~/.claude/skills/prisma-orm-setup/references/v7-postgresql.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-postgresql.md -o ~/.claude/skills/prisma-orm-setup/references/v7-prisma-postgres.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-prisma-postgres.md -o ~/.claude/skills/prisma-orm-setup/references/v7-sqlite.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-sqlite.md -o ~/.claude/skills/prisma-orm-setup/references/v7-sqlserver.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-sqlserver.md
Codex, Cursor — macOS, Linux
curl -fsSL --create-dirs -o ~/.agents/skills/prisma-orm-setup/SKILL.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/SKILL.md -o ~/.agents/skills/prisma-orm-setup/LICENSE https://anymodel.org/en/skills/prisma/prisma-orm-setup/LICENSE -o ~/.agents/skills/prisma-orm-setup/references/v6-mongodb.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v6-mongodb.md -o ~/.agents/skills/prisma-orm-setup/references/v7-client-setup.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-client-setup.md -o ~/.agents/skills/prisma-orm-setup/references/v7-cockroachdb.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-cockroachdb.md -o ~/.agents/skills/prisma-orm-setup/references/v7-mysql.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-mysql.md -o ~/.agents/skills/prisma-orm-setup/references/v7-postgresql.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-postgresql.md -o ~/.agents/skills/prisma-orm-setup/references/v7-prisma-postgres.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-prisma-postgres.md -o ~/.agents/skills/prisma-orm-setup/references/v7-sqlite.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-sqlite.md -o ~/.agents/skills/prisma-orm-setup/references/v7-sqlserver.md https://anymodel.org/en/skills/prisma/prisma-orm-setup/references/v7-sqlserver.md
Claude Code — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE','references/v6-mongodb.md','references/v7-client-setup.md','references/v7-cockroachdb.md','references/v7-mysql.md','references/v7-postgresql.md','references/v7-prisma-postgres.md','references/v7-sqlite.md','references/v7-sqlserver.md') { $p = Join-Path "$HOME\.claude\skills\prisma-orm-setup" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/prisma/prisma-orm-setup/$f" -UseBasicParsing -OutFile $p }
Codex, Cursor — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE','references/v6-mongodb.md','references/v7-client-setup.md','references/v7-cockroachdb.md','references/v7-mysql.md','references/v7-postgresql.md','references/v7-prisma-postgres.md','references/v7-sqlite.md','references/v7-sqlserver.md') { $p = Join-Path "$HOME\.agents\skills\prisma-orm-setup" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/prisma/prisma-orm-setup/$f" -UseBasicParsing -OutFile $p }

Any other agent: save the file into its skills folder, or give it the link to the file: https://anymodel.org/en/skills/prisma/prisma-orm-setup/SKILL.md

SKILL.md

Raw

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 point Path
Prisma 8 application Step 4, without reinitializing
New application without a version choice Step 3
Prisma 6 or 7 application, or an explicit earlier major Step 5

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; 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. 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.
  • Prisma 6 MongoDB: use MongoDB setup. 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.
Database Reference
PostgreSQL PostgreSQL
MySQL / MariaDB / PlanetScale MySQL
SQLite / Turso SQLite
Microsoft SQL Server / Azure SQL SQL Server
CockroachDB CockroachDB
MongoDB / Atlas on Prisma 6 MongoDB
Prisma Postgres with Prisma 7 Prisma Postgres

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.

Connect through AnyModel API

This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.

More from the pack Prisma skills