Index of every page on this site: llms.txt
All skills
prisma avatar

/prisma-postgres-setup

@a6f1929 official
by prismaprisma/skills80 stars
8
Run it yourself

Obtain 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"), runs or mentions `create-db` or `npx create-db`, or asks to set up or connect Prisma Postgres, including in v0 and the Vercel Marketplace. Hands Prisma ORM configuration to prisma-orm-setup; reuses an existing connection first and honors an explicit provider, driver, alternative ORM, or database-only choice.

Use this Skill: https://skilld.dev/gh/prisma/skills/prisma-postgres-setup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈137 tokens for metadata: the name and description. ≈948 when used: this file. ≈4.3k more on demand in 3 files.

Description uses 6.8% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈547 characters, or 6.8%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Prisma Postgres setup

Connect the intended database, then verify it from the application. Keep provisioning separate from ORM configuration so an existing database is reused.

1. Inspect the project

Check the user's requested ORM or driver, installed packages, database connection, and environment-loading files. Check secret presence without printing values.

  • Honor explicit choices such as Drizzle, pg, or database-only setup.
  • For query or schema work in an already configured app, use its version-matched ORM guidance; do not restart setup.

2. Reuse or obtain a database

Situation Action
Existing connection or connected integration Verify its project, database, and environment; reuse it.
v0, Vercel Marketplace, or a Vercel project Read Marketplace setup and use the native integration flow.
No database yet and no provider named Offer npx create-db@latest for a working database now with no account (it is deleted after 24 hours unless claimed, and claiming needs a free Prisma account; read the create-db section in provisioning), or a persistent database through provisioning. Ask which one when the request does not say.
Standalone persistent database Read provisioning; use an authenticated CLI, MCP tool, Console, or Management API.
Temporary development database requested Read the create-db section in provisioning, including expiry and claiming.

Resolve the workspace, project, and region before creation. If several resources fit, ask which one to use. If provisioning is blocked by permissions or quota, report the blocker; do not delete another resource or switch workspaces to get around it.

3. Connect the application

Use the connection appropriate to the chosen driver and runtime. Store it in the project's secret environment configuration, never source code or chat. Preserve unrelated entries, update the intended variable once, and ensure local secret files are ignored by Git.

Application processes and CLI commands may load different environment files. For example, a framework may load .env.development.local while a shell command does not. A variable missing from the shell does not mean the database is missing: load the intended file for that command without displaying credentials, and do not provision another database.

4. Configure the ORM and verify

For Prisma ORM setup, read prisma-orm-setup/SKILL.md directly, or load the installed prisma-orm-setup skill when the host resolves sibling skills by name. It owns ORM version selection and configuration. If that handoff is unavailable, report it.

For an explicitly selected alternative, keep that ORM or driver and use its documented setup. For database-only setup, stop after verifying connectivity.

Run a read-only query against the intended database through the application's chosen ORM or driver. Report what was connected, the selected ORM/version, and the query result without secrets. If any step is blocked or untested, say so instead of claiming setup is complete.

For Studio, SDK integrations, or database operations beyond initial setup, read operations.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts22d4 checks · Risk SAFE
  • Gen Agent Trust Hub22d

    The skill follows secure development practices, specifically cautioning against logging or printing sensitive credentials. It interacts exclusively with trusted vendor resources from Prisma and Vercel. A low-severity risk for indirect prompt injection is noted as the skill must ingest project environment files to perform configuration tasks.

  • Socket22d

    No alerts

  • Snyk22d

    Risk: LOW · No issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at a6f1929. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 3 weeks ago
metadata
{
  "author": "prisma",
  "version": "2.3.1"
}
  • Database
  • prisma
  • postgres
  • provisioning
  • management-api
  • connection-string
  • nodejs

README badge

README badge for prisma/skills/prisma-postgres-setup

Provisions a new Prisma Postgres database via the Management API and configures it in a local Node.js project with Prisma 7. Handles service token authentication, region selection, project creation, schema definition, and end-to-end connection verification.

Generated from the current SKILL.md.

Does this skill work with existing databases, or only new ones?
This skill provisions new Prisma Postgres databases via the Management API. For existing databases that are already connected, use standard Prisma CLI tasks (schema/migration work). For CI/CD preview databases or multi-tenant setups, use the dedicated skills `prisma-postgres-cicd` or `prisma-postgres-integrator`.
What authentication does this require?
You need a workspace service token from Prisma Console (Workspace Settings > Service Tokens). The skill checks for the token in your initial prompt, the PRISMA_SERVICE_TOKEN environment variable, or `.env` file before asking you to create one.
Does this set up Prisma 7?
Yes. The skill installs `@prisma/adapter-pg` (Prisma 7's driver adapter for direct PostgreSQL), creates `prisma.config.ts` for Prisma 7 configuration, and ensures connection URLs are managed there instead of in the schema.
What happens if I hit my database limit?
The skill lists your existing projects as an interactive menu, lets you pick one to delete, then retries the creation.
Does this create migration files?
Yes. When you define or confirm your schema, the skill runs `npx prisma migrate dev --name init`, which generates migration files in `prisma/migrations/` and the Prisma client in one step. This is required for CI/CD and production deployments.

Generated from the current SKILL.md. These answers refresh after source changes.