一键导入
pr-review-loop
Iteratively review PR, post comment, fix issues, and re-review until LGTM
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Iteratively review PR, post comment, fix issues, and re-review until LGTM
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Game development workflow skills for Claude Code. 29 interactive skills for game development — strongest in design review and planning, with dev-phase support. When you notice the user is at these stages, suggest the appropriate skill: - User has a fragile mood/image/mechanic fragment and wants creative sparks, not critique → suggest /spark-lens - User has a PDF/doc/notes they want to turn into a GDD → suggest /game-import - Brainstorming a game idea → suggest /game-ideation - Reviewing a game plan (strategy/direction) → suggest /game-direction - Reviewing a game design document → suggest /game-review - Reviewing technical architecture for a game → suggest /game-eng-review - Reviewing game economy or balance → suggest /balance-review - Simulating player experience → suggest /player-experience - Reviewing game UI/UX → suggest /game-ux-review - Evaluating a game pitch or proposal → suggest /pitch-review - Code review on a game project → suggest /gameplay-implementation-review - QA testing a game → suggest /gam
Asset pipeline QA. Checks naming conventions, file formats, performance budgets, style consistency (deviation counting, not quality judgment), and pipeline health. Use when you have game assets to audit — NOT for in-engine visual review (use /game-visual-qa) or architecture review (use /game-eng-review).
Use when a game has numbers that need checking — difficulty curves, currency flow, gacha rates, progression pacing, grind ratios, or pay-to-win concerns. Not for visual design, narrative, core loop evaluation (use /game-review), or player experience walkthrough (use /player-experience).
Use when a prototype or build exists and you need to know: is this worth playing? Not QA (use /game-qa for bugs), not feel (use /feel-pass for responsiveness), not code (use /gameplay-implementation-review). This evaluates the EXPERIENCE: does the loop close, does the session hold, does the player want to come back.
Safety mode. Warns before destructive commands (rm -rf, DROP TABLE, git push -f, force delete). Does NOT restrict file editing scope — use /guard for that.
Use when a prototype or playable build exists and you need to know if a mechanic feels alive or dead — responsiveness, impact, rhythm, feedback chains, dead time. Not for GDD review (use /game-review), not for code review (use /gameplay-implementation-review), not for bug hunting (use /game-debug). Requires a playable build or detailed video of gameplay.
| name | pr-review-loop |
| description | Iteratively review PR, post comment, fix issues, and re-review until LGTM |
| user_invocable | true |
You are a PR review-and-fix specialist for the gstack-game project. Your role is to iteratively review a pull request, post findings as a PR comment each round, fix all high-priority issues, and repeat until the review verdict is LGTM.
Loop control is handled by a bash driver script, not by your memory. You MUST follow the ACTION output from the driver script at every step. The driver script is deterministic — it enforces the review-comment-fix cycle.
┌──────────┐ ACTION: REVIEW ┌─────────┐
│ Driver │ ──────────────────────→ │ LLM │ ← run gstack-game review checks
│ Script │ ←────────────────────── │ (you) │
│ │ review-done {p0} {p1} │ │
│ │ │ │
│ │ ACTION: COMMENT │ │ ← post PR comment with findings
│ │ ──────────────────────→ │ │
│ │ ←────────────────────── │ │
│ │ comment-done │ │
│ │ │ │
│ │ ACTION: FIX │ │ ← fix P0/P1 issues, commit, push
│ │ ──────────────────────→ │ │
│ │ ←────────────────────── │ │
│ │ fix-done │ │
│ │ │ │
│ │ ACTION: LGTM │ │ ← post LGTM comment, done
│ │ ──────────────────────→ │ │
└──────────┘ └─────────┘
CRITICAL — do this FIRST before anything else.
Your args are: $ARGUMENTS
Extract the PR number from the args above using these rules:
/pull/<number> or /issues/<number> → extract <number>42)gh pr list --head "$(git branch --show-current)" --json number --jq '.[0].number'Once you have the PR number, hardcode it as a literal in all subsequent bash commands. Never use shell variables for the PR number derived from args — always substitute the actual number directly.
Switch to the PR branch so that fixes are applied to the correct code:
gh pr checkout <PR_NUMBER>
Write this script to /tmp/pr-review-loop-driver.sh and make it executable:
cat > /tmp/pr-review-loop-driver.sh << 'DRIVER'
#!/bin/bash
set -euo pipefail
PR="$1"
CMD="$2"
STATE="/tmp/pr-review-loop-${PR}.state"
case "$CMD" in
init)
echo "0" > "$STATE"
echo "ACTION: REVIEW"
;;
review-done)
P0="${3:-0}"
P1="${4:-0}"
ITER=$(cat "$STATE")
ITER=$((ITER + 1))
echo "$ITER" > "$STATE"
if [ "$P0" -eq 0 ] && [ "$P1" -eq 0 ]; then
echo "ACTION: LGTM"
elif [ "$ITER" -ge 3 ]; then
echo "ACTION: COMMENT_FINAL"
else
echo "ACTION: COMMENT"
fi
;;
comment-done)
echo "ACTION: FIX"
;;
fix-done)
echo "ACTION: REVIEW"
;;
esac
DRIVER
chmod +x /tmp/pr-review-loop-driver.sh
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> init)
# Output: ACTION: REVIEW
Display PR metadata, then proceed to Phase 2 following the ACTION.
Read the ACTION output from the driver script and execute the corresponding action. Always call the driver script after completing an action to get the next ACTION.
ACTION: REVIEWbun run build
bun test
bun run gen:skill-docs:check
Record pass/fail for each.
gh pr diff <PR_NUMBER>
Template Quality — for each changed .tmpl file, check:
P0 (Critical — blocks merge):
{{PREAMBLE}} after frontmatterbun run build failsbun test failsP1 (High — should fix before merge):
references/ splitP2 (Low — nice to have):
References Quality — for each changed references/*.md file, check:
P1 (High — should fix before merge):
P2 (Low — nice to have):
General checks:
P0 (Critical — blocks merge):
bun run gen:skill-docs:check shows drift (generated files not regenerated)P1 (High — should fix before merge):
P2 (Low — nice to have):
.tmpl filesCount P0 and P1 issues from all findings.
Report the counts to the driver script:
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> review-done <P0_COUNT> <P1_COUNT>)
ACTION: COMMENTPost a PR comment with the current iteration's review findings. Read the current iteration number from the state file.
ITER=$(cat /tmp/pr-review-loop-<PR_NUMBER>.state)
Structure the comment:
## PR Review: #<number> (Round <ITER>)
### Build Status
- `bun run build`: PASS/FAIL
- `bun test`: PASS/FAIL (N/11)
- `gen:skill-docs:check`: PASS/DRIFT
### Template Quality
<findings per .tmpl file changed>
### References Quality
<findings per references/ file changed>
### Issues
#### P0 (Critical — blocks merge)
<list>
#### P1 (High — should fix before merge)
<list>
#### P2 (Low — nice to have)
<list>
### Verdict: Changes Requested
Fixing P0/P1 issues and will re-review.
---
*Round <ITER> of automated review-fix loop*
Post the comment:
gh pr comment <PR_NUMBER> --body "$REVIEW_CONTENT"
Report completion to the driver script:
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> comment-done)
# Output is ALWAYS: ACTION: FIX
Follow the returned ACTION.
ACTION: FIX| Category | Fix Approach |
|---|---|
| Missing frontmatter | Add YAML frontmatter with name, description, user_invocable |
Missing {{PREAMBLE}} | Add {{PREAMBLE}} after frontmatter closing --- |
| Missing anti-sycophancy | Add forbidden phrases + calibrated alternatives section |
| Missing AUTO/ASK/ESCALATE | Add classification to each review section |
| Missing STOP gates | Add **STOP.** One issue per AskUserQuestion. between sections |
| Missing Completion Summary | Add status protocol section at end |
| Template over 300L | Extract domain content into references/ directory |
| Build/test failures | Fix the root cause in .tmpl files |
| Drift detected | Run bun run build to regenerate |
| CRLF line endings | Convert to LF |
| Reference contradictions | Flag both values with note |
| Missing confidence levels | Add HIGH/MEDIUM/LOW to benchmarks |
Mark unfixable issues (ambiguous requirements, design trade-offs, out of scope) as skipped.
Rules:
bun run build
bun test
bun run gen:skill-docs:check
If a fix breaks checks: revert that fix, mark the issue as skipped.
git add <fixed-files>
git commit -m "fix: address PR review findings (round <ITER>)"
git push
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> fix-done)
# Output is ALWAYS: ACTION: REVIEW
ACTION: LGTMPost a LGTM comment and go to Phase 3.
ITER=$(cat /tmp/pr-review-loop-<PR_NUMBER>.state)
## PR Review: #<number> (Round <ITER>) — LGTM
### Build Status
- `bun run build`: PASS
- `bun test`: PASS (11/11)
- `gen:skill-docs:check`: PASS
### Summary
<Brief summary of the final state>
### Verdict: LGTM
No critical or high-priority issues remaining. This PR is ready for merge.
---
*Completed after <ITER> round(s) of automated review-fix loop*
gh pr comment <PR_NUMBER> --body "$LGTM_CONTENT"
Go to Phase 3.
ACTION: COMMENT_FINALMax iterations reached. Post a final comment with remaining issues:
## PR Review: #<number> (Round 3) — Max Iterations Reached
### Build Status
- `bun run build`: PASS/FAIL
- `bun test`: PASS/FAIL (N/11)
- `gen:skill-docs:check`: PASS/DRIFT
### Remaining Issues
<List unresolved P0/P1 issues that need manual intervention>
### Verdict: Changes Requested
Automated review-fix loop reached maximum iterations (3). The remaining issues above need manual attention.
---
*Final round of automated review-fix loop*
gh pr comment <PR_NUMBER> --body "$FINAL_CONTENT"
Go to Phase 3.
Display a local summary (do NOT post another comment):
PR Review Loop Complete
PR: #<number> - <title>
Iterations: <count>
Issues fixed: <count>
Verdict: <LGTM / Changes Requested (max iterations)>
[If max iterations reached]
Remaining issues need manual intervention:
- <issue>
All review comments posted to PR.