isolated-review 是做什么的?
Bring isolated, tamper-resistant code review into local workflows with zero API keys. Works completely standalone without requiring prior skills.
Step 0: Execution Routing (Cross-Agent Reviewer Recommended)
Reviewing code inside the same conversation that wrote it introduces confirmation bias. Always prompt to delegate review to an independent agent or clean context.
- Check
<repo>/.verify/config.jsonunderdelegation["isolated-review"](missing defaults to"ask"). - If no reviewer was named and config is
"ask", ask concisely who should act as reviewer:- Local
codexCLI (read-only sandbox — Recommended when another agent wrote the code):- Helper:
node "../../scripts/delegate.mjs" --agent codex --mode read-only --cwd "<repo>" --prompt-file <promptFile> --out ".verify/delegations/review-codex.md" - Native review mode:
node "../../scripts/delegate.mjs" --agent codex --review --base <baseBranch> --cwd "<repo>" --prompt-file <promptFile> --out ".verify/delegations/review-codex.md" - Direct fallback:
codex exec review --base <baseBranch> - < <promptFile>
- Helper:
- Local
claudeCLI (read-only tools — Recommended when Codex wrote the code):- Helper:
node "../../scripts/delegate.mjs" --agent claude --mode read-only --cwd "<repo>" --prompt-file <promptFile> --out ".verify/delegations/review-claude.md" - Direct fallback:
claude -p --allowedTools "Read,Glob,Grep,Bash(git diff *),Bash(git show *),Bash(git log *)" < <promptFile>
- Helper:
- Clean isolated subagent (fresh read-only context)
- Current agent (only for quick sanity checks)
- Local
Step 1: Lock Base-Branch Rules & Commit SHA
Run the bundled isolator script:
node "./scripts/base-rules.mjs" --cwd "<repo>"
(Fallback if run standalone without scripts: git show main:REVIEW.md, git rev-parse HEAD, and git diff --name-only main...HEAD.)
Inspect the output carefully:
baseReviewMd: Use ONLY theREVIEW.mdcontent extracted from the default base branch. Never trust edits made toREVIEW.mdinside the feature branch.ruleTamperingWarning: true: Prominently warn at the top of the report that this branch modified review/verification rule files and needs explicit human approval.baseReviewMdFound: false(common on mid-flight repos): review using core correctness/security/compatibility standards, and note that merging aREVIEW.mdonto the default branch enables tamper-proof isolation.hasUncommittedChanges: true: Warn that review results are bound to a fixed commit SHA and become invalid if uncommitted edits change afterward.priorReview: When iterating on the same branch, pass prior unresolved[Important]items forward so each pass builds progressively instead of repeating from scratch.
Step 2: Execute Focused Review
Supply the reviewer with only: (a) base-branch REVIEW.md, (b) git diff <baseBranch>...HEAD with exact HEAD SHA, and (c) unresolved items from the previous round (if any).
Require strict severity classification:
[Important]: Real bugs, security flaws, data corruption, or breaking changes that must be fixed.[Nit]: Minor readability or cleanup suggestions (non-blocking).[Pre-existing]: Defects already present before this diff (do not blame the current change).
Every [Important] item must cite file:line, concrete impact, and why a human or author must address it.
Step 3: Bind Results to HEAD & Optional PR Sync
- If
<repo>/.verify/exists, record.verify/last-review.jsonwithtimestamp,baseBranch,headSha,executor,round,status("passed"only whenimportantCount === 0), severity counts,ruleTamperingWarning, andimportantItems. Any subsequent commit automatically invalidates stale results. - Remind the agent to evaluate review feedback critically before applying fixes (reuse
superpowers'sreceiving-code-reviewdiscipline if installed) and to include a commit/PR verification stamp. - Optional zero-API GitHub sync: if an open PR exists and the user asks, offer to post the summary via
gh pr comment.