一键导入
address-pr-comments
Use when evaluating and addressing unresolved PR review comments, before implementing any fixes from code review feedback on a pull request
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when evaluating and addressing unresolved PR review comments, before implementing any fixes from code review feedback on a pull request
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | address-pr-comments |
| description | Use when evaluating and addressing unresolved PR review comments, before implementing any fixes from code review feedback on a pull request |
Systematically evaluate unresolved PR review comments, determine which are valid and worth addressing, create an implementation plan, and wait for user confirmation before making changes.
Core principle: Evaluate before acting. Not all review comments are worth implementing -- assess each on technical merit before committing to changes.
1. FETCH — Get all unresolved review comments from the PR
2. EVALUATE — Assess each comment for validity and merit
3. PLAN — Create an actionable plan for valid comments
4. CONFIRM — Present plan and wait for user approval
5. IMPLEMENT — Execute approved changes
Determine the PR number:
gh pr view --json number --jq '.number'
If no PR is found, stop and ask the user for the PR number.
Retrieve all review comments on the PR:
# Get PR review comments (not issue comments)
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments --paginate
Filter to unresolved comments only. A comment is unresolved if it is NOT part of a resolved review thread. Check thread resolution status:
# Get review threads via GraphQL
gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewDecision
reviews(last: 50) {
nodes {
author { login }
state
body
}
}
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
path
line
comments(first: 20) {
nodes {
author { login }
body
createdAt
}
}
}
}
}
}
}
' -f owner='{owner}' -f repo='{repo}' -F pr={pr_number}
Important: Only process threads where isResolved: false. Skip resolved and outdated threads.
For each unresolved comment thread, read the relevant code and evaluate:
| Criteria | Question |
|---|---|
| Correctness | Does the reviewer identify a genuine bug or issue? |
| Relevance | Is this comment about code changed in this PR, or pre-existing? |
| Specificity | Is the request clear and actionable? |
| Merit | Does the suggestion improve the code (readability, performance, safety)? |
| Scope | Is this in-scope for the PR, or scope creep? |
| Codebase fit | Does the suggestion fit the patterns and conventions of this codebase? |
Assign each comment one of these categories:
IF comment identifies a real bug or correctness issue:
→ Address (always fix bugs)
IF comment is a style/preference disagreement with no objective improvement:
→ Decline (unless it aligns with established codebase conventions)
IF comment suggests a refactor that's unrelated to the PR's purpose:
→ Decline (scope creep)
IF comment is unclear or you can't determine what change is requested:
→ Discuss (ask for clarification)
IF comment points out a valid improvement but you disagree on approach:
→ Discuss (propose alternative)
IF reviewer lacks context about why the code is written a certain way:
→ Discuss (explain context, ask if they still want the change)
Present findings to the user in this format:
## PR #<number> — Comment Evaluation
### Address (<count>)
For each:
- **File:** <path>:<line>
- **Reviewer:** <author>
- **Comment:** <summary>
- **Assessment:** <why this should be addressed>
- **Proposed fix:** <what you'll change>
### Discuss (<count>)
For each:
- **File:** <path>:<line>
- **Reviewer:** <author>
- **Comment:** <summary>
- **Concern:** <what needs clarification>
- **Suggested response:** <draft reply to reviewer>
### Decline (<count>)
For each:
- **File:** <path>:<line>
- **Reviewer:** <author>
- **Comment:** <summary>
- **Reason:** <why this should be declined>
- **Suggested response:** <draft reply to reviewer>
### Already Resolved (<count>)
For each:
- **File:** <path>:<line>
- **Comment:** <summary>
- **Resolution:** <how/when it was resolved>
After presenting, ask:
"Review the plan above. You can:
- Approve all — I'll implement the 'Address' items and post replies for 'Discuss' and 'Decline' items
- Approve with changes — tell me which items to recategorize
- Pick specific items — tell me which items to address
What would you like to do?"
STOP and wait for user confirmation. Do NOT implement anything until the user responds.
After user confirmation:
To reply in a thread:
# Reply to a review comment thread
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
-f body='<reply text>'
| Mistake | Fix |
|---|---|
| Implementing before user confirms | Always wait for explicit approval |
| Treating all comments as valid | Evaluate each on merit — decline scope creep |
| Missing unresolved threads | Use GraphQL to check thread resolution status |
| Fixing code not in the PR diff | Only address comments about code changed in this PR |
| Blind agreement with reviewer | Evaluate technically — push back when warranted |
| Forgetting to reply to declined items | Draft courteous replies explaining the reasoning |
Use when starting a new feature, design change, or architecture decision. Explores approaches and tradeoffs before planning or coding. NEVER skip this for non-trivial work.
Use when executing an implementation plan. Each step is delegated to a fresh subagent for isolated context, then reviewed before proceeding. Do NOT execute plans inline — use subagents.
Use when implementation is complete and you need to decide how to integrate the work - guides completion by presenting structured options for merge, PR, or cleanup
Use when creating implementation plans. Breaks work into small, verifiable steps with exact file paths and verification commands. Use after brainstorming approval.
Use when you receive code review feedback (from a reviewer subagent, /review command, or human). Guides proper processing of feedback without dismissing or cherry-picking.
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes