Command Palette

Search for a command to run...

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

pre-review

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

AI review of the current branch's change (commits, staged, unstaged and untracked files) before a PR exists. Presents findings with a recommendation for each…

babylonlabs-ioот babylonlabs-io★ 15 звёзд на GitHub

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

Arguments: $ARGUMENTS

  • --full → force the full reviewer set over the whole change, even when the change qualifies for the light tier or nothing changed since the last run.
  • --final - verify pending fixes, then run the independent final review. Reuse a completed final review only while its inputs still match. A first invocation still performs the initial review. --full --final forces both the full review and a new final review.
  • --pr <n> → the branch's PR number, for Phase 5's check of the posted title and body.
  • --ci "<summary>" → CI results the engineer has read, passed to reviewers attributed to them.
  • Anything else is a scope hint for the reviewers.

Parse the flags off before computing the scope hint, and never pass a flag or its value through as one. Everything the orchestrator reads out of $ARGUMENTS for its own use needs a flag, or it is indistinguishable from the hint: a bare 2615 typed for Phase 5 is useless to reviewers as a hint and unrecoverable to the orchestrator as a value, so it fails twice. This is not the Phase 1 anti-steering rule, which binds the orchestrator's own additions and explicitly lets the engineer's hint through unchanged. The hint is what remains after the flags are removed, and only that passes through.

/pre-review is one command run in a loop by the engineer who wrote the change, usually in the same session that implemented it:

  1. Review. Independent reviewers look at the change. Findings are shown in chat, each with a recommendation: fix now, follow-up PR, or decline.
  2. Decide. The engineer confirms or changes each decision.
  3. Fix. On request, this session implements the fix-now items.
  4. Run again. Only what changed since the last run is re-checked. Chat reports what is fixed, what remains, and anything new.
  5. Finalize. Run /pre-review --final when the fixes are complete. One independent reviewer reads the whole change without the previous findings.
  6. Hand off. Every run updates PR.md. A completed final review makes it ready for CI and human review. It does not approve a merge.

Nothing is posted, committed or staged. Source files change only in step 3, when the engineer says so.

Files. All git-ignored, all at the repo root, never edited by hand except PR.md:

  • .pre-review/<key>.json: the state (reviewed file contents as git blob ids, findings with status and decision). <key> is the branch name with / replaced by __.
  • .pre-review/<key>.context.txt: stable review inputs for the final check.
  • .pre-review/<key>.md: this branch's PR description, the source of truth.
  • PR.md: a working copy of the current branch's description, for opening the PR. Every branch shares it, so it is reconciled before use (step 6).

Keep them out of .claude/: Claude Code treats that directory as protected and prompts on every write there. Formats (state schema, description layout, snapshot line) are in formats.md.

Work directory ("WORK" below): the session scratchpad when Claude Code lists one in the system prompt, otherwise .pre-review/work/. Name every file there after this run's number, run<N>__…, where N is the number of stored runs plus one: the scratchpad is shared by every run in a session, and a file left by an earlier run must never pass for this run's output.

Commands. Run everything from the repo root. One plain command per Bash call: no shell variables, loops, heredocs, &&, ; or pipes. Such a command matches no permission rule and prompts the engineer every time. Paths are repo-relative in git and nx arguments and in everything recorded (nx rejects absolute --files paths, and the snapshot digest is defined over relative ones); only Read/Write tool paths and redirect targets are absolute. A redirect (> file) is checked as a file edit, not by the Bash rule, so redirect only into the scratchpad. Without a scratchpad, take the command's output and write it with the Write tool, which also creates the directory.

Questions. Ask the engineer only with AskUserQuestion, never in plain chat mid-run: a typed reply ends the turn that holds this skill's pre-approved commands, and every command after it prompts.

Phase 0: prep once, before spawning anything

Everything here is a fact every reviewer would otherwise rediscover separately, at full price each. Do it yourself.

  1. git fetch --quiet origin main, for a base you can trust. If it fails, proceed against the local origin/main and say so. Never git diff main...HEAD: the local main ref is routinely months stale.
  2. git merge-base HEAD origin/main → the base SHA, and git branch --show-current → the branch. An empty branch name means a detached HEAD: stop and ask the engineer to check out a branch.
  3. The changed-file list, the authoritative review set:
    • git diff --name-status --no-renames <base>: branch commits, staged and unstaged, with a re
Полный SKILL.md на GitHub

Установить pre-review в Claude Code и Claude Desktop

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

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

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

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

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

Bash(git fetch *)
Bash(git merge-base *)
Bash(git diff *)
Bash(git show *)
Bash(git ls-files *)
Bash(git cat-file -e *)
Bash(git hash-object -w *)
Bash(git branch --show-current)
Bash(git status *)
Bash(node scripts/pre-review/snapshot.mjs record *)
Bash(node scripts/pre-review/snapshot.mjs final *)
Bash(pnpm nx affected *)
Bash(pnpm --filter @babylonlabs-io/ts-sdk run test)

Вложенные файлы

formats.md

FAQ

Что делает скилл pre-review?

AI review of the current branch's change (commits, staged, unstaged and untracked files) before a PR exists. Presents findings with a recommendation for each, records the author's decisions, re-checks only the diff on later runs, and keeps PR.md up to date.

Как установить скилл pre-review?

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

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

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

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

Сравнить pre-review с