Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

prisma-next-migration-review

БесплатноБез исполняемых скриптовНе проверен

Review what Prisma Next migrations will run on merge or deploy, render the migration graph, resolve concurrent / diamond-convergence conflicts, and configure…

prismaот prisma★ 407 звёзд на GitHub

Об этом скилле

Prisma Next — Migration Review (Deployment + Concurrency)

Edit your data contract. Prisma handles the rest.

This skill is about reviewing migrations, not authoring them. It covers the questions that come up at deploy time and when multiple developers are landing migrations concurrently.

The skill teaches the system's mental model — what a ref is, what a marker is, what the migration graph is — and shows how to ask the system for its state. It does not prescribe rigid step-by-step procedures: most "review" questions are answered by understanding the model and querying the right thing. Rigid procedures are reserved for the rare case where there's literally one safe path.

When to Use

  • User asks "what migrations will run when I merge this?" or "what's about to run on deploy?".
  • User hit a concurrent-migration conflict (main advanced while their branch was open).
  • User wants to wire up a staging / production ref so CI can deploy against it.
  • User wants to run a migration against an environment that isn't the local dev DB.
  • User asks about CI integration for migrations.

When Not to Use

  • User wants to author a migration → prisma-next-migrations.
  • User wants to fix a hash-mismatch / drift in a single env → prisma-next-migrations (re-plan path) or prisma-next-debug (envelope-driven).
  • User wants to edit the contract → prisma-next-contract.

Key Concepts — the navigation model

Every migration question is a navigation from an origin to a destination. Once you have this model, the rest of the skill is just "which command asks the system about which navigation."

Origin

The origin is the database's current contract hash. The database carries a row in PN's marker table that records "this database is at hash X". When the CLI runs online (a --db <url> is provided, or db.connection is set in prisma-next.config.ts), PN reads the marker and that hash is the origin. Offline (no DB connection), the origin is unknown — many commands degrade to listing the on-disk migrations and skip the per-edge applied/pending status.

A live DB is therefore the authoritative source of origin. The "recorded marker" in any other artifact (refs, local cache, your assumptions) is a working copy that can drift; the live DB never does.

Destination

The destination is the contract hash you want the database to be at. Two ways to name a destination:

  • A --to <name> — a named pointer to a hash, stored under migrations/app/refs/<name>. Refs are named after environments by convention (staging, production) to communicate "this is where production is expected to be". The ref itself is just a hash + an optional set of required invariants; it has nothing to do with which database you connect to.
  • The current contract head — implicit when no --to is passed. This is the hash of the current contract.json on disk.

--to staging does not mean "connect to the staging database." It means "navigate the database I connected to (via --db or config) toward whatever hash this ref points at." Database selection is orthogonal: pass --db $STAGING_DATABASE_URL to actually point at staging.

The migration graph

The on-disk migrations form a directed graph: nodes are contract hashes; edges are migrations. Each migration declares a from hash and a to hash. A migration applies only when the database's current marker matches its from hash; running it advances the marker to its to hash.

migration status queries the graph for the path from origin to destination and reports per-edge status:

  • applied — on the path from EMPTY_CONTRACT_HASH to the marker (history).
  • pending — on the path from the marker to the destination (what would run).
  • unreachable — on the path from EMPTY_CONTRACT_HASH to the destination, but the marker is on a different branch and won't reach it without first re-routing.

Diagnostic codes

migration status emits structured diagnostics on the result envelope (diagnostics[].code) so the agent can branch on the code rather than parsing the prose summary. Each diagnostic also carries severity (warn or info), a human message, and hints — the same hints the CLI prints under the summary line.

Code Severity Meaning in the navigation model Next move
MIGRATION.UP_TO_DATE info Marker = destination; no edges to walk. Nothing to do.
MIGRATION.DATABASE_BEHIND info Marker is an ancestor of the destination; N pending edges in between. migrate --to <name> --db $URL.
MIGRATION.MISSING_INVARIANTS info Marker reached destination structurally but missing required invariants the ref declares. migrate --to <name> --db $URL to take a path that covers them.
MIGRATION.NO_MARKER warn Online, but the database has no marker row — never initialised. migrate --db $URL (first apply writes the marker).
`MIGRATION.MARKER_NOT_I
Полный SKILL.md на GitHub

Установить prisma-next-migration-review в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл prisma-next-migration-review?

Review what Prisma Next migrations will run on merge or deploy, render the migration graph, resolve concurrent / diamond-convergence conflicts, and configure environment refs for CI. Use for "what migrations are going to run", "what runs on deploy", merge conflict, diamond convergence, concurrent migrations, migration status, ref management, staging, production, MIGRATION.DIVERGED, MIGRATION.NO_MARKER, MIGRATION.MARKER_NOT_IN_HISTORY, prisma migrate status, prisma migrate diff, prisma migrate resolve.

Как установить скилл prisma-next-migration-review?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл prisma-next-migration-review запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить prisma-next-migration-review с