prisma-compute
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrisma Compute
Prisma Compute
Guide agents through Prisma Compute app creation, deployment, operations, and framework-specific deploy readiness.
为Agent提供Prisma Compute应用创建、部署、运维以及特定框架部署就绪情况的指导。
Critical: Verify the Current Surface
关键步骤:验证当前命令界面
Prisma Compute is actively moving into the Prisma Platform CLI. Before giving commands or editing a project, verify the local/current command surface:
bash
bunx @prisma/cli@latest app deploy --help
bunx @prisma/cli@latest app --help
bunx create-prisma@latest --helpUse for Compute app deployment unless current help output shows the command has moved. Use for new-project scaffolding after verifying appears in .
@prisma/cli@latestcreate-prisma@latest--deploycreate-prisma@latest --helpFor a compact agent-readable summary, run:
bash
node prisma-compute/scripts/verify-compute-surface.mjsSet to use instead of .
PRISMA_COMPUTE_RUNNER=bunxbunxnpxPrisma Compute 正逐步整合到 Prisma Platform CLI 中。在提供命令或修改项目之前,请验证本地/当前的命令界面:
bash
bunx @prisma/cli@latest app deploy --help
bunx @prisma/cli@latest app --help
bunx create-prisma@latest --help除非当前帮助输出显示命令已迁移,否则请使用 进行 Compute 应用部署。在验证 中包含 参数后,使用 进行新项目脚手架搭建。
@prisma/cli@latestcreate-prisma@latest --help--deploycreate-prisma@latest如需获取供Agent快速阅读的精简摘要,请运行:
bash
node prisma-compute/scripts/verify-compute-surface.mjs设置 可使用 替代 。
PRISMA_COMPUTE_RUNNER=bunxbunxnpxSource-of-Truth Order
信息优先级顺序
Prefer evidence that matches the user's project and installed tooling:
- The project's generated scripts and config, especially ,
compute:deploy, framework config, andprisma.app.json.package.json - Current CLI help output from and
create-prisma.@prisma/cli - Local installed package code, generated artifacts, and type definitions.
- Official docs or launch notes, especially after Compute is public.
If these disagree, trust the more local/current source and explain the mismatch briefly.
优先采用与用户项目及已安装工具匹配的信息:
- 项目生成的脚本和配置,尤其是 、
compute:deploy、框架配置和prisma.app.json。package.json - 和
create-prisma的当前 CLI 帮助输出。@prisma/cli - 本地已安装的包代码、生成的产物以及类型定义。
- 官方文档或发布说明,尤其是在 Compute 公开之后。
如果上述信息存在冲突,请以更本地化/最新的信息为准,并简要说明不一致之处。
When to Apply
适用场景
Use this skill for:
- Creating a new app that can deploy to Prisma Compute
- Deploying an existing TypeScript app to Prisma Compute
- Deciding whether a framework is Compute-ready
- Debugging ,
create-prisma --deploy, orcompute:deployapp deploy - Managing Compute app logs, deployments, environment variables, branches, and domains
- Running non-interactive deploys with browser auth or Prisma service tokens
- Programmatic deployments with or Management API integrations
@prisma/compute-sdk
本技能适用于以下场景:
- 创建可部署到 Prisma Compute 的新应用
- 将现有 TypeScript 应用部署到 Prisma Compute
- 判断某框架是否支持 Compute 部署
- 调试 、
create-prisma --deploy或compute:deploy命令app deploy - 管理 Compute 应用的日志、部署、环境变量、分支和域名
- 使用浏览器认证或 Prisma 服务令牌执行非交互式部署
- 通过 或管理 API 集成实现程序化部署
@prisma/compute-sdk
Decision Tree
决策树
-
Existing project deployment or redeploy: Read.
references/app-deploy-cli.md -
Framework-specific build/runtime work: Read.
references/frameworks.md -
New project from a scaffold: Read.
references/create-prisma.md -
Programmatic deployment, SDKs, APIs, or low-level service/version concepts: Read.
references/sdk-api.md -
Build, auth, env, deploy, or runtime failures: Read.
references/troubleshooting.md
-
现有项目部署或重新部署: 阅读。
references/app-deploy-cli.md -
特定框架的构建/运行时相关工作: 阅读。
references/frameworks.md -
从脚手架创建新项目: 阅读。
references/create-prisma.md -
程序化部署、SDK、API 或底层服务/版本概念: 阅读。
references/sdk-api.md -
构建、认证、环境、部署或运行时故障排查: 阅读。
references/troubleshooting.md
Rules by Priority
优先级规则
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Command verification | CRITICAL | |
| 2 | Framework readiness | CRITICAL | |
| 3 | Runtime host and port binding | CRITICAL | |
| 4 | Branch, environment, and database wiring | HIGH | |
| 5 | Deploy operations | HIGH | |
| 6 | SDK and API automation | MEDIUM | |
| 优先级 | 分类 | 影响程度 | 前缀 |
|---|---|---|---|
| 1 | 命令验证 | 关键 | |
| 2 | 框架就绪性 | 关键 | |
| 3 | 运行时主机与端口绑定 | 关键 | |
| 4 | 分支、环境与数据库配置 | 高 | |
| 5 | 部署操作 | 高 | |
| 6 | SDK 与 API 自动化 | 中 | |
Quick Rules
快速规则
1. Command Verification
1. 命令验证
- - Run current help output before assuming package names or flags.
verify-help-first - - Use
verify-helper-scriptfor a compact current CLI summary when available.scripts/verify-compute-surface.mjs - - Do not assume
verify-prisma-vs-platform-cliexists in the ORM CLI; check whether the task should useprisma app deploy.@prisma/cli - - Prefer the generated
verify-generated-scriptsscript when a project already has one.compute:deploy - - After a real deploy, smoke-test the public deployment URL instead of trusting local or readiness-only checks.
verify-public-url
- - 在假设包名或参数之前,先查看当前帮助输出。
verify-help-first - - 若可用,使用
verify-helper-script获取当前 CLI 的精简摘要。scripts/verify-compute-surface.mjs - - 不要假设 ORM CLI 中存在
verify-prisma-vs-platform-cli;需检查任务是否应使用prisma app deploy。@prisma/cli - - 若项目已生成
verify-generated-scripts脚本,优先使用该脚本。compute:deploy - - 实际部署完成后,对公开部署 URL 进行冒烟测试,而非仅依赖本地或就绪性检查。
verify-public-url
2. Framework Readiness
2. 框架就绪性
- - Evaluate deploy readiness against current
framework-cli-first, not against what@prisma/cli app deploycan scaffold.create-prisma - - Current CLI deploy framework keys are
framework-supported-cli-deploy,nextjs,hono, andtanstack-start; verify help/source before using any other key.bun - -
framework-create-prisma-defaults-onlycan provide generated defaults andcreate-prisma, but it is not the general deploy surface for existing apps.compute:deploy - - Compute needs a server entrypoint or framework artifact, not only static output.
framework-build-output
- - 根据当前
framework-cli-first评估部署就绪性,而非依赖@prisma/cli app deploy可搭建的模板。create-prisma - - 当前 CLI 部署支持的框架标识为
framework-supported-cli-deploy、nextjs、hono和tanstack-start;使用其他标识前需验证帮助文档/源码。bun - -
framework-create-prisma-defaults-only可提供生成的默认配置和create-prisma,但并非现有应用的通用部署界面。compute:deploy - - Compute 需要服务器入口点或框架产物,而非仅静态输出。
framework-build-output
3. Runtime Host and Port Binding
3. 运行时主机与端口绑定
- - Deployed servers must bind on all interfaces (
runtime-bind-all-interfacesor the framework equivalent), not hard-coded0.0.0.0orlocalhost.127.0.0.1 - - The app must listen on the deployed HTTP port: read
runtime-match-http-portwhen possible, or pass the matchingprocess.env.PORT.--http-port - - Compute readiness watches listening ports; a loopback-only listener can look ready while public ingress cannot reach it.
runtime-readiness-port-only
- - 部署的服务器必须绑定到所有接口(
runtime-bind-all-interfaces或框架等效配置),而非硬编码的0.0.0.0或localhost。127.0.0.1 - - 应用必须监听部署指定的 HTTP 端口:尽可能读取
runtime-match-http-port,或传入匹配的process.env.PORT参数。--http-port - - Compute 通过监听端口判断就绪状态;仅绑定回环地址的监听器可能显示就绪,但外部流量无法访问。
runtime-readiness-port-only
4. Branch, Environment, and Database
4. 分支、环境与数据库
- - Never print full
env-do-not-leak-secrets, service tokens, or secret values.DATABASE_URL - - The generated deploy script passes
env-deploy-loads-dotenv; ensure production values are present before deploy.--env .env - - Redeploy scripts do not run migrations or seed data. Run the appropriate Prisma database scripts separately.
env-migrations-separate - - Current
env-cli-token-nameuses@prisma/clifor service-token auth; older Compute CLI and SDK examples may usePRISMA_SERVICE_TOKEN.PRISMA_API_TOKEN - - Branch deploys, branch env vars, and branch databases must use the same branch name; pass
env-branch-scopeexplicitly when targeting a preview branch.--branch <git-name> - - Use
env-production-vs-previewfor production env,--role productionfor preview template env, and--role previewfor branch-specific overrides.--branch <git-name>
- - 绝不要打印完整的
env-do-not-leak-secrets、服务令牌或机密值。DATABASE_URL - - 生成的部署脚本会传入
env-deploy-loads-dotenv;部署前确保已配置生产环境的值。--env .env - - 重新部署脚本不会执行数据库迁移或数据填充。需单独运行相应的 Prisma 数据库脚本。
env-migrations-separate - - 当前
env-cli-token-name使用@prisma/cli进行服务令牌认证;旧版 Compute CLI 和 SDK 示例可能使用PRISMA_SERVICE_TOKEN。PRISMA_API_TOKEN - - 分支部署、分支环境变量和分支数据库必须使用相同的分支名称;针对预览分支部署时,需显式传入
env-branch-scope参数。--branch <git-name> - - 使用
env-production-vs-preview指定生产环境,--role production指定预览模板环境,--role preview指定分支特定配置。--branch <git-name>
5. Deploy Operations
5. 部署操作
- - Use
deploy-prod-intentonly when the user intends a production deploy.--prod --yes - - Non-interactive deploys need either stored CLI login or a supported service token env var; never print the token.
deploy-noninteractive-auth - - Use
deploy-json-for-agentsfor scripts and agent-readable output.--json --no-interactive
- - 仅当用户明确意图部署到生产环境时,才使用
deploy-prod-intent参数。--prod --yes - - 非交互式部署需要已存储的 CLI 登录信息或受支持的服务令牌环境变量;绝不要打印令牌。
deploy-noninteractive-auth - - 脚本和Agent可读输出请使用
deploy-json-for-agents参数。--json --no-interactive
6. SDK and API
6. SDK 与 API
- - Prefer
sdk-use-cli-firstfor app workflows; use@prisma/cli app deployonly to scaffold a new app unless the user is building lower-level automation.create-prisma - -
sdk-result-handlingreturns@prisma/compute-sdkvalues; checkResult/isOk()instead of relying on exceptions.isErr()
- - 应用工作流优先使用
sdk-use-cli-first;除非用户正在构建底层自动化工具,否则仅使用@prisma/cli app deploy搭建新应用。create-prisma - -
sdk-result-handling返回@prisma/compute-sdk类型的值;请检查Result/isOk()方法,而非依赖异常捕获。isErr()
Preferred Workflow
推荐工作流
- Inspect the project: package manager, template/framework, scripts, Prisma version, Prisma client location, and existing
package.json.compute:deploy - Verify CLI help output for the package actually being used, or run for the standard Compute surface check.
scripts/verify-compute-surface.mjs - Choose the path:
- existing app deploy: generated or
compute:deploy@prisma/cli app build/run/deploy - new app scaffold: , then generated
create-prismaorcompute:deploy@prisma/cli app deploy - low-level automation: or Management API
@prisma/compute-sdk
- existing app deploy: generated
- Check framework readiness plus host/port/env/runtime requirements, including project and branch scope.
- Run a local build or before deploying when feasible.
app build - Deploy with JSON output when automating, then smoke-test the public URL and summarize app URL, app id, deployment id, project id, and follow-up steps.
- 检查项目:包管理器、模板/框架、脚本、Prisma 版本、Prisma Client 位置以及已有的
package.json脚本。compute:deploy - 验证实际使用的包的 CLI 帮助输出,或运行 进行标准 Compute 界面检查。
scripts/verify-compute-surface.mjs - 选择路径:
- 现有应用部署:使用生成的 脚本或
compute:deploy命令@prisma/cli app build/run/deploy - 新应用搭建:使用 ,然后使用生成的
create-prisma脚本或compute:deploy命令@prisma/cli app deploy - 底层自动化:使用 或管理 API
@prisma/compute-sdk
- 现有应用部署:使用生成的
- 检查框架就绪性以及主机/端口/环境/运行时要求,包括项目和分支范围。
- 可行的话,在部署前先运行本地构建或 命令。
app build - 自动化部署时使用 JSON 输出,然后对公开 URL 进行冒烟测试,并总结应用 URL、应用 ID、部署 ID、项目 ID 以及后续步骤。
Avoid
注意事项
- Do not bury Compute deployment guidance in the generic skill.
prisma-cli - Do not run inside an existing app just to deploy it; use the generated
create-prismascript orcompute:deploy.@prisma/cli app deploy - Do not tell users that every template can auto-deploy.
create-prisma - Do not deploy with placeholder values.
DATABASE_URL - Do not assume is the Compute runtime path; Next.js deploys need standalone output.
next start - Do not expose secret values from , CLI output, Management API responses, or logs.
.env
- 不要将 Compute 部署指南隐藏在通用的 技能中。
prisma-cli - 不要在现有应用内运行 来部署应用;请使用生成的
create-prisma脚本或compute:deploy命令。@prisma/cli app deploy - 不要告知用户所有 模板都能自动部署。
create-prisma - 不要使用占位符 值进行部署。
DATABASE_URL - 不要假设 是 Compute 的运行时路径;Next.js 部署需要独立输出产物。
next start - 不要暴露 文件、CLI 输出、管理 API 响应或日志中的机密值。
.env