migration-review
Checklist for reviewing a database migration PR before merge — destructive ops, hot-table locking, index creation, down-migration correctness, backfills. Use when reviewing, approving, or auditing a migration/schema-change PR.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- migration-review
- description
- Checklist for reviewing a database migration PR before merge — destructive ops, hot-table locking, index creation, down-migration correctness, backfills. Use when reviewing, approving, or auditing a migration/schema-change PR.
02 资源文件 2
- 参考文档grading.json1.0 KB
- 参考文档meta.json218 B
03 SKILL.md 正文
Produce a single verdict: PASS only if every applicable rule below passes; otherwise FAIL. For each rule, cite file:line for every violation found, or mark N/A if the rule doesn't apply to this diff (e.g., no indexes touched). Do not summarize in prose only — the review is the checklist, filled in.
Process
- Read every changed file in the migration diff before judging any single statement — a
DROPin one file can be the second half of anexpand/contractpair started in another. - List every schema-changing statement (
CREATE,ALTER,DROP,RENAME) and every data-touching statement (UPDATE,INSERT ... SELECT, ORM backfill code), each tagged with the table it targets. - Determine which targeted tables are hot — actively written in production, not a table created earlier in the same migration. Use PR description, table name conventions, or ask if genuinely ambiguous; don't assume small/cold by default.
- Apply each rule below to every statement it covers.
- Emit the verdict.
Rules
Destructive ops need expand/contract. Any DROP COLUMN, DROP TABLE, RENAME COLUMN, or RENAME TABLE is a contract step. FAIL unless the PR shows the matching expand step already shipped — application code stopped reading/writing the object in a prior, separate deploy — or the object is demonstrably never-used (no expand step needed). A drop/rename with no expand evidence and no separate follow-up plan is always a FAIL, regardless of how small the table looks.
Hot-table column additions must not rewrite. ADD COLUMN ... DEFAULT on a hot table:
- Volatile default (
now(),random(),nextval(), a subquery) — always forces a full table rewrite under lock, on every Postgres version. FAIL. - Constant default — rewrite-free (metadata-only) on Postgres 11+; still rewrites pre-11. Check the target Postgres version (migration tool config, CI image, explicit comment). FAIL if version is unconfirmed or <11.
- Either failure mode is fixed the same way: add the column nullable with no default, backfill in batches (see backfill rule), then add the default/
NOT NULLin a follow-up step.
Indexes on big tables must be CONCURRENTLY. Any CREATE INDEX (or unique constraint backed by an index) on a big table without CONCURRENTLY takes a lock that blocks writes — FAIL. Also check the inverse failure: CONCURRENTLY cannot run inside a transaction, so if the migration tool wraps migrations in a transaction by default, confirm it's disabled for this file (e.g., disable_ddl_transaction!, atomic = False). CONCURRENTLY present but still transaction-wrapped is a FAIL — it will error, not just lock.
Down-migrations must actually reverse the up. For every up step, the down must undo it against the same object. FAIL if: the down is missing or a no-op stub, the down targets a different object than the up created, or the down claims to reverse an op that destroyed data (a DROP COLUMN can't be undone by re-adding an empty column) without an explicit comment acknowledging the data loss is accepted and irreversible.
Backfills don't live in the schema migration. Any statement that writes existing rows (UPDATE, INSERT ... SELECT, an ORM loop over all records) belongs in a separate, batched, out-of-band job — not the DDL migration. FAIL if such a statement appears in the migration file, or exists as a script but runs unbatched (no chunking/pagination) over a hot table.
04 同仓库更多 Skills
review-adversarial-first
Operator-invoked adversarial review: 3 refute-by-default lenses plus a deterministic judge against a PR, branch, or path, then a decision on whether /ce-code-review's topic fan-out runs. Off the default merge path since the 2026-10-17 merge-and-end ruling; run only when asked for by name.
memory-mine
Run one deterministic, budgeted directed-capture batch for an explicit Claude Code project store. Use manual workspace mode only when cross-agent cass sessions are intentionally in scope.
papers
Search preprints from arXiv, bioRxiv, and medRxiv without API keys. Supports search, lookup, extraction, citations, enrichment, and paper downloads that bundle PDFs plus linked GitHub code.
papers
Search preprints from arXiv, bioRxiv, and medRxiv without API keys. Supports search, lookup, extraction, citations, enrichment, and paper downloads that bundle PDFs plus linked GitHub code.
wsl-cdp
Drive the user's real, logged-in Windows browser (Chrome, Edge, or Brave) from a Claude Code session running inside WSL2, over the Chrome DevTools Protocol - read authenticated dashboards and consoles, take real screenshots, open and read pages with the user's sessions. Use when a task needs the user's existing web logins and the session runs in WSL2, where the Claude in Chrome extension cannot work. Not for native-Windows or macOS Claude Code (use the official Claude in Chrome extension), not for anonymous scraping or CI (use headless Playwright inside WSL), not for getting past login walls (those are handed to the human).
token-eater
[BETA] Spend a subscription's idle, about-to-expire credits on safe, machine-verified cleanup. You pick the service (Grok / Codex / Claude) and a token-heavy maintenance skill (de-monolithize, de-slop, simplify, dead-code); that service runs the whole skill -> gate -> self-review -> draft-PR loop on its own credits, in an isolated worktree. token-eater verifies the gate and never merges. Manual invocation only during beta.