본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)48k · #6313

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/prisma/orm/blob/main/skills/prisma-8/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.

  1. The project is on Prisma 8. prisma.config.ts exports definePrismaConfig({ orm: ... }), and package.json depends on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. A project with schema.prisma and @prisma/client is Prisma 7 or earlier; this skill does not apply to it, and its instructions will break such a project.
  2. The skill matches the installed version. Compare metadata.library_version in this file's frontmatter with the installed @prisma/orm-* version in package.json. If they differ, run prisma skills sync and re-read this file before continuing.
  3. The contract artefacts exist. contract.json and contract.d.ts sit next to the contract source named by prisma.config.ts. If they are missing or older than the source, run prisma contract emit first; 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:

  1. Edit your data contract. (references/contract.md)
  2. The system plans the migrations for you. (references/migrations.md)
  3. If you need data migrations, you edit migration.ts and 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬