From toolbelt
Address review issues raised by Claude Code Action (and compatible review bots) on a GitHub pull
How this skill is triggered — by the user, by Claude, or both
Slash command
/toolbelt:gh-fix-pr-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Address review issues raised by Claude Code Action (and compatible review bots) on a GitHub pull
Address review issues raised by Claude Code Action (and compatible review bots) on a GitHub pull
request. Reviews arrive via two channels — inline review threads (GraphQL reviewThreads) and
PR issue comments (REST /issues/{pr}/comments). This skill inspects both, selects the highest
severity unaddressed issue by default, implements the fix, verifies tests, commits, pushes, and
replies on the review.
User input is passed as $ARGUMENTS.
Iron rules:
git push without explicit user confirmation of the diff and commit message.main / master.--inline / --comments.make test, scripts in package.json, etc.).| Argument | Effect |
|---|---|
issue_number | Fix a specific issue number. Omit to pick the highest severity. |
--all | Fix every actionable issue in severity order. One commit per fix. |
--skip-tests | Skip test verification. Use sparingly. |
--inline | Inspect only inline review threads. |
--comments | Inspect only PR issue comments. |
--resolve | Resolve the inline thread after fixing (requires confirmation). |
--dry-run | List actionable issues and planned fixes. Make no changes. |
--pr <number> | Target a different PR instead of the current branch's PR. |
$ARGUMENTSissue_number.--pr consumes the next token as its value.--inline and --comments are mutually exclusive — reject combinations with
Error: --inline and --comments cannot be combined.Severity order: CRITICAL > HIGH > MEDIUM > LOW. Unmarked issues default to MEDIUM.
No unresolved review issues found on this PR and stop.BRANCH=$(git branch --show-current)
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
echo "Error: cannot run from main/master. Checkout a feature branch first."
exit 1
fi
# Use --pr override if provided, otherwise the current branch's PR.
NUMBER="${PR_OVERRIDE:-$(gh pr view --json number -q .number)}"
OWNER=$(gh repo view --json owner -q .owner.login)
REPO=$(gh repo view --json name -q .name)
gh pr view "$NUMBER" --json number,headRefName,url,state,isDraft
Stop and inform the user if:
--pr was passed.MERGED or CLOSED.Query both sources unless a filter flag restricts scope. Identify the review bot login once:
typically github-actions[bot], claude[bot], or claude-code[bot]. Use this in both filters to
avoid mistaking human comments for bot reviews.
--comments)gh api graphql -f query='
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
id
isResolved
isOutdated
path
line
comments(first: 10) {
nodes {
databaseId
body
path
line
outdated
createdAt
author { login }
url
}
}
}
}
}
}
}' -F owner="$OWNER" -F repo="$REPO" -F number="$NUMBER"
Keep threads where:
isResolved: false AND isOutdated: falsePagination caveat:
first: 100is the GraphQL cap. If the PR has more than 100 threads, warn the user; paginate withafter: $cursoronly if needed.
--inline)gh api repos/$OWNER/$REPO/issues/$NUMBER/comments --paginate
Treat a comment as a review when BOTH hold:
author.login matches the review bot.## Code Review, Code Review -, a severity marker
(CRITICAL|HIGH|MEDIUM|LOW), a structured marker (**Problem:**, **Recommendation:**,
**Location:**), or unchecked checklist items (- [ ]).Select the most recent matching comment as the source of truth.
### 🔍 **Potential Issues**, numbered lists)
or checklist entries.MEDIUM when unmarked.$ARGUMENTS or the top of the sorted list.Extract, regardless of source:
Inline thread — path/line from thread metadata; severity from the comment body.
PR comment issue — expect either a structured block:
#### N. **Issue Title (SEVERITY)**
**Location:** `file.js:line-range`
**Problem:** ...
**Recommendation:** ...
…or a checklist entry: - [ ] Issue description (file.js:line).
git log --oneline -20
git diff origin/main -- <file_path>
Read the file at the cited location and compare against the recommendation.
Three outcomes:
Outdated-location sanity: if the cited
file:lineno longer matches the referenced code (e.g., file moved, content diverged), warn the user and ask whether to skip or locate the equivalent site manually. Inline threads markedisOutdated: trueare already filtered out.
If --dry-run, list the planned change(s) and stop — no edits.
Otherwise:
Common patterns: idempotency guards for duplicate listeners, missing cleanup functions, input sanitisation for security findings, matching test updates when behaviour changes.
Skip only when --skip-tests is passed (warn the user this bypasses safety).
Detect the test command in this order:
Makefile with a test target → make testpackage.json scripts.test → npm test (or pnpm / yarn if lockfile indicates)pyproject.toml / pytest.ini → pytest (prefer uv run pytest if uv.lock exists)go.mod → go test ./...If tests fail:
git checkout -- <files> and report:
Fix causes test failures, manual intervention needed.Show the diff and the proposed commit message, then ask the user to confirm before committing.
git add -A
git commit -m "fix: <issue title from review>
<brief description of what was fixed>
Addresses review issue #<N> (<SEVERITY>)
Review: <comment_url>"
Ask again before git push. If the push is rejected:
git fetch
git status
# If behind, pull with rebase to keep history linear:
git pull --rebase
Then retry the push. Never --force without explicit consent.
Confirm with the user before posting.
Inline thread reply:
gh api graphql -f query='
mutation($threadId: ID!, $body: String!) {
addPullRequestReviewThreadReply(
input: {pullRequestReviewThreadId: $threadId, body: $body}
) {
comment { url }
}
}' -F threadId="$THREAD_ID" -F body="Fixed in commit <sha>."
If --resolve is set and the user confirms, follow up with:
gh api graphql -f query='
mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { isResolved }
}
}' -F threadId="$THREAD_ID"
PR comment reply:
gh api repos/$OWNER/$REPO/issues/$NUMBER/comments \
-f body="Fixed issue #<N> (**<Title>**) in commit <sha>.
**Changes:**
- <bullet points>
Remaining issues: <count>"
--all and issues remain → return to Step 4 with the next highest severity.Fixed: Issue #<N> - <Title> (<SEVERITY>)
Source: inline thread | PR comment
Commit: <sha>
Tests: passed | skipped
Thread resolved: yes | no | n/a
Remaining issues:
- #2: <Title> (HIGH) [inline]
- #3: <Title> (MEDIUM) [comment]
Run again to fix next issue, or use --all to fix all.
path:line info; PR comments usually need parsing.--inline / --comments scope the sweep to one channel; they are mutually exclusive.--dry-run is read-only — no edits, commits, pushes, or replies.CRITICAL > HIGH > MEDIUM > LOW.**Problem:** / **Recommendation:** / **Location:** markers rather than exact headings.npx claudepluginhub glnds/glnds-cc-marketplace --plugin toolbeltGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.