$npx -y skills add mgratzer/forge --skill forge-address-pr-feedbackAnalyze and address unresolved feedback on a GitHub pull request. Use when the user has received PR review comments and wants to systematically address each piece of feedback, or when the user mentions PR feedback, review comments, or addressing reviewer concerns.
| 1 | # Address PR Feedback |
| 2 | |
| 3 | Systematically address unresolved review feedback on a pull request. |
| 4 | |
| 5 | ## Input |
| 6 | |
| 7 | PR number or URL (auto-detects from current branch if omitted). Optional: `-- <additional context>` for prioritization guidance. |
| 8 | |
| 9 | ## Process |
| 10 | |
| 11 | ### Step 1: Fetch Unresolved Threads |
| 12 | |
| 13 | **Use GraphQL** — the REST API does NOT expose `isResolved` status on review threads. |
| 14 | |
| 15 | ```bash |
| 16 | gh api graphql -f query=' |
| 17 | query { |
| 18 | repository(owner: "<OWNER>", name: "<REPO>") { |
| 19 | pullRequest(number: <PR_NUMBER>) { |
| 20 | reviewThreads(first: 100) { |
| 21 | nodes { |
| 22 | isResolved |
| 23 | isOutdated |
| 24 | path |
| 25 | line |
| 26 | id |
| 27 | comments(first: 10) { |
| 28 | nodes { |
| 29 | id |
| 30 | body |
| 31 | author { login } |
| 32 | url |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | }' |
| 40 | ``` |
| 41 | |
| 42 | Filter for unresolved threads: `select(.isResolved == false)`. |
| 43 | |
| 44 | ### Step 2: Process Each Thread |
| 45 | |
| 46 | For each unresolved thread, read the file and surrounding context, then categorize: |
| 47 | - **Actionable** — code change needed |
| 48 | - **Question** — respond with explanation |
| 49 | - **Discussion** — assess if change improves code |
| 50 | - **Already addressed** — thread not resolved but change was made |
| 51 | - **Won't fix** — current approach is preferred |
| 52 | - **Follow-up** — valid but out of scope — create linked issue |
| 53 | |
| 54 | ### Step 3: Address and Reply Individually |
| 55 | |
| 56 | **Address each thread immediately, then reply before moving to the next.** Do not batch. |
| 57 | |
| 58 | For each thread: |
| 59 | |
| 60 | 1. **Make the change** (if actionable) |
| 61 | 2. **Run lint/format/checks** |
| 62 | 3. **Commit**: `git commit -m "fix: address PR feedback — <brief description>"` |
| 63 | 4. **Reply to the thread**: |
| 64 | |
| 65 | ```bash |
| 66 | gh api graphql -f query=' |
| 67 | mutation { |
| 68 | addPullRequestReviewThreadReply(input: { |
| 69 | pullRequestReviewThreadId: "<THREAD_ID>" |
| 70 | body: "<response>" |
| 71 | }) { |
| 72 | comment { id } |
| 73 | } |
| 74 | }' |
| 75 | ``` |
| 76 | |
| 77 | Reply format by category: |
| 78 | - **Actionable**: "Fixed in `<sha>`. <what changed>" |
| 79 | - **Question**: "<answer with code references>" |
| 80 | - **Discussion**: "<decision and reasoning>" |
| 81 | - **Already addressed**: "Addressed in `<sha>`." |
| 82 | - **Won't fix**: "Keeping current approach because <reason>." |
| 83 | - **Follow-up**: "Created #<num> to track this." |
| 84 | |
| 85 | ### Step 4: Create Follow-up Issues |
| 86 | |
| 87 | For valid out-of-scope improvements, create an Issue in the project's Issue tracker (see [issue-operations](../_shared/issue-operations.md)). Include the PR context: reviewer's comment, PR number, and proposed solution. |
| 88 | |
| 89 | ### Step 5: Push and Summarize |
| 90 | |
| 91 | ```bash |
| 92 | git push |
| 93 | ``` |
| 94 | |
| 95 | Report: feedback items addressed, commits created, follow-up issues created, items needing human decision. |
| 96 | |
| 97 | ## Guidelines |
| 98 | |
| 99 | - **GraphQL for discovery** — REST API doesn't show resolution status |
| 100 | - **Address, reply, then next** — don't batch |
| 101 | - **Be specific** — reference commits, line numbers, and code |
| 102 | - **Test changes** — run checks before committing |
| 103 | |
| 104 | ## Related Skills |
| 105 | |
| 106 | **If the feedback required substantial changes:** Use `forge-reflect` for one more self-review before re-requesting review. |
| 107 | |
| 108 | ## Example Usage |
| 109 | |
| 110 | ``` |
| 111 | /forge-address-pr-feedback 123 |
| 112 | /forge-address-pr-feedback 123 -- prioritize security comments |
| 113 | /forge-address-pr-feedback |
| 114 | ``` |