prisma-next-contract
БесплатноБез исполняемых скриптовНе проверенEdit the Prisma Next data contract — add models, fields, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres…
от prisma★ 407 звёзд на GitHubОб этом скилле
Prisma Next — Contract Authoring
Edit your data contract. Prisma handles the rest.
The data contract is the single source of truth for your data layer. You edit a contract source — contract.prisma (PSL, the canonical surface) or contract.ts (TypeScript builder) — and the framework derives types, migrations, and runtime configuration from it. The three-step user model:
- You edit your data contract.
- The system plans the migrations for you. (
prisma-next-migrations) - If you need data migrations, you edit
migration.tsand execute it. (prisma-next-migrations)
Behind step 1 the agent runs prisma-next contract emit after every contract edit (or installs the Vite plugin so the bundler runs it on save — see prisma-next-build). Emit reads the contract source through the provider the façade picks based on the file extension of contract: in prisma-next.config.ts, then writes two artefacts colocated with the source:
contract.json— the canonical, content-hashed Contract IR. Read by the planner, the runtime, anddb verify.contract.d.ts— the precise TypeScript types the runtime + lanes propagate when you importContractfrom it.
Both files are emitted artefacts. Edit the source; never the JSON or .d.ts.
When to Use
- User wants to add, change, or remove a model / field / relation.
- User wants to add an index, unique constraint, enum, or value object (composite type).
- User wants to add a namespace block (Postgres schema) or a cross-contract foreign key.
- User wants to set
@@controlon a model or configuredefaultControlPolicy. - User wants to use a custom type from an extension (
pgvector.Vector(length: 1536),cipherstash.EncryptedString({...})). - User wants to install or configure an extension via
extensions: [...]inprisma-next.config.ts, including@prisma-next/extension-supabase. - User is migrating between authoring sources (PSL ↔ TypeScript builder).
- User received
PN-CLI-4002,PN-CLI-4003, orPN-CLI-4011fromcontract emit. - User mentions: schema, fields, models, attributes, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, contract emit, façade imports,
@prisma-next/postgres/config,@prisma-next/postgres/contract-builder, extensions, pgvector, cipherstash, postgis, paradedb, supabase, namespaces, cross-space FK,@@control, enums, value objects, validations, callbacks, soft delete, paranoid, scopes. (The last cluster routes to What Prisma Next doesn't do yet below.)
When Not to Use
- User wants to apply a contract change to the DB →
prisma-next-migrations. - User wants to write a query against the contract →
prisma-next-queries. - User wants to wire
db.ts(runtime entry point, middleware, env config) →prisma-next-runtime. - User wants the Vite / bundler integration →
prisma-next-build. - User wants to set up Prisma Next for the first time →
prisma-next-quickstart. - User wants a deeper read of a single structured error envelope →
prisma-next-debug. - User wants to file a missing-feature request →
prisma-next-feedback.
Key Concepts
- The
@prisma-next/<target>façade is the only surface user-authored code imports from. For a Postgres app:@prisma-next/postgres/config,@prisma-next/postgres/contract-builder,@prisma-next/postgres/control,@prisma-next/postgres/runtime. Mongo has the same layout (@prisma-next/mongo/config,@prisma-next/mongo/contract-builder,@prisma-next/mongo/runtime). Each extension publishes its own façade —@prisma-next/extension-pgvector/control,@prisma-next/extension-postgis/control,@prisma-next/extension-paradedb/control. Never reach into@prisma-next/cli/*,@prisma-next/family-*,@prisma-next/target-*,@prisma-next/adapter-*,@prisma-next/driver-*, or@prisma-next/sql-contract-*from user code. The façade bakes the family / target / adapter / driver wiring in. See Common Pitfalls #4. - Contract source. A file the framework reads and lowers to the canonical Contract IR. Two flavours, both first-class:
contract.prisma(PSL) — schema-flavoured DSL. Canonical for typical apps and brownfield Prisma users. Wired bycontract: './<path>/contract.prisma'— thedefineConfigfaçade detects the.prismaextension and routes through the PSL provider.contract.ts(TypeScript builder) — programmatic authoring withdefineContract({...}, ({ field, model, rel, type }) => ({...}))from@prisma-next/postgres/contract-builder(or@prisma-next/mongo/contract-builder). Wired bycontract: './<path>/contract.ts'— the façade detects the.tsextension and routes through the TS provider. Use when you need programmatic composition (per-tenant variants, generated fields) or constructs PSL doesn't yet express (e.g. registering a parameterised extension type — see pgvector's contract).
prisma-next.config.ts. Wires the contract source, the database connection, the mig
Установить prisma-next-contract в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл prisma-next-contract?
Edit the Prisma Next data contract — add models, fields, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (`@@discriminator` / `@@base`), use extension namespaces (`pgvector.Vector(...)`, `cipherstash.EncryptedString(...)`), wire `prisma-next.config.ts` with `defineConfig` from the `@prisma-next/<target>/config` façade, and run `prisma-next contract emit`. Use for schema, models, fields, attributes, soft delete, paranoid, scopes, validations, callbacks, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, `@prisma-next/postgres/config`, `@prisma-next/postgres/contract-builder`, `@prisma-next/postgres/control`, `@prisma-next/mongo/config`, `@prisma-next/mongo/contract-builder`, `extensions:`, pgvector, cipherstash, postgis, paradedb, supabase, `@prisma-next/extension-supabase`, `@@control`, control policy, managed, tolerated, external, observed.
Как установить скилл prisma-next-contract?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл prisma-next-contract запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic