Skills
Skill 7 of 10
Set up Prisma ORM in an application, connect its database, or troubleshoot the connection of an existing Prisma 6, 7, or 8 app.
3 minutes · 664 words · 6 sections
Install
npx skills add prisma/skills --skill prisma-orm-setupnpx skills add prisma/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
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 (opens in a new tab) shipped with the ORM package.
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 (opens in a new tab) 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.
When the user requests a major upgrade, load a workflow that supports the source version and provider. For PostgreSQL 7-to-8, use the Prisma migration guide (opens in a new tab); 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.
Check the selected release’s runtime requirements (opens in a new tab) and initialization guide (opens in a new tab). 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 pslUse 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.
Run the installed CLI through the project’s package manager:
prisma skills syncThen 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.
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.
| Database | Reference |
|---|---|
| PostgreSQL | PostgreSQL (opens in a new tab) |
| MySQL / MariaDB / PlanetScale | MySQL (opens in a new tab) |
| SQLite / Turso | SQLite (opens in a new tab) |
| Microsoft SQL Server / Azure SQL | SQL Server (opens in a new tab) |
| CockroachDB | CockroachDB (opens in a new tab) |
| MongoDB / Atlas on Prisma 6 | MongoDB (opens in a new tab) |
| Prisma Postgres with Prisma 7 | Prisma Postgres (opens in a new tab) |
The Prisma 7 SQL examples were verified with Prisma 7.10.0; the MongoDB examples with Prisma 6.19.3.
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.
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.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
prisma-orm-setup/SKILL.mdmain, last pushed 6 November 2026.SKILL.md, not by matching a directory convention. One layout observed: */SKILL.md.h1 and no skipped levels:/prisma/skills.md, and each skill at its own .md URL.8 files · 19 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 7.
Documentation the agent loads on demand, rather than up front.