/install gstack-review
AskUserQuestion Format
When asking the user a question, format as a structured text block for the message tool:
- Re-ground: State the project, current branch, and the current plan/task. (1-2 sentences)
- Simplify: Plain English a smart 16-year-old could follow. Concrete examples. Say what it DOES.
- Recommend:
RECOMMENDATION: Choose [X] because [one-line reason]. IncludeCompleteness: X/10. - Options:
A) ... B) ... C) ...
Completeness Principle — Boil the Lake
AI-assisted coding makes marginal cost of completeness near-zero:
- If Option A is complete and Option B saves modest effort — always recommend A.
- Prefer complete option even if only ~70 lines more (costs seconds with AI coding).
Completion Status Protocol
- DONE — All steps completed.
- DONE_WITH_CONCERNS — Completed with issues to note.
- BLOCKED — Cannot proceed.
- NEEDS_CONTEXT — Missing info.
Step 0: Detect base branch
gh pr view --json baseRefName -q .baseRefName- If no PR:
gh repo view --json defaultBranchRef -q .defaultBranchRef.name - Fall back to
main.
Pre-Landing PR Review
Analyze the current branch's diff against the base branch for structural issues that tests don't catch.
Step 1: Check branch
git branch --show-current— if on base branch, output "Nothing to review — you're on the base branch" and stop.git fetch origin \x3Cbase> --quiet && git diff origin/\x3Cbase> --stat— if no diff, stop.
Step 1.5: Scope Drift Detection
- Read TODOS.md (if exists). Read PR description:
gh pr view --json body --jq .body 2>/dev/null || true. Read commit messages:git log origin/\x3Cbase>..HEAD --oneline. - Identify stated intent — what was this branch supposed to accomplish?
- Run
git diff origin/\x3Cbase> --statand compare files changed against stated intent.
Evaluate:
- SCOPE CREEP: Files unrelated to intent, new features not in plan, "while I was in there" changes.
- MISSING REQUIREMENTS: Requirements from TODOS/PR not addressed, partial implementations.
Output before main review:
Scope Check: [CLEAN / DRIFT DETECTED / REQUIREMENTS MISSING]
Intent: \x3C1-line summary of what was requested>
Delivered: \x3C1-line summary of what diff actually does>
[If drift: list each out-of-scope change]
[If missing: list each unaddressed requirement]
Step 2: Read the checklist
Read .claude/skills/review/checklist.md. If cannot be read, STOP and report error.
Step 3: Get the diff
git fetch origin \x3Cbase> --quiet
git diff origin/\x3Cbase>
Step 4: Two-pass review
Apply checklist in two passes:
- Pass 1 (CRITICAL): SQL & Data Safety, Race Conditions & Concurrency, LLM Output Trust Boundary, Enum & Value Completeness
- Pass 2 (INFORMATIONAL): Conditional Side Effects, Magic Numbers & String Coupling, Dead Code & Consistency, LLM Prompt Issues, Test Gaps, View/Frontend
Enum & Value Completeness requires reading code OUTSIDE the diff. When the diff introduces a new enum value, grep all files referencing sibling values, then check if new value is handled.
Step 4.5: Design Review (conditional)
Check if diff touches frontend files using native shell:
SCOPE_FRONTEND=false
git fetch origin "\x3Cbase>" --quiet 2>/dev/null
for ext in ts tsx js jsx vue svelte css scss less sass styl pcss postcss png jpg jpeg gif svg webp ico woff woff2 ttf eot; do
if git diff origin/"\x3Cbase>" --name-only 2>/dev/null | grep -qiE "\.${ext}$"; then
SCOPE_FRONTEND=true
break
fi
done
If SCOPE_FRONTEND=false: Skip silently.
If SCOPE_FRONTEND=true:
- Read
DESIGN.mdordesign-system.mdif exists. - Read
.claude/skills/review/design-checklist.md. If not found, skip with note. - Read each changed frontend file (full file, not just diff hunks).
- Apply design checklist. Classify: [HIGH] mechanical CSS fix → AUTO-FIX, [HIGH/MEDIUM] design judgment → ASK, [LOW] intent-based → "Possible — verify visually."
- Include findings in review output under "Design Review" header.
- Log result for Review Readiness Dashboard.
Step 5: Fix-First Review
Output: Pre-Landing Review: N issues (X critical, Y informational)
5a: Classify each finding
AUTO-FIX or ASK per Fix-First Heuristic in checklist.md.
5b: Auto-fix all AUTO-FIX items
Apply each fix directly. Output one-line summary per fix:
[AUTO-FIXED] [file:line] Problem → what you did
5c: Batch-ask about ASK items
If ASK items remain, present in ONE question:
- List each with number, severity label, problem, recommended fix
- Options: A) Fix as recommended B) Skip
- Include overall RECOMMENDATION
If 3 or fewer ASK items, individual questions allowed.
5d: Apply user-approved fixes
Output what was fixed. If no ASK items, skip question entirely.
Verification of claims
- If claiming "this pattern is safe" → cite specific line proving safety
- If claiming "handled elsewhere" → read and cite handling code
- If claiming "tests cover this" → name test file and method
- Never say "likely handled" or "probably tested" — verify or flag as unknown.
Step 5.5: TODOS cross-reference
Read TODOS.md. Cross-reference PR against open TODOs:
- Does this PR close any open TODOs? Note which.
- Does this PR create work that should become a TODO? Flag as informational.
- Are there related TODOs providing context for this review? Reference them.
Step 5.6: Documentation staleness check
For each .md file in repo root:
- Check if code changes in diff affect features described in that doc.
- If doc NOT updated but code it describes WAS changed → INFORMATIONAL: "Documentation may be stale: [file] describes [feature] but code changed in this branch."
Step 5.7: Codex review (optional)
Check if Codex CLI is available:
which codex 2>/dev/null && echo "CODEX_AVAILABLE" || echo "CODEX_NOT_AVAILABLE"
If CODEX_NOT_AVAILABLE: skip silently.
If available, send via message tool:
Codex is an independent code review tool from OpenAI. Want an adversarial challenge of this plan?
Options: A) Yes — let Codex critique the plan B) No — proceed without Codex
If user chooses A, use the browser tool to open the plan file and describe the approach. Codex can be invoked via codex exec if installed locally.
Important Rules
- Read the FULL diff before commenting.
- Fix-first, not read-only. AUTO-FIX applied directly. ASK items need user approval.
- Be terse. One line problem, one line fix. No preamble.
- Only flag real problems.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install gstack-review - 安装完成后,直接呼叫该 Skill 的名称或使用
/gstack-review触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Review 是什么?
Pre-landing PR review. Analyzes diff against the base branch for SQL safety, LLM trust boundary violations, conditional side effects, and other structural is... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 134 次。
如何安装 Review?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install gstack-review」即可一键安装,无需额外配置。
Review 是免费的吗?
是的,Review 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Review 支持哪些平台?
Review 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Review?
由 Loocor(@loocor)开发并维护,当前版本 v1.0.0。