Agent skill

Prisma Postgres Setup

by curvenote in curvenote/curvenote

Set up a new Prisma Postgres database and connect it to a local project using the Management API.

MITAuto-check: notesDatabases

Install Prisma Postgres Setup

skills CLI
$ npx skills add curvenote/curvenote --skill prisma-postgres-setup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install curvenote/curvenote prisma-postgres-setup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/curvenote/curvenote.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/prisma-postgres-setup .claude/skills/prisma-postgres-setup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
prisma-postgres-setup
GitHub stars
169
Used in
1 other repo
Token cost
~2.7k tokens
SKILL.md length
1,173 words
Files
5 (incl. references)
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Set up a new Prisma Postgres database and connect it to a local project using the Management API.

  • Works in 7 steps: Authenticate → List available regions → Create a project with a database → …
  • Asked to set up a database
  • SKILL.md covers When to Apply, Prerequisites, UX Guidelines and Workflow, plus 2 more sections
  • Calls npx, curl and npm; reaches api.prisma.io and console.prisma.io; needs PRISMA_SERVICE_TOKEN

What it does

Prisma Postgres Setup is an agent skill from curvenote/curvenote. Set up a new Prisma Postgres database and connect it to a local project using the Management API. Use when asked to "set up a database", "create a Prisma Postgres project", "get a connection string", "connect my app to Prisma Postgres", or "provision a database".

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/api-basics.md`, `references/auth.md` and `references/endpoints.md`).

It sits in Databases, covering ORMs and data access. It works with PostgreSQL and Prisma. The repository describes itself as: Create, edit, share, and publish scientific and technical documents. The licence is MIT.

When your agent uses it

  • Asked to set up a database
  • Create a Prisma Postgres project
  • Get a connection string
  • Connect my app to Prisma Postgres

Example prompts

  • “set up a database”
  • “create a Prisma Postgres project”
  • “get a connection string”
  • “/prisma-postgres-setup”

Requirements

  • Node.js
  • A credential in PRISMA_SERVICE_TOKEN

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Authenticate
  2. List available regions
  3. Create a project with a database
  4. Create a named connection (optional)
  5. Configure the local project
  6. Define schema and push
  7. Verify the connection

What it can do on your machine

Read from SKILL.md and the folder at commit 91febfe. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • curl
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.prisma.io
    • console.prisma.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • PRISMA_SERVICE_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Prisma Postgres Setup loads about 2.7k tokens when it runs, and up to ~5.6k if it reads all its reference files. Until then it costs about 71 tokens; SKILL.md has 1,173 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:53
    MA_SERVICE_TOKEN` in the environment or `.env` file.
  • NoteMentions a .env fileSKILL.md:136
    - `dotenv` — loads `.env` variables for `prisma.config.ts`
  • NoteMentions a .env fileSKILL.md:138
    . Write the direct connection string to `.env`. **Append** to the file if it already exists — do not overwrite existing
  • NoteMentions a .env fileSKILL.md:144
    3. Verify `.gitignore` includes `.env`. Create `.gitignore` if it does not exist. Warn the user if `.env` is not gitigno
  • NoteMentions a .env fileSKILL.md:177
    imported in `prisma.config.ts` to load `.env` variables

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from curvenote/curvenote at commit 91febfe, republished under its MIT licence (© curvenote). 1,173 words, ~2,691 tokens.

Download SKILL.mdSave it as .claude/skills/prisma-postgres-setup/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
prisma-postgres-setup
description
Set up a new Prisma Postgres database and connect it to a local project using the Management API. Use when asked to "set up a database", "create a Prisma Postgres project", "get a connection string", "connect my app to Prisma Postgres", or "provision a database".
license
MIT
metadata.author
prisma
metadata.version
1.1.0

Prisma Postgres Setup

Procedural skill that guides you through provisioning a new Prisma Postgres database via the Management API and connecting it to a local project.

When to Apply

Use this skill when:

  • Setting up a new Prisma Postgres database for a project
  • Creating a Prisma Postgres project and connecting it locally
  • Obtaining a connection string for Prisma Postgres
  • Provisioning a database via the Management API (not the Console UI)

Do not use this skill when:

  • Setting up CI/CD preview databases — use prisma-postgres-cicd
  • Building multi-tenant database provisioning into an app — use prisma-postgres-integrator
  • Working with a database that already exists and is connected (schema/migration tasks are standard Prisma CLI)

Prerequisites

  • Node.js 18+
  • A Prisma Postgres workspace (create one at https://console.prisma.io if needed)
  • A workspace service token (see references/auth.md)

UX Guidelines

When presenting choices to the user (region selection, project deletion, etc.), use your platform's interactive selection mechanism (e.g., ask tool in Claude Code, structured prompts in other agents). Do not print static tables and ask the user to type a value — present selectable options so the user can pick with minimal effort.

Workflow

Follow these steps in order. Each step includes the API call to make and how to handle the response.

Step 1: Authenticate

You need a service token. Try these methods in order:

1a. Token in the user's prompt

Check if the user included a service token in their initial message (e.g., "Set up Prisma Postgres with token eyJ..."). If so, use it exactly as provided — do not truncate, re-encode, or round-trip it through a file. Store it in a shell variable for subsequent calls.

1b. Token in the environment

Check for PRISMA_SERVICE_TOKEN in the environment or .env file.

1c. Ask the user to create one

If no token is available, instruct the user:

Create a service token in Prisma Console → Workspace Settings → Service Tokens. Copy the token and paste it here.

Read references/auth.md for details on service token creation.

Once you have a token, store it in a shell variable (PRISMA_SERVICE_TOKEN) and use it for all subsequent API calls.

Step 2: List available regions

Fetch the list of available Prisma Postgres regions to let the user choose where to deploy.

bash
curl -s -H "Authorization: Bearer $PRISMA_SERVICE_TOKEN" \
  https://api.prisma.io/v1/regions/postgres

The response contains an array of regions with id, name, and status. Only present regions where status is available.

Present the regions as an interactive menu — let the user pick from options rather than typing a region ID manually.

Read references/endpoints.md for the full response shape.

Step 3: Create a project with a database
bash
curl -s -X POST https://api.prisma.io/v1/projects \
  -H "Authorization: Bearer $PRISMA_SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "<project-name>",
    "region": "<region-id>",
    "createDatabase": true
  }'

Use the current directory name as the project name by default.

The response is wrapped in { "data": { ... } }. Extract:

  • data.id — the project ID (prefixed with proj_)
  • data.database.id — the database ID (prefixed with db_)
  • data.database.connections[0].endpoints.direct.connectionString — the direct PostgreSQL connection string

Use the direct connection string (endpoints.direct.connectionString). Do not use the pooled or accelerate endpoints — those are for legacy Accelerate setups and not needed for new projects.

If the response status is provisioning, wait a few seconds and poll GET /v1/databases/<database-id> until status is ready.

If creation fails due to a database limit, list the user's existing projects and present them as an interactive menu for deletion. After the user picks one, delete it and retry.

Read references/endpoints.md for the full request/response shapes.

Step 4: Create a named connection (optional)

If you need a dedicated connection (e.g., per-developer or per-environment), create one:

bash
curl -s -X POST https://api.prisma.io/v1/databases/<database-id>/connections \
  -H "Authorization: Bearer $PRISMA_SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "dev" }'

Extract the direct connection string from data.endpoints.direct.connectionString.

Step 5: Configure the local project
  1. Install dependencies:
bash
npm install prisma @prisma/client @prisma/adapter-pg pg dotenv

All five packages are required:

  • prisma — CLI for migrations, schema push, client generation
  • @prisma/client — the generated query client
  • @prisma/adapter-pg — Prisma 7 driver adapter for direct PostgreSQL connections
  • pg — Node.js PostgreSQL driver (used by the adapter)
  • dotenv — loads .env variables for prisma.config.ts
  1. Write the direct connection string to .env. Append to the file if it already exists — do not overwrite existing entries:
DATABASE_URL="<direct-connection-string>"
  1. Verify .gitignore includes .env. Create .gitignore if it does not exist. Warn the user if .env is not gitignored.

  2. Ensure package.json has "type": "module" set (Prisma 7 generates ESM output).

  3. If prisma/schema.prisma does not exist, run npx prisma init to scaffold the project. This creates both prisma/schema.prisma and prisma.config.ts.

  4. Ensure schema.prisma has the postgresql provider and no url or directUrl in the datasource block (Prisma 7 manages connection URLs in prisma.config.ts, not in the schema):

prisma
datasource db {
  provider = "postgresql"
}
  1. Ensure prisma.config.ts loads the connection URL from the environment:
typescript
import path from 'node:path'
import { defineConfig } from 'prisma/config'
import 'dotenv/config'

export default defineConfig({
  earlyAccess: true,
  schema: path.join(import.meta.dirname, 'prisma', 'schema.prisma'),
  datasource: {
    url: process.env.DATABASE_URL!,
  },
})

Important Prisma 7 notes:

  • Connection URLs go in prisma.config.ts, never in schema.prisma
  • The provider in schema.prisma must be "postgresql" (not "prismaPostgres")
  • dotenv/config must be imported in prisma.config.ts to load .env variables
Show full SKILL.md (420 more words)Show less
Step 6: Define schema and push

If the schema already has models, skip to pushing. Otherwise, present these options as an interactive menu:

  1. "I'll define my schema manually" — Tell the user to edit prisma/schema.prisma and come back when ready. Wait for them before proceeding.
  2. "Give me a starter schema" — Add a Blog starter schema (User, Post, Comment with relations) to prisma/schema.prisma. Show the user what was added and ask if they want to adjust it before pushing.
  3. "I'll describe what I need" — Ask the user to describe their data model in natural language (e.g., "I'm building a task manager with projects, tasks, and team members"). Generate a schema from the description, show it, and ask for confirmation before pushing.

Once the schema has models and the user is ready, create a migration and generate the client:

bash
npx prisma migrate dev --name init

This creates migration files in prisma/migrations/ and generates the client in one step. Migration history is essential for CI/CD workflows (prisma migrate deploy) and production deployments.

Only use npx prisma db push if the user explicitly asks for prototyping-only mode (no migration history). In that case, follow it with npx prisma generate.

Step 7: Verify the connection

After generating the client, create and run a quick verification script to confirm everything works end-to-end. This is critical — do not skip this step.

Create a file named test-connection.ts:

typescript
import 'dotenv/config'
import pg from 'pg'
import { PrismaPg } from '@prisma/adapter-pg'
import { PrismaClient } from './generated/prisma/client.js'

const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL })
const adapter = new PrismaPg(pool)
const prisma = new PrismaClient({ adapter })

const result = await prisma.$queryRawUnsafe('SELECT 1 as connected')
console.log('Connected to Prisma Postgres:', result)

await prisma.$disconnect()
await pool.end()

Run it:

bash
npx tsx test-connection.ts

Prisma 7 client instantiation rules:

  • Import from ./generated/prisma/client.js (not ./generated/prisma)
  • Create a pg.Pool with the DATABASE_URL connection string
  • Wrap it in a PrismaPg adapter
  • Pass { adapter } to the PrismaClient constructor
  • Do not use datasourceUrl — that option does not exist in Prisma 7
  • Do not use new PrismaClient() with no arguments — it will throw

After verification succeeds, delete test-connection.ts.

Then share links for the user to explore their database:

  • Prisma Studio (CLI): npx prisma studio — opens a visual data browser locally
  • Console: https://console.prisma.io/<workspaceId>/<projectId>/<databaseId>/dashboard — strip the prefixes (wksp_, proj_, db_) from the IDs returned in Step 3 to build this URL

Read references/prisma7-client.md for the full client instantiation reference.

Error Handling

Read references/api-basics.md for the full error reference. Key self-correction patterns:

HTTP StatusError CodeAction
401authentication-failedService token is invalid or expired. Ask the user to create a new one in Console → Workspace Settings → Service Tokens.
404resource-not-foundCheck that the resource ID includes the correct prefix (proj_, db_, con_).
422validation-errorCheck request body against the endpoint schema. Common: missing name, invalid region.
429rate-limit-exceededBack off and retry after a few seconds.

Reference Files

Detailed API and usage information is in:

references/auth.md             — Service token creation and usage
references/api-basics.md       — Base URL, envelope, IDs, errors, pagination
references/endpoints.md        — Endpoint details for projects, databases, connections, regions
references/prisma7-client.md   — Prisma 7 client instantiation and usage patterns

© curvenote, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in .agents/skills/prisma-postgres-setup of curvenote/curvenote.

  • SKILL.md
  • references/api-basics.md
  • references/auth.md
  • references/endpoints.md
  • references/prisma7-client.md

Open the folder on GitHubat commit 91febfe

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in curvenote/curvenote, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Prisma Postgres Setup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Prisma Postgres Setup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prisma Postgres Setup this skillcurvenote/curvenote1691 repos~2.7kAutomated safety check: NotesMIT
Better Drizzlealmeidazs/better-drizzle347—~1.7kAutomated safety check: PassApache-2.0
Add Backendahpxex/open-dashboard146—~3.6kAutomated safety check: PassMIT
Database FundamentalsDanielPodolsky/ownyourcode2901 repos~1.6kAutomated safety check: PassMIT
Database Expertcin12211/orca-q223—~2.8kAutomated safety check: PassMIT
Prisma 8 Contract-First ORMprisma/orm48k—~3.7kAutomated safety check: NotesApache-2.0

Similar skills

  • Better Drizzle

    almeidazs/better-drizzle

    Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), client.users.findMany, paginate, cursor, upsertMany, relation include/connect…

    347 GitHub stars~1.7k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Add Backend

    ahpxex/open-dashboard

    Everything about the data layer — pick one of six ready-to-run backend templates (TanStack Start + Drizzle + better-auth, Hono + Drizzle + better-auth, Hono + Prisma + better-auth, Hono + Drizzle +…

    146 GitHub stars~3.6k tokensUpdated 3 mo ago
    DatabasesAuto-check passed
  • Database Fundamentals

    DanielPodolsky/ownyourcode

    Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.

    290 GitHub starsUsed in 1 repo~1.6k tokens
    DatabasesAuto-check passed
  • Database Expert

    cin12211/orca-q

    Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.

    223 GitHub stars~2.8k tokensUpdated 15 days ago
    DatabasesAuto-check passed
  • Official

    Routes Prisma 8 tasks such as contracts, migrations, queries and upgrades to the right reference files for projects on the contract-first @prisma/orm packages.

    48k GitHub stars~3.7k tokensUpdated today
    DatabasesAuto-check: notes
  • DB Sculptor

    EliasOulkadi/shokunin

    Design database schemas with Prisma/Drizzle, PostgreSQL index strategy (B-tree, GIN, GiST, BRIN, Hash), query optimization (EXPLAIN ANALYZE), migration safety (expand/contract, zero-downtime), and…

    114 GitHub stars~3.1k tokensUpdated 2 days ago
    DatabasesAuto-check: notes

More from curvenote/curvenote

All 10 skills in this repo
  • Supabase

    curvenote/curvenote

    A skill your agent uses when doing ANY task involving Supabase.

    169 GitHub starsUsed in 5 repos~2.2k tokens
    Auto-check passed
  • React Router Framework Mode

    curvenote/curvenote

    Build full-stack React applications using React Router's framework mode.

    169 GitHub starsUsed in 4 repos~1.1k tokens
    Auto-check passed
  • Prisma Database Setup

    curvenote/curvenote

    Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.).

    169 GitHub starsUsed in 3 repos~1.4k tokens
    Auto-check passed
  • Prisma Client API

    curvenote/curvenote

    Prisma Client API reference covering model queries, filters, operators, and client methods.

    169 GitHub starsUsed in 2 repos~1.6k tokens
    Auto-check passed
  • Prisma Postgres

    curvenote/curvenote

    Prisma Postgres setup and operations guidance across Console, create-db CLI, Management API, and Management API SDK.

    169 GitHub starsUsed in 1 repo~937 tokens
    Auto-check: notes
  • Prisma CLI

    curvenote/curvenote

    Prisma CLI commands reference covering all available commands, options, and usage patterns.

    169 GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed

Categories

Questions about Prisma Postgres Setup

What does Prisma Postgres Setup do?

Set up a new Prisma Postgres database and connect it to a local project using the Management API. Prisma Postgres Setup is an agent skill from curvenote/curvenote. Set up a new Prisma Postgres database and connect it to a local project using the Management API.

When should I use Prisma Postgres Setup?

Prisma Postgres Setup fits situations like: asked to set up a database; create a Prisma Postgres project; get a connection string; connect my app to Prisma Postgres.

How do I install Prisma Postgres Setup in Claude Code?

Run `npx skills add curvenote/curvenote --skill prisma-postgres-setup -a claude-code`. Or copy the skill folder (.agents/skills/prisma-postgres-setup in curvenote/curvenote) into .claude/skills/prisma-postgres-setup in your project. Claude Code loads it when a task matches its description.

How do I install Prisma Postgres Setup in Codex?

Run `npx skills add curvenote/curvenote --skill prisma-postgres-setup -a codex`. Or copy the skill folder (.agents/skills/prisma-postgres-setup in curvenote/curvenote) into .agents/skills/prisma-postgres-setup in your project. Codex loads it when a task matches its description.

Can I use Prisma Postgres Setup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add curvenote/curvenote --skill prisma-postgres-setup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prisma-postgres-setup, .gemini/skills/prisma-postgres-setup, .github/skills/prisma-postgres-setup and .opencode/skills/prisma-postgres-setup in your project.

What does Prisma Postgres Setup need to run?

Going by SKILL.md and its folder, Prisma Postgres Setup needs the command-line tools its instructions call (npx, curl and npm) and credentials named PRISMA_SERVICE_TOKEN. Our summary lists: Node.js; A credential in PRISMA_SERVICE_TOKEN.

Does Prisma Postgres Setup access the network?

SKILL.md names 2 domains. In commands or code: api.prisma.io and console.prisma.io; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Prisma Postgres Setup safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Prisma Postgres Setup use?

Prisma Postgres Setup is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prisma Postgres Setup use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.9k tokens, read only when the agent opens those files.

What are the alternatives to Prisma Postgres Setup?

Skills that share tags, products or a category with Prisma Postgres Setup: Better Drizzle (almeidazs/better-drizzle, 347 stars), Add Backend (ahpxex/open-dashboard, 146 stars), Database Fundamentals (DanielPodolsky/ownyourcode, 290 stars) and Database Expert (cin12211/orca-q, 223 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prisma Postgres Setup?

curvenote (a GitHub organization) maintains it in curvenote/curvenote, which has 169 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on September 28, 2026.

Source: curvenote/curvenote on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.