with one click
review-pr
Review and address PR feedback using 6-dimensional code review
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Review and address PR feedback using 6-dimensional code review
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Close a GitHub issue with discipline — resolved, superseded, or duplicate. Pre-flights body + comments, migrates substance before destroying context, cross-links both directions.
File a new GitHub issue with duplicate search, scope decision, label discovery, and preview before posting. Prevents fragmented or silently-filed issues.
Restructure the topology of GitHub issues — split one into many focused replacements, or merge multiple into one keeper. Migrates substance and cross-links before closing anything.
Update an existing GitHub issue — edit body, post a comment, retag, or reopen. Pre-flights body + comments; acknowledges stale framing instead of silently rewriting.
Structured code review using 6 dimensions. Works with or without the code-reviewer agent.
Create conventional commits with quality gates and validation
| name | review-pr |
| description | Review and address PR feedback using 6-dimensional code review |
| argument-hint | [PR number or URL] |
| allowed-tools | Bash(gh pr *), Bash(gh api *), Bash(gh repo *), Bash(git status), Bash(git diff *), Bash(git log *), Bash(git show *), Bash(git add *), Bash(git commit *), Bash(git push *), Bash(git rebase *), Bash(git stash *), Bash(git fetch *), Bash(git merge *), Bash(${CLAUDE_PLUGIN_ROOT}/skills/review-pr/*), Bash(${CLAUDE_PLUGIN_ROOT}/skills/shared/*), Bash(${CLAUDE_PLUGIN_ROOT}/skills/pr-comments/reply-to-comment.sh*), Read |
Review a PR using 6 dimensions or address unresolved review feedback systematically.
Analyze code changes thoroughly and respond to review comments without missing issues or duplicating automated findings.
gh pr view or gh api repos/{owner}/{repo}/pulls/{number}/comments), always verify the PR number matches the PR you're actually working on. Replying to the wrong PR is invisible to reviewers and leaves the actual PR unaddressed.gh) installed and authenticated/review-pr [PR#] # Or: /review-pr (current branch)
gh pr view <PR#> --json state,reviews
gh pr view <PR#> --json title,body,diff
[Invoke code-reviewer agent with PR context]
Organize findings: BLOCKING → SUGGESTION → NITPICK
Post structured review via gh pr review
[For each unresolved comment]
1. Read affected code
2. Fix or acknowledge
3. Run project verification (test suite, lint, type-check)
4. Commit, push
5. Reply to EVERY comment in-thread (this step is NOT optional)
Steps 4-5 are atomic. Never finish at "pushed fixes" — always continue to reply to every comment before reporting done. See DETAIL: Mode B Workflow.
For PRs with many changed files or thousands of lines:
Example:
This PR is quite large (47 files, 2500 lines). I've reviewed:
- Core auth changes (critical path)
- Data mutation logic (sampled 5 files for pattern)
- Tests (coverage spot-check)
Blocked on: Vendor update changes (auto-generated, skipping).
Recommendation: For future PRs, split refactors by domain
(auth, API, database) for focused reviews.
If the PR has merge conflicts:
git fetch origin <baseRefName>
git merge origin/<baseRefName>
# Resolve conflicts manually
git add <resolved-files>
git commit -m "Merge branch 'origin/<baseRefName>'"
Then resume review-addressing workflow. Conflicts can invalidate prior comments — recheck affected sections.
Check CI status before responding to review comments:
gh pr view {number} --json mergeable,mergeStateStatus
gh pr checks {number}
If code-related (lint, type, test failure):
If infrastructure-related (flaky CI, timeout, infrastructure issue):
Always resolve conflicts and build failures before addressing review comments — they may no longer apply after merging base branch.
Use this structure for consistent, thorough reviews (avoid repeating automated findings):
# Review: [PR Title]
## What This Changes
[1-2 sentences summarizing the change and its impact]
## 6-Dimensional Analysis
### ✅ Correctness
- [Semantic correctness, type safety, logic]
- [Any potential bugs or edge cases]
### ✅ Design
- [Architecture, interfaces, patterns vs. project conventions]
- [Trade-offs and alternatives considered?]
### ✅ Readability
- [Naming clarity, documentation, code flow]
- [Any confusing sections?]
### ✅ Performance
- [Efficiency, algorithms, resource usage]
- [Any obvious optimizations possible?]
### ✅ Testing
- [Test coverage for new code]
- [Edge cases and error conditions covered?]
### ✅ Security
- [Input validation, auth, secrets, injection risks]
- [Any exposed internals or vulnerabilities?]
## Findings
### 🚫 BLOCKING (must fix before merge)
[Only items that break functionality or violate critical constraints]
### ⚠️ SUGGESTION (worth addressing)
[Improvements that enhance quality, maintainability, or safety]
### 💬 NITPICK (nice-to-have)
[Style, naming, minor clarity suggestions]
### ✨ What Looks Good
[Highlight strong aspects: good patterns, clever solutions, solid testing]
## Summary
- Verdict: Approved / Changes requested / Comment
- Ready to merge after addressing blocking items
Reply to each comment with one of these patterns:
Fixed — [describe what changed].
[If tests added: Also added tests for X].
This was addressed in [commit hash] — [brief explanation].
Acknowledged — [reason for deferral].
Tracked in #NNN [link to GitHub issue].
I wasn't able to reproduce this. Can you clarify [specific question]?
Initial PR review (no comments yet).
ctx=$(${CLAUDE_PLUGIN_ROOT}/skills/shared/resolve-github-context.sh <PR#>)
owner_repo=$(echo "$ctx" | jq -r '"\(.owner)/\(.repo)"')
${CLAUDE_PLUGIN_ROOT}/skills/shared/fetch-pr-context.sh "$owner_repo" <PR#>
Pass compiled context:
PR Title: [title]
Author: [author]
Description: [body]
Labels: [labels]
Diff: [patch]
Existing Comments: [any automated reviewer comments]
Agent returns: 6D analysis + findings organized by severity.
BLOCKING: [list items that must be fixed]
SUGGESTION: [list improvements]
NITPICK: [list nice-to-haves]
✨ What Looks Good: [highlight strengths]
gh pr review <PR#> --approve # or --request-changes / --comment
Address unresolved review feedback.
ctx=$(${CLAUDE_PLUGIN_ROOT}/skills/shared/resolve-github-context.sh {number})
owner_repo=$(echo "$ctx" | jq -r '"\(.owner)/\(.repo)"')
${CLAUDE_PLUGIN_ROOT}/skills/review-pr/fetch-unresolved-comments.sh "$owner_repo" {number}
Returns JSON array of unresolved comments with id, path, line, body, author. Resolved threads are already filtered out.
Read affected code. Classify:
Make code changes. Validate:
cmd=$(${CLAUDE_PLUGIN_ROOT}/skills/shared/discover-verification-cmd.sh)
eval "$cmd" # ALL must pass
Use the fixup-and-push script (stages, creates fixup commit, autosquash rebases, force-pushes):
# Subject is now optional — inferred from the latest non-merge, non-fixup
# commit in `origin/<baseRefName>..HEAD`. Pass `--subject "..."` to override.
${CLAUDE_PLUGIN_ROOT}/skills/review-pr/fixup-and-push.sh <baseRefName> <file1> <file2> ...
# or explicit:
${CLAUDE_PLUGIN_ROOT}/skills/review-pr/fixup-and-push.sh <baseRefName> --subject "fix(scope): description" <file1> <file2> ...
(If autosquash silently fails to squash — leaving a dangling fixup! commit on the branch — see DETAIL: Manual Recovery from Autosquash No-op below.)
Verify the PR number first — confirm you're replying on the correct PR (e.g., via gh pr view or the web UI). If fixes were made in a follow-up PR, reply on that PR, not the original.
Use the reply script — it validates the comment belongs to the correct PR before posting:
${CLAUDE_PLUGIN_ROOT}/skills/pr-comments/reply-to-comment.sh {owner}/{repo} {number} {comment_id} 'Fixed — [explanation]'
Never reply before pushing — replies confirm fix is live.
After replying to all comments, resolve all review threads to clear the "changes requested" status:
resolved=$(${CLAUDE_PLUGIN_ROOT}/skills/shared/resolve-all-threads.sh {owner}/{repo} {number})
echo "Resolved $resolved review threads"
Print results:
fixup-and-push.sh creates a fixup! <subject> commit and then runs git rebase --autosquash origin/<base>. Autosquash only squashes when a commit matching <subject> exists within the rebase range (i.e., on the feature branch, not yet on the base). If the matching commit was already merged to base — or the subject collides with a base-branch commit — autosquash silently does nothing: the rebase reports success, but the fixup! commit remains as a dangling commit on the branch. CI sees an unsquashed fixup! commit and history reviewers see noise.
Tracked as dougborg/harness-kit#40 (detect-and-infer fix coming to fixup-and-push.sh); the companion fetch-unresolved-comments.sh thread-selection bug was #41 (already fixed).
# Recover from autosquash no-op by manually squashing the fixup commit.
# Two gotchas:
# 1. Use `env` so GIT_SEQUENCE_EDITOR is exported portably across shells.
# 2. The rebase-todo line format varies (`pick <sha> <subject>` is the
# default; some configs emit `pick <sha> # <subject>`). Match any
# `pick` line containing `fixup!` so the script works regardless.
cat > /tmp/squash-fixup.sh <<'SH'
#!/bin/bash
sed -i.bak '/fixup!/s/^pick /fixup /' "$1"
SH
chmod +x /tmp/squash-fixup.sh
env GIT_SEQUENCE_EDITOR=/tmp/squash-fixup.sh git rebase -i origin/<base>
env GIT_SEQUENCE_EDITOR=... — The shell-inline VAR=value command form is fragile across shells and certain wrapper setups. Using env is portable and always exports the variable correctly to the child process.git rebase -i's todo format varies (pick <sha> <subject> is the default, but some configs emit pick <sha> # <subject> with a separator). A pattern that matches any pick line containing fixup! works regardless of the format — and is harder to silently no-op than a tighter regex tied to one shape.After the rebase completes, confirm no fixup! commits remain on the branch:
git log origin/<base>..HEAD --format=%s | grep -c '^fixup!' || true
# Expected: 0
If the count is nonzero, the script didn't match — re-check the sed pattern against git log --format='%s' | head and rerun.
--no-verify, # noqa, type: ignoregh issue create ticketgit add -A or git add ./code-reviewer — 6-dimensional review reference/pr-comments — Systematic reply workflow (alternative to this skill's Mode B)/commit — Quality-gated conventional commitscode-reviewer agent — Automated 6D analysis (spawned by this skill)