You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: prisma-compute/SKILL.md
+31-15Lines changed: 31 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: prisma-compute
3
-
description: Prisma Compute deployment and hosting guide. Use whenever the user mentions Prisma Compute, deploying or hosting a Prisma app, `@prisma/cli app deploy`, `compute:deploy`, `create-prisma --deploy`, `PRISMA_SERVICE_TOKEN`, Compute apps/deployments/logs/domains, localhost vs `0.0.0.0`, deploy port binding, or framework deploy readiness for Hono, Elysia, Next.js, TanStack Start, Astro, Nuxt, Svelte, Nest, or Turborepo.
3
+
description: Prisma Compute deployment and hosting guide. Use whenever the user mentions Prisma Compute, `prisma.compute.ts`, `defineComputeConfig`, deploying or hosting a Prisma app, `@prisma/cli app deploy`, `compute:deploy`, `create-prisma --deploy`, `PRISMA_SERVICE_TOKEN`, Compute apps/deployments/logs/domains, localhost vs `0.0.0.0`, deploy port binding, or framework deploy readiness for Hono, Elysia, Next.js, TanStack Start, Astro, Nuxt, Svelte, Nest, or Turborepo.
4
4
license: MIT
5
5
metadata:
6
6
author: prisma
@@ -35,7 +35,7 @@ Set `PRISMA_COMPUTE_RUNNER=bunx` to use `bunx` instead of `npx`.
35
35
36
36
Prefer evidence that matches the user's project and installed tooling:
37
37
38
-
1. The project's generated scripts and config, especially `compute:deploy`, `prisma.app.json`, framework config, and `package.json`.
38
+
1. The project's generated scripts and config, especially `prisma.compute.ts`, `compute:deploy`, framework config, and `package.json`.
39
39
2. Current CLI help output from `create-prisma` and `@prisma/cli`.
40
40
3. Local installed package code, generated artifacts, and type definitions.
41
41
4. Official docs or launch notes, especially after Compute is public.
@@ -48,6 +48,7 @@ Use this skill for:
48
48
49
49
- Creating a new app that can deploy to Prisma Compute
50
50
- Deploying an existing TypeScript app to Prisma Compute
51
+
- Creating or updating a typed `prisma.compute.ts` deploy config
51
52
- Deciding whether a framework is Compute-ready
52
53
- Debugging `create-prisma --deploy`, `compute:deploy`, or `app deploy`
| 3 | Runtime host and port binding | CRITICAL |`runtime-`|
81
-
| 4 | Branch, environment, and database wiring | HIGH |`env-`|
82
-
| 5 | Deploy operations | HIGH |`deploy-`|
83
-
| 6 | SDK and API automation | MEDIUM |`sdk-`|
85
+
| 4 | Typed Compute config | HIGH |`config-`|
86
+
| 5 | Branch, environment, and database wiring | HIGH |`env-`|
87
+
| 6 | Deploy operations | HIGH |`deploy-`|
88
+
| 7 | SDK and API automation | MEDIUM |`sdk-`|
84
89
85
90
## Quick Rules
86
91
@@ -91,11 +96,12 @@ Use this skill for:
91
96
-`verify-prisma-vs-platform-cli` - Do not assume `prisma app deploy` exists in the ORM CLI; check whether the task should use `@prisma/cli`.
92
97
-`verify-generated-scripts` - Prefer the generated `compute:deploy` script when a project already has one.
93
98
-`verify-public-url` - After a real deploy, smoke-test the public deployment URL instead of trusting local or readiness-only checks.
99
+
-`verify-config-support` - For `prisma.compute.ts`, verify current CLI help/source because published package help may lag the repo.
94
100
95
101
### 2. Framework Readiness
96
102
97
103
-`framework-cli-first` - Evaluate deploy readiness against current `@prisma/cli app deploy`, not against what `create-prisma` can scaffold.
98
-
-`framework-supported-cli-deploy` - Current CLI deploy framework keys are `nextjs`, `hono`, `tanstack-start`, and `bun`; verify help/source before using any other key.
104
+
-`framework-supported-cli-deploy` - Current CLI source supports `nextjs`, `nuxt`, `astro`, `hono`, `tanstack-start`, and `bun`; verify installed help/source before relying on a key.
99
105
-`framework-create-prisma-defaults-only` - `create-prisma` can provide generated defaults and `compute:deploy`, but it is not the general deploy surface for existing apps.
100
106
-`framework-build-output` - Compute needs a server entrypoint or framework artifact, not only static output.
101
107
@@ -105,7 +111,15 @@ Use this skill for:
105
111
-`runtime-match-http-port` - The app must listen on the deployed HTTP port: read `process.env.PORT` when possible, or pass the matching `--http-port`.
106
112
-`runtime-readiness-port-only` - Compute readiness watches listening ports; a loopback-only listener can look ready while public ingress cannot reach it.
107
113
108
-
### 4. Branch, Environment, and Database
114
+
### 4. Typed Compute Config
115
+
116
+
-`config-use-prisma-compute-ts` - Put reusable deploy defaults in `prisma.compute.ts` with `defineComputeConfig`, not in `prisma.config.ts` or legacy `prisma.app.json`.
117
+
-`config-app-vs-apps` - Use `app` for a single deploy target and `apps` for monorepos or multi-app repos; define exactly one.
118
+
-`config-targets` - In multi-app configs, `prisma-cli app deploy web` selects the `apps.web` target, while a bare deploy can deploy every target when the CLI supports deploy-all.
119
+
-`config-no-project-branch-secrets` - Do not commit Workspace, Project, Branch, production intent, service tokens, or secret values in `prisma.compute.ts`; keep those in flags, `.prisma/local.json`, env storage, or CI secrets.
120
+
-`config-flags-win` - Explicit deploy flags such as `--framework`, `--entry`, `--http-port`, and `--env` override matching config values.
121
+
122
+
### 5. Branch, Environment, and Database
109
123
110
124
-`env-do-not-leak-secrets` - Never print full `DATABASE_URL`, service tokens, or secret values.
111
125
-`env-deploy-loads-dotenv` - The generated deploy script passes `--env .env`; ensure production values are present before deploy.
@@ -114,23 +128,23 @@ Use this skill for:
114
128
-`env-branch-scope` - Branch deploys, branch env vars, and branch databases must use the same branch name; pass `--branch <git-name>` explicitly when targeting a preview branch.
115
129
-`env-production-vs-preview` - Use `--role production` for production env, `--role preview` for preview template env, and `--branch <git-name>` for branch-specific overrides.
116
130
117
-
### 5. Deploy Operations
131
+
### 6. Deploy Operations
118
132
119
133
-`deploy-prod-intent` - Use `--prod --yes` only when the user intends a production deploy.
120
134
-`deploy-noninteractive-auth` - Non-interactive deploys need either stored CLI login or a supported service token env var; never print the token.
121
135
-`deploy-json-for-agents` - Use `--json --no-interactive` for scripts and agent-readable output.
122
136
123
-
### 6. SDK and API
137
+
### 7. SDK and API
124
138
125
139
-`sdk-use-cli-first` - Prefer `@prisma/cli app deploy` for app workflows; use `create-prisma` only to scaffold a new app unless the user is building lower-level automation.
126
140
-`sdk-result-handling` - `@prisma/compute-sdk` returns `Result` values; check `isOk()`/`isErr()` instead of relying on exceptions.
127
141
128
142
## Preferred Workflow
129
143
130
-
1. Inspect the project: package manager, template/framework, `package.json` scripts, Prisma version, Prisma client location, and existing `compute:deploy`.
144
+
1. Inspect the project: package manager, template/framework, `package.json` scripts, Prisma version, Prisma client location, `prisma.compute.ts`, and existing `compute:deploy`.
131
145
2. Verify CLI help output for the package actually being used, or run `scripts/verify-compute-surface.mjs` for the standard Compute surface check.
132
146
3. Choose the path:
133
-
- existing app deploy: generated `compute:deploy` or `@prisma/cli app build/run/deploy`
If a future Prisma ORM CLI exposes `prisma app deploy`, use the local project command after verifying `prisma app deploy --help`.
24
24
25
+
## Typed Compute Config
26
+
27
+
For reusable deploy defaults, prefer `prisma.compute.ts` over long command lines. Read [`compute-config.md`](compute-config.md) before creating or editing it.
bunx @prisma/cli@latest app deploy api --branch feature/login --json
69
+
```
70
+
71
+
Config values are deploy defaults. Explicit flags such as `--framework`, `--entry`, `--http-port`, and `--env` override matching config values. `prisma.compute.ts` does not select Workspace, Project, Branch, database, or production scope; continue to use flags, project linking, env storage, and CI secrets for those.
72
+
25
73
## Auth and Project Binding
26
74
27
75
Useful commands:
@@ -62,6 +110,12 @@ bunx @prisma/cli@latest project show --json
If `prisma.compute.ts` defines a `name` or an `apps` key, that config can provide the app name. `--app` and `PRISMA_APP_ID` rank above the config value. `[app]` selects a target from `apps` when the installed CLI supports typed compute config:
114
+
115
+
```bash
116
+
bunx @prisma/cli@latest app deploy api --project proj_123 --branch feature/login --json
117
+
```
118
+
65
119
Branch scope must line up across deploys, databases, and env vars:
66
120
67
121
-`app deploy --branch <git-name>` creates a deployment for that branch.
If the deploy should create and wire a Prisma Postgres database for the deploy target, current `app deploy` exposes `--db`; use `--no-db` to skip database setup. Treat any generated connection URL as a one-time secret.
101
155
156
+
Database setup is not part of `prisma.compute.ts` in the current beta. Keep database intent explicit with `--db`, `--no-db`, `database create`, and project env commands.
157
+
102
158
## Build and Run Locally
103
159
104
160
Before deploy, verify that the app can produce a Compute artifact:
bunx @prisma/cli@latest app run --build-type bun --entry src/index.ts --port 8080
116
172
```
117
173
174
+
With a compute config, pass the target name instead of repeating framework/entry/port flags:
175
+
176
+
```bash
177
+
bunx @prisma/cli@latest app build api
178
+
bunx @prisma/cli@latest app run api --port 8080
179
+
```
180
+
118
181
`app run --port` sets `PORT` for local development. It does not rewrite an app's explicit host binding, so a local run is not enough to prove the deployed server is reachable from ingress.
bunx @prisma/cli@latest app deploy api --prod --yes --env .env
279
+
```
280
+
281
+
Use config for stable app defaults, and flags for one-off project, branch, env, database, and production choices.
282
+
283
+
## Legacy Config
284
+
285
+
Do not create `prisma.app.json`. It is legacy and no longer the Compute app config path. If a project has custom build settings there, move them into the relevant `build` block in `prisma.compute.ts` and delete `prisma.app.json`.
0 commit comments