prisma-8
できること
このスキルは、データ契約を中心に作られたデータベースツールキットPrisma 8について、最新のガイダンスをエージェントに与えます。最新の版を正しく使ってほしいPrisma 8でアプリを作る開発者向けです。
使う場面
- ✓データ契約ファイルを編集したり、契約の成果物を生成するコマンドを実行したりするとき。
- ✓Prisma 8プロジェクトで、データベースのマイグレーションを計画または適用する必要があるとき。
- ✓Prisma 8プロジェクトでデータベースのクエリを書いたり、接続を設定したりするとき。
スキルのリンク
https://github.com/prisma/orm/blob/main/skills/prisma-8/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このPrisma 8プロジェクトの契約に新しいフィールドを追加し、そのマイグレーションを計画してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、まずプロジェクトが本当にPrisma 8を使っているかを確認し、インストールされた版に同梱されたリファレンスファイルを使います。それらのファイルは、エージェントがPrismaについて覚えていることより優先されます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Prisma 8 (Prisma 8)
Edit your data contract. Prisma handles the rest.
Prisma 8 moves fast, and your training data about it is very likely outdated. This skill ships inside the installed Prisma packages, so it describes the exact version this project has — treat it and its reference files as the source of truth, over anything you remember about Prisma.
Pre-conditions
Check these before acting on anything below. Halt on the first one that fails and tell the user what is missing.
- The project is on Prisma 8.
prisma.config.tsexportsdefinePrismaConfig({ orm: ... }), andpackage.jsondepends on@prisma/orm-postgres,@prisma/orm-sqlite, or@prisma/orm-mongo. A project withschema.prismaand@prisma/clientis Prisma 7 or earlier; this skill does not apply to it, and its instructions will break such a project. - The skill matches the installed version. Compare
metadata.library_versionin this file's frontmatter with the installed@prisma/orm-*version inpackage.json. If they differ, runprisma skills syncand re-read this file before continuing. - The contract artefacts exist.
contract.jsonandcontract.d.tssit next to the contract source named byprisma.config.ts. If they are missing or older than the source, runprisma contract emitfirst; every query and migration instruction below assumes current artefacts.
Import paths in the references. The reference files spell façade imports as @internal/<target>/<subpath> and @internal/extension-<name>/<subpath>. In an application those packages are published as @prisma/orm-<target>/<subpath> (@prisma/orm-postgres/runtime, @prisma/orm-mongo/config, @prisma/orm-sqlite/runtime) and @prisma/orm-extension-<name>/<subpath> (@prisma/orm-extension-pgvector/control). Write the @prisma/orm-* name in user code; the two spellings are the same package. Paths already written as @prisma/orm-* in the references are exact. The metadata.library_version in this file's frontmatter is the version it was published with; if it does not match the project's installed Prisma packages, run prisma skills sync and re-read.
Never reset or drop a database
Never reset or drop a database to fix a migration, marker or contract problem, and never propose it. A database can always be moved to the contract you want. When its migration history does not need to be kept (a local, development, staging or preview database), reconcile it with prisma db update. When it changes only through migrations, as production should, author the migrations that bring it there. A deploy that says there is no migration path, or MIGRATION.MARKER_MISMATCH, is covered in references/migrations.md § A database whose marker is not in the migration graph.
Prisma 8 is a contract-first data layer. This skill routes every Prisma 8 task to the right reference file — open the reference before writing code; do not answer from this file alone.
The canonical model (one paragraph)
You author a data contract (a contract.prisma file, or a TypeScript builder). The framework emits machine-readable artifacts (contract.json, contract.d.ts) and gives you two runtime surfaces on SQL targets: a typed SQL query builder (db.sql.<ns>.<table>) and a typed ORM client (db.orm.<ns>.<Model>). On MongoDB targets only the ORM lane exists, and its keys are collection storage names (db.orm.users) rather than PSL model names — references/queries.md § MongoDB ORM addressing covers the rule. 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:
- Edit your data contract. (
references/contract.md) - The system plans the migrations for you. (
references/migrations.md) - If you need data migrations, you edit
migration.tsand execute it. (references/migrations.md)
Everything else — queries, runtime wiring, build integration, debugging, feedback — sits on top of those three.
One cross-cutting migration fact: migration plan does not chain from the newest migration on disk. Its origin is --from, else the db ref, else an empty database — so a project with no ref keeps planning from scratch. Over existing migrations the CLI refuses that (MIGRATION.PLAN_ORIGIN_UNKNOWN) instead of writ
よくある質問
古いPrismaのプロジェクトでも使えますか?
いいえ。スキルはPrisma 8のプロジェクトにのみ適用され、その指示はPrisma 7以前のプロジェクトを壊します。
スキルの版とインストールの版が合わない場合は?
スキルは、prisma skills syncを実行し、続ける前にファイルを読み直すよう指示しています。
開始の前に何が必要ですか?
contract.jsonやcontract.d.tsなどの契約の成果物が存在し、最新である必要があります。ない場合は、まずprisma contract emitを実行します。
詳細
作者による元の説明
Use when working in a project that depends on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo (Prisma 8, formerly Prisma Next): editing contract.prisma or a contract.ts builder, running `prisma contract emit`, planning or applying migrations, editing migration.ts, writing db.orm / db.sql / db.query queries, wiring db.ts or middleware, integrating a build tool, using the Supabase extension or RLS, or reading a dotted error code such as MIGRATION.HASH_MISMATCH. Use when the user asks "what is Prisma 8", "where do I start", or compares it to another ORM. Use when the user asks to u
repo: prisma/orm
人気
- GitHubのスター
- 48k
- ランキング
- #6313
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
adr-review
48kエージェントが、アーキテクチャ決定記録を新鮮な目で見直し、新しい読み手にも決定が明確になるように書き直せるよう教えます。
ast-visitor-pattern
48k複数の場所で扱われるユニオン型のためのコードパターンを、エージェントに教えます。新しい型のケースを、コンパイラが検出できるようにします。
markdown-no-artificial-line-wraps
48kエージェントが、段落を1行ずつにまとめてMarkdownを書けるよう支援します。画面で文字が自然に折り返され、ファイルの変更が見やすくなります。
multiline-commit-messages
48kエージェントが、シェルで複数行のgitコミットメッセージを安全に書く方法を示します。メッセージが壊れて出てこないようにします。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。