review-local-branch
БесплатноБез исполняемых скриптовНе проверенReview an Nx local branch, including committed and uncommitted changes, using sandboxed reviewer roles. Save a local draft with evidence and verification…
от nrwl★ 29 499 звёзд на GitHubОб этом скилле
Read Codex execution conventions before following this workflow.
Review the local branch (review-local-branch)
The sibling of review-pr, for work that has not become a PR yet. Same agents, same proof-of-work contract, same calibrations — the only real differences are how scope is discovered and that the code is yours.
Drafts only. This skill never commits, never pushes, never edits your working tree.
Trust model — what the sandbox is and is not here
review-pr puts an untrusted PR in a container because the code is a stranger's. Here the code is yours, already on your disk, and there is nothing to isolate it from. Be honest about that rather than implying a boundary that does not exist:
sandbox start --localregisters your checkout with no isolation.sandbox doctorwill say so.- What it still buys is uniformity: the agents speak only the CLI, so the same definitions work in both skills with no transport branch and no fallback path to fall down.
- What it also buys is a guardrail on your branch. A local sandbox is
exec=screened: commands that obviously write —git checkout,rm,pnpm install,>redirects — are rejected, so a review cannot mutate the thing it was asked to review. It is a guardrail, not a security boundary. sandbox worktreestill works. It cuts a peer worktree outside the repo, under~/.nx-sandboxes/worktrees/<id>-<agent>, so an agent proving a test can fail never touches your files or your branch — the only thing it writes into your repo is the.git/worktreesregistration, whichsandbox stopremoves.- That worktree carries your uncommitted work, not just the last commit.
git worktree add … HEADwould check out the committed state, which is not what is under review here; the CLI appliesgit diff HEADon top so the tree matches the diff the agents were given. Untracked files stay out, exactly as they do from the diff. - It is installed on creation, which on this repo is minutes rather than seconds. That cost is why agents are told to reach for one only when static reading genuinely cannot settle the question — not as a matter of course.
If you want an agent to run the repo's own build or test commands, start with --allow-exec and say so in the charter. No screen can contain those anyway — node -e is arbitrary code by construction.
Step 1: Establish scope
ROOT=$(git rev-parse --show-toplevel)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
SLUG=$(printf '%s' "$BRANCH" | sed 's#[/ ]#-#g')
# Refresh the base so "is this net-new?" is answered against the real master,
# not a fork point that is weeks stale.
git fetch -q origin master
BASE=${ARG_BASE:-$(git merge-base origin/master HEAD)}
test -n "$BASE" || { echo "FATAL: no merge base with origin/master"; exit 1; }
--base <rev> overrides. Use it when the branch is stacked on another branch rather than on master — a merge-base against origin/master would then pull the parent branch's work into scope and the review would spend itself on code you did not write.
Refuse to run on the default branch. If $BRANCH is master, there is no branch to review: merge-base origin/master HEAD is HEAD, the diff is empty, and every agent gets an empty scope. Say so and stop.
# Everything you would push: commits + staged + unstaged, in one surface.
git diff "$BASE" > /tmp/branch-$SLUG.diff.tmp \
|| { echo "FATAL: git diff failed"; exit 1; }
test -s /tmp/branch-$SLUG.diff.tmp \
|| { echo "FATAL: empty diff — nothing to review against $BASE"; exit 1; }
mv /tmp/branch-$SLUG.diff.tmp /tmp/branch-$SLUG.diff
git diff --name-only "$BASE" > /tmp/branch-$SLUG.files
# `|| true` is required, not defensive: grep exits 1 when nothing matches, so on a
# clean tree this pipeline fails, and under `set -e` in bash it aborts the block
# before the sandbox is ever started. Verified — zsh does not abort here and bash
# does, so the failure only shows up in some shells.
{ git status --porcelain | grep '^??' | sed 's/^?? //' || true; } > /tmp/branch-$SLUG.untracked
Write-then-verify-then-move, for the same reason review-pr does it: a bare > truncates the target before git runs, so a failure leaves a 0-byte file that every agent is then told is the complete diff.
git diff $BASE is deliberately two-dot-with-working-tree. It compares the base commit against your working tree, which is what "everything I would push" means — commits, staged, and unstaged together. Do not "fix" it to $BASE...HEAD: that drops staged and unstaged work, which on a branch mid-edit is usually the part most worth reviewing.
Untracked files cannot appear in a diff. A new file that was never git added is invisible to git diff at any syntax, and mutating the index to make it visible is not this skill's business. So they are collected separately and reported:
- If
/tmp/branch-$SLUG.untrackedis non-empty, list those paths in the draft un
Установить review-local-branch в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл review-local-branch?
Review an Nx local branch, including committed and uncommitted changes, using sandboxed reviewer roles. Save a local draft with evidence and verification limits; use for branch reviews before opening a PR.
Как установить скилл review-local-branch?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл review-local-branch запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic