All skills
prisma avatar

/prisma-postgres-setup

@b491588 official
by prismaprisma/skills66 stars
7

Obtain or reuse a Prisma Postgres database and connect an application. Use for "set up Prisma Postgres", "connect my app to Prisma Postgres", or Prisma Postgres setup in v0 and Vercel Marketplace. Hands Prisma ORM configuration to prisma-orm-setup; honors an explicit driver, alternative ORM, or database-only choice.

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

This session only. Nothing lands on disk.

referencesprovisioning.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Standalone provisioning

First reuse an existing connection or resource. For v0 or Vercel Marketplace, use the native integration flow instead.

Persistent databases

Choose an available authenticated surface: Prisma Console, the Prisma Platform CLI, a connected Prisma MCP server, or the Management API. Reuse existing authentication; do not ask the user to paste tokens into chat.

  • Console: select the intended workspace and project at Prisma Console, then obtain the database's connection details.
  • Platform CLI: inspect the current command help before mutation. The package is @prisma/cli, distinct from the prisma ORM CLI. Start with npx -y @prisma/cli@latest database --help; discover list, create, and connection commands from that version.
  • MCP: discover available tools and their input schemas. Confirm the workspace and resource context before invoking a provisioning tool. Missing tools or authentication are blockers, not permission to switch accounts.
  • Management API: use the current schema at https://api.prisma.io/v1, or installed SDK types, for exact endpoints and payloads. Do not copy an older project/database response shape blindly.

List available regions and select one consistent with the user's location requirements and application. Resolve the intended workspace, project, and, where required, branch before creating a database. Follow pagination when listing resources. If creation is asynchronous, poll the returned resource until ready with a bounded wait; report a timeout without creating a replacement. Before retrying an ambiguous creation request, check whether it succeeded to avoid duplicates.

Store returned connection credentials immediately in the intended secret environment. Some credentials are shown only once. Select the direct or pooled endpoint appropriate to the chosen driver and runtime; inspect the returned connection details instead of assuming every endpoint is interchangeable.

Authentication and errors

For server-to-server API access, use a workspace service token from the user's secret environment. If one is needed, direct the user to Workspace Settings → Service Tokens in Console and have them store it locally or in their secret manager. Use the bearer token without logging it. For an integration acting on behalf of users, use OAuth instead; see operations.

Failure Response
Authentication or permission denied Explain which authentication or access is missing.
Resource not found Verify the resource ID and workspace; do not create a replacement automatically.
Invalid request Check the current schema and selected region.
Rate limit or transient read failure Retry with bounded backoff, honoring retry guidance.
Quota exhausted Report the limit and available options.

Temporary databases with create-db

Use create-db only when a temporary, claimable development database fits the request. By default, the database is available for 24 hours and is automatically deleted if unclaimed. Claim it through the returned claim URL before its expiry to keep it; claiming requires a Prisma account. Use the returned expiry as the deadline if a different lifetime was selected. See the documented lifecycle.

Inspect the current commands when selecting a region or a non-default lifetime:

npx create-db@latest create --help
npx create-db@latest regions --help

Choose a supported region and lifetime. Store the connection string and claim URL privately, then tell the user when the database expires and how to claim it using the returned lifecycle information. Do not promise persistence until claiming is complete. Avoid flags that print credentials into shared output.

For programmatic provisioning, the create-db package exposes create() and regions(). Check the installed types, handle success and error results, and store returned connection/claim information without logging it. See the create-db documentation.

Source: SKILL.md on GitHub

No alerts2d4 checks · Risk SAFE
  • Gen Agent Trust Hub2d

    This skill is a database provisioning tool that interacts with the Prisma Management API. It involves command execution for project setup and verification, and processes natural language descriptions to generate schemas.

  • Socket2d

    No alerts

  • Snyk2d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub yesterday.

Activeupdated 2 days ago
metadata
{
  "author": "prisma",
  "version": "2.0.0"
}
  • 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.