|
| 1 | +--- |
| 2 | +name: address-pr-comments |
| 3 | +description: "Address review comments (including Copilot comments) on the active pull request. Use when: responding to PR feedback, fixing review comments, resolving PR threads, implementing requested changes from reviewers, addressing code review, fixing PR issues." |
| 4 | +argument-hint: "Optionally specify a reviewer name or file to focus on" |
| 5 | +--- |
| 6 | + |
| 7 | +# Address PR Review Comments |
| 8 | + |
| 9 | +Read the active pull request, identify unresolved review comments and feedback, implement the requested changes, and resolve the threads. |
| 10 | + |
| 11 | +## When to Use |
| 12 | + |
| 13 | +- A reviewer has left comments or change requests on the active PR |
| 14 | +- You need to systematically work through all open review threads |
| 15 | +- You want to respond to or implement reviewer feedback |
| 16 | + |
| 17 | +## Procedure |
| 18 | + |
| 19 | +### 1. Read the Active PR |
| 20 | + |
| 21 | +Call the `github-pull-request_activePullRequest` tool. |
| 22 | + |
| 23 | +**Refresh logic**: Check whether a refresh is needed before reading: |
| 24 | +- Call the tool once *without* `refresh` to get the cached state |
| 25 | +- Inspect the `lastUpdatedAt` field in the result |
| 26 | +- If the timestamp is **less than 3 minutes ago**, the PR is actively changing - call the tool again with `refresh: true` to ensure you have the latest comments and state |
| 27 | +- If the timestamp is older than 3 minutes, proceed with the cached data |
| 28 | + |
| 29 | +### 2. Identify Unresolved Comments |
| 30 | + |
| 31 | +From the tool result, collect all feedback that needs action: |
| 32 | + |
| 33 | +- **`comments`** array: inline review thread comments where `commentState` is `"unresolved"` |
| 34 | +- **`timelineComments`** array: general PR comments and reviews where `commentType` is `"CHANGES_REQUESTED"` or `"COMMENTED"` |
| 35 | + |
| 36 | +Group related comments by file (`file` field) to handle them efficiently. |
| 37 | + |
| 38 | +### 3. Plan Changes |
| 39 | + |
| 40 | +Before modifying any files: |
| 41 | +1. Read each unresolved comment carefully |
| 42 | +2. Identify the file and location each comment refers to |
| 43 | +3. Determine the minimal correct fix for each, if a fix is needed (not all comments are worthy of a change) |
| 44 | +4. Note dependencies between comments (e.g., a rename that affects multiple files) |
| 45 | + |
| 46 | +### 4. Implement Changes |
| 47 | + |
| 48 | +Work through the grouped comments file by file: |
| 49 | +- Read the relevant file section before editing |
| 50 | +- Apply the requested change |
| 51 | +- Do not refactor or modify code outside the scope of each comment |
| 52 | +- If a comment is unclear or contradictory, note it for a follow-up reply rather than guessing |
| 53 | + |
| 54 | +### 5. Verify |
| 55 | + |
| 56 | +After all changes are made: |
| 57 | +- Review that each originally unresolved comment has a corresponding code change or a note about why no code change was needed. |
| 58 | +- Ensure no unrelated code was modified |
| 59 | + |
| 60 | +### 6. Summarize |
| 61 | + |
| 62 | +Provide a concise summary of: |
| 63 | +- Which comments were addressed and what changes were made |
| 64 | +- Any comments that were intentionally skipped (with reasoning) |
| 65 | +- Any follow-up questions for the reviewer |
0 commit comments