Skip to main content

Build

Prisma Orm Setup

PrismaOfficialCertified

Set up Prisma ORM in an application, connect its database, or troubleshoot the connection of an existing Prisma 6, 7, or 8 app, including a `DATABASE_URL` that is missing, a placeholder, or unreachable. 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.

  • 2 installs
  • v1.0.2
  • Reviewed Sep 29
  • No reviews yet

Capabilities

  • Detect the starting point

    Read the package manifest, lockfile, Prisma configuration, schema, and…

  • Bootstrap a new Prisma 8 application

    Check the selected release's runtime requirements and initialization…

  • Load the installed Prisma 8 guidance

    Then read the synced prisma-8/SKILL.md, for example…

  • Set up or repair an earlier version

    For a new setup that explicitly selects an earlier version, pin…

Getting started

Full instructions

Install the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.

Instructions: SKILL.mdv1.0.2

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:

bash
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:

bash
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. If there is no database to connect to, see No working database.

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.

No working database

Use this only when the application has no database it can reach. Confirm that first, in the environment file the failing command actually loads, without printing secrets:

  • DATABASE_URL is unset or empty;
  • it still holds a placeholder, such as postgresql://user:password@localhost:5432/mydb, which prisma orm init (Prisma 8) and prisma init (Prisma 7) write;
  • or it names a server that cannot be reached, such as localhost:5432 with no PostgreSQL running.

If it names a database the user set up, such as a hosted server or a local one they run, repair that connection instead of offering a new database. When there is no database, tell the user and offer these PostgreSQL options, in this order, and ask before creating anything:

  1. npx create-db@latest: a temporary Prisma Postgres database with no account and nothing to install. It prints a connection string and a claim URL. The database is deleted after 72 hours unless claimed with a free Prisma account; the output gives the exact deletion time. The create-db section of provisioning has the details.
  2. A local PostgreSQL. Prisma 8: PostgreSQL in Docker, as in A database on your machine. In Prisma 8, npx prisma dev runs a Prisma Composer app, so do not offer it as a database. Prisma 6 and 7: npx prisma dev starts a local Prisma Postgres (on Prisma 6, only releases whose prisma --help lists dev). With a Prisma 7 driver adapter, use the TCP postgres:// URL it prints.
  3. The user's own PostgreSQL server or hosting provider: set DATABASE_URL to its connection string.

A user who already has a Prisma account can also get a persistent database through prisma-postgres-setup. For a provider other than PostgreSQL, ask the user for a database of that provider.

Write the connection string and claim URL only where the user asks, for example .env, kept out of Git. Never put them in source code, commits, or logs. The user needs the claim URL to keep a create-db database, so give it to them with the deletion time.

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

More from Prisma

View source →
prisma-client-apiPrisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany",…3 installsprisma-database-setupDeprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.1 installsprisma-computeDeploy and operate apps on Prisma Compute with the Prisma 8 CLI. Use whenever the user mentions Prisma Compute, deploying or hosting a Prisma app, `prisma deploy`, `prisma dev module.ts`, Prisma Composer apps (`module.ts`, `compute()`, the…0 installsprisma-driver-adapter-implementationRequired reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers…0 installsprisma-mongodb-upgradeDecision and migration guide for Prisma ORM MongoDB projects on v6, which have no upgrade path to v7. Use when a MongoDB project asks about upgrading Prisma, when "upgrade to prisma 7" comes up in a project with provider = "mongodb", or…0 installsprisma-postgres-setupObtain or reuse a Prisma Postgres database and connect an application. Use when the user needs a database and has none configured ("I need a database", "add a Postgres database", "set up a database for this app"), is about to deploy, host,…0 installs

Frequently asked questions about prisma-orm-setup

What does the prisma-orm-setup skill do?

Set up Prisma ORM in an application, connect its database, or troubleshoot the connection of an existing Prisma 6, 7, or 8 app, including a `DATABASE_URL` that is missing, a placeholder, or unreachable. 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. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the prisma-orm-setup skill?

Run `npx @skills-hub-ai/cli install prisma-orm-setup` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/prisma-orm-setup/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does prisma-orm-setup work with?

prisma-orm-setup runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the prisma-orm-setup skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use prisma-orm-setup after installing it?

In Claude Code, type `/prisma-orm-setup` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the prisma-orm-setup skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/prisma-orm-setup)](https://skills-hub.ai/skills/prisma-orm-setup)
HTML
<a href="https://skills-hub.ai/skills/prisma-orm-setup"><img src="https://skills-hub.ai/api/badges/skill/prisma-orm-setup" alt="Install on Skills Hub"></a>

More options in the badge docs.