/github-workflows:resolve-pr-threadsfrom github-workflows
Orchestrates resolution of all GitHub PR feedback, including review threads, comments, review bodies, and review-bot findings, by grouping related feedback, checking each claim against the code with /agentops:research before acting, processing groups sequentially, and resolving threads via GraphQL. Use when you need to batch-process review feedback to unblock a PR merge.
Ships in github-workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Processes all PR feedback by grouping related items, fixing each issue or replying with command output as proof, tagging every reply with its ledger marker, and finally resolving each finished thread with the canonical resolve mutation.
State warning: Thread IDs and resolution status change as reviews arrive. Re-fetch all open threads — cached thread lists from earlier are unreliable.
/resolve-pr-threads # Current branch PR
/resolve-pr-threads 142 # Specific PR
/resolve-pr-threads all # All open PRs with unaddressed feedback (sequential)
databaseId is numeric, check gh auth status, then retryContext inference: Infer owner/repo/PR from current git context, then substitute
these values for <OWNER>, <REPO>, <PR_NUMBER> placeholders per gh-cli-patterns:
owner=$(gh repo view --json owner --jq '.owner.login')
repo=$(gh repo view --json name --jq '.name')
number=$(gh pr view --json number --jq '.number')
Run 1a–1d in parallel.
Run the canonical fetch-threads query from /gh-cli-patterns.
Replace <OWNER>, <REPO>, <PR_NUMBER> before running.
Filter to isResolved == false. Extract: id (PRRT_* node ID), path, line,
comments.nodes[].databaseId (numeric — for REST replies), comments.nodes[].body,
comments.nodes[].author.login.
gh api repos/<OWNER>/<REPO>/issues/<PR_NUMBER>/comments --paginate
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/reviews --paginate \
--jq '[.[] | select(((.body // "") | length > 0) or .state == "CHANGES_REQUESTED")
| {id, body, state, author: .user.login, submitted_at}]'
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments --paginate
Identify the PR author, exclude ordinary feedback authored by that login and reply comments that carry an addressed marker, ignore pure status pings, parse review-bot findings, and check for coverage gaps as defined in the PR feedback ledger. Fetch every source without a date filter so a later commit cannot hide feedback.
Check every reviewer claim against the code before you act on it. When a claim
needs evidence, run /agentops:research (does the claim hold, with citations).
When a fix needs a fresh go/no-go, run /agentops:validate. Never accept or
reject feedback without that check. This applies to all thread and comment
processing below.
Process each thread group sequentially (one group at a time, no sub-agents).
For each thread group:
<!-- addressed: <id> --> marker.
Replace <OWNER>, <REPO>, <PR_NUMBER>, <DATABASE_ID> before running:gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments/<DATABASE_ID>/replies -f body="your reply <!-- addressed: inline-<DATABASE_ID> -->"
<DATABASE_ID> is the NUMERIC value from the fetch response, NOT the PRRT_ node ID.
Track results per thread:
PRRT_xxx: handled [commit:abc1234]PRRT_xxx: escalate [reason]Process each comment group sequentially after all thread groups. Skip if no comments.
For each feedback group:
Check the claim as above; fix the issue or answer the question.
For review bodies, post an issue comment quoting the first line. For issue
comments and review bodies, post via gh api repos/<OWNER>/<REPO>/issues/<PR_NUMBER>/comments;
include that item's exact ledger marker in the reply. For inline comments, use
the thread reply endpoint and include its marker.
For each CHANGES_REQUESTED review, answer the body, then request that
reviewer again and notify the operator. Never dismiss a review:
gh api -X POST repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/requested_reviewers \
-f 'reviewers[]=<login>'
Do not use the Issues comments endpoint as a fallback for review-thread replies; threaded review comments must be handled only via the dedicated thread-resolution flow.
Track results per feedback item:
FEEDBACK({id}): fixed [commit:abc1234]FEEDBACK({id}): answered [evidence/reply]FEEDBACK({id}): needs human [reason]After all groups are processed, resolve each handled thread one at a time (not in parallel)
to avoid cascade failures. Use the canonical resolve mutation from /gh-cli-patterns.
Replace <THREAD_ID> (PRRT_* node ID) before running.
Skip escalate threads; flag for manual attention.
Run the canonical count-unresolved query from /gh-cli-patterns and verify
every ledger item has a matching marker on the PR, including issue-comment edits
and all review-bot findings.
Replace <OWNER>, <REPO>, <PR_NUMBER> before running.
Must return {"unresolved": 0, "overflow": false}. Then push: git push.
gh pr list --state open --json number,headRefNameThis skill is a single-pass resolver — it processes all feedback found at invocation time, then returns. If the caller needs to handle late-arriving feedback, it is responsible for re-invoking this skill.
PR #<PR_NUMBER> - Review Feedback Summary
Threads: {groupCount} groups ({threadCount} total) | Handled: {n} | Needs human: {n}
Resolved via GraphQL: {n} | Verification: {0 unresolved}/{total}
Feedback: {n} items | Fixed: {n} | Answered: {n} | Unaddressed: {n}
Status: COMPLETE | PARTIAL ({n} need attention)
Omit "Threads:" when zero threads; omit "Feedback:" when no feedback items exist.
| Error | Cause | Fix |
|---|---|---|
Could not resolve to a node | Invalid thread ID | Re-fetch threads, IDs may have changed |
Resource not accessible | Permission issue | Check gh auth status, need repo write access |
| Verification shows >0 | Thread not resolved | Re-run mutation for remaining threads |
| Empty reviewThreads | No reviews yet | Exit cleanly |
| Exactly 100 threads returned | Pagination cap hit | Resolve visible threads first, then re-run |
| REST reply fails | Invalid <DATABASE_ID> or permissions | Verify numeric databaseId (not node ID) and ensure token has required repo permissions (403 = permission issue) |
| Feedback item has no marker | It was not answered or was edited after the reply | Re-fetch every source and answer the current item version |
| Reviews endpoint returns empty | No reviews submitted | Proceed with the other feedback sources |
\! in jq expression | Claude Code Bash escapes ! | Use (.x == y | not) or .x | length > 0 instead of != |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jacobpevans-ai/claude-code-plugins --plugin github-workflows18 skills in this plugin
/finalize-prAutomatically finalize pull requests for merge by resolving CodeQL violations, PR feedback, merge conflicts, and CI failures. Handles single PR (current branch or by number), all open PRs in the repo, or all open PRs across the org. Includes bot-authored PRs in all modes./gh-cli-patternsCanonical reference for all gh CLI command shapes used by skills in this plugin. Defines the placeholder convention, default-branch (trunk vs git-flow) detection, allowed --json fields, GraphQL fallback rules, -f/-F/--raw-field flag semantics, the PR-readiness gate, required status contexts, the feedback ledger, code-scanning alert query, review-thread fetch/count/resolve mutations, and heredoc bodies. Prevents Unknown JSON field errors and divergent query shapes./