prisma-next

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Prisma Next — Router

Prisma Next — 路由技能

Edit your data contract. Prisma handles the rest.
This skill exists to disambiguate vague Prisma Next prompts. When the user hasn't yet committed to a specific workflow (e.g. "help me with Prisma Next", "explain how Prisma Next works", "I'm new to PN, where do I start?"), this skill fires and routes them to the right specific skill.
编辑你的数据契约,其余工作交给Prisma处理。
本技能用于区分模糊的Prisma Next请求。当用户尚未明确具体工作流时(例如:"help me with Prisma Next""explain how Prisma Next works""I'm new to PN, where do I start?"),本技能会触发并将用户引导至对应的特定技能。

When to Use

使用场景

  • The user has not yet stated a concrete task.
  • The user types a meta-question about Prisma Next ("what is Prisma Next?", "how does PN compare to Drizzle/Prisma 7?").
  • The user asks for a tour, an overview, or a starting point.
  • 用户尚未说明具体任务。
  • 用户提出关于Prisma Next的元问题(例如:"what is Prisma Next?""how does PN compare to Drizzle/Prisma 7?")。
  • 用户请求教程、概览或入门指引。

When Not to Use

禁用场景

  • The user named a workflow — use the matching skill directly:
    • Setting up a new project or adopting an existing DB →
      prisma-next-quickstart
      .
    • Editing the schema, adding a model, changing a field →
      prisma-next-contract
      .
    • Authoring a migration, fixing a planner error →
      prisma-next-migrations
      .
    • Reviewing what's about to run on merge, handling concurrent migrations →
      prisma-next-migration-review
      .
    • Writing a query →
      prisma-next-queries
      .
    • Wiring
      db.ts
      , middleware, environment config →
      prisma-next-runtime
      .
    • Build-system / dev-server plugin (Vite, Next.js, …) →
      prisma-next-build
      .
    • A specific error code or symptom →
      prisma-next-debug
      .
    • Reporting a bug or filing a feature request against Prisma Next →
      prisma-next-feedback
      .
  • 用户明确提及某一工作流——请直接调用匹配的技能:
    • 搭建新项目或接入现有数据库 →
      prisma-next-quickstart
    • 编辑schema、添加模型、修改字段 →
      prisma-next-contract
    • 编写迁移、修复规划器错误 →
      prisma-next-migrations
    • 审核合并后即将执行的内容、处理并发迁移 →
      prisma-next-migration-review
    • 编写查询 →
      prisma-next-queries
    • 配置
      db.ts
      、中间件、环境变量 →
      prisma-next-runtime
    • 构建系统/开发服务器插件(Vite、Next.js等) →
      prisma-next-build
    • 特定错误码或症状 →
      prisma-next-debug
    • 向Prisma Next团队提交bug报告或功能请求 →
      prisma-next-feedback

Routing rules

路由规则

If the user's prompt clearly matches one of the workflow skills, route there directly without asking.
Otherwise, ask one disambiguating question. Pick from:
  • "Are you new to Prisma Next and asking what you can do with it, or where to start?" (and any "what can I do with Prisma Next?" / "I just ran createprisma" variant) →
    prisma-next-quickstart
    (first-touch orientation path).
  • "Do you want to set up a new Prisma Next project, or wire it into an existing database?"
    prisma-next-quickstart
    .
  • "Do you want to edit your data contract (add a model / field / relation), or work with the database (migrations, queries)?"
    prisma-next-contract
    vs the others.
  • "Is this about authoring a migration, or about reviewing what's going to run on deploy?"
    prisma-next-migrations
    vs
    prisma-next-migration-review
    .
  • "Is this about wiring Prisma Next into your build tool (Vite / Next.js / …), or about wiring
    db.ts
    and middleware at runtime?"
    prisma-next-build
    vs
    prisma-next-runtime
    .
  • "What error or symptom are you seeing?"
    prisma-next-debug
    .
  • "Do you want to report this as a bug to the Prisma Next team, or is this a feature request?"
    prisma-next-feedback
    .
If you still can't tell which skill applies, ask the user what they want to do. Do not guess.
如果用户的请求明确匹配某一工作流技能,请直接路由至该技能,无需询问。
否则,提出一个明确的问题以区分场景。可从以下问题中选择:
  • "你是刚接触Prisma Next,想了解它能做什么或入门指引吗?"(以及任何类似*"what can I do with Prisma Next?"* / *"I just ran createprisma"*的变体) →
    prisma-next-quickstart
    (初次使用指引路径)。
  • "你想要搭建一个新的Prisma Next项目,还是将其接入现有数据库?"
    prisma-next-quickstart
  • "你想要编辑数据契约(添加模型/字段/关联),还是操作数据库(迁移、查询)?"
    prisma-next-contract
    或其他对应技能。
  • "这是关于编写迁移,还是关于审核部署时即将执行的内容?"
    prisma-next-migrations
    vs
    prisma-next-migration-review
  • "这是关于将Prisma Next接入构建工具(Vite/Next.js等),还是关于在运行时配置
    db.ts
    和中间件?"
    prisma-next-build
    vs
    prisma-next-runtime
  • "你遇到了什么错误或症状?"
    prisma-next-debug
  • "你想要将此作为bug报告给Prisma Next团队,还是提交功能请求?"
    prisma-next-feedback
如果仍无法确定适用的技能,请询问用户具体需求,切勿猜测。

The canonical model (one paragraph)

标准模型(一段概述)

Prisma Next is a contract-first data layer. You author a data contract (a
schema.psl
file, or a TypeScript builder). The framework emits machine-readable artifacts (
contract.json
,
contract.d.ts
) and gives you three runtime surfaces: a typed SQL query builder (
db.sql.from(...)
), a typed ORM client (
db.orm.User.select(...)
), and a raw SQL escape hatch (
db.sql.raw(...)
). Migrations are planned from the contract diff; you review them, optionally edit the
migration.ts
for data transforms, and apply.
Three steps the user does:
  1. Edit your data contract. (
    prisma-next-contract
    )
  2. The system plans the migrations for you. (
    prisma-next-migrations
    )
  3. If you need data migrations, you edit
    migration.ts
    and execute it.
    (
    prisma-next-migrations
    )
Everything else — queries, runtime wiring, build integration, debugging, feedback — sits on top of those three.
Prisma Next是一个契约优先的数据层。你编写数据契约(一个
schema.psl
文件,或TypeScript构建器)。框架会生成机器可读的产物(
contract.json
contract.d.ts
),并提供三个运行时接口:类型化SQL查询构建器(
db.sql.from(...)
)、类型化ORM客户端(
db.orm.User.select(...)
),以及原生SQL入口(
db.sql.raw(...)
)。迁移会根据契约差异进行规划;你可以审核迁移内容,可选编辑
migration.ts
进行数据转换,然后执行迁移。
用户需要完成的三个步骤:
  1. 编辑你的数据契约。
    prisma-next-contract
  2. 系统为你规划迁移。
    prisma-next-migrations
  3. 如果需要数据迁移,编辑
    migration.ts
    并执行。
    prisma-next-migrations
其他所有功能——查询、运行时配置、构建集成、调试、反馈——都建立在这三个步骤之上。

Checklist

检查清单

  • If the prompt matches a specific workflow skill, route there without asking.
  • If the prompt is vague, ask one disambiguating question.
  • Do not attempt to answer the user's question from this skill — load the right specific skill first.
  • If the user describes a missing feature or a misbehaviour they want fixed, route to
    prisma-next-feedback
    .
  • 如果请求匹配特定工作流技能,直接路由至该技能,无需询问。
  • 如果请求模糊,提出一个明确的区分问题。
  • 请勿尝试通过本技能回答用户的问题——先加载对应的特定技能。
  • 如果用户描述了缺失的功能或需要修复的异常,路由至
    prisma-next-feedback