Agent skill
address-pr-comments
Analyze and address GitHub PR review comments intelligently, distinguishing between actionable feedback requiring code changes and comments that can be resolved without changes. Use when addressing PR feedback or review comments.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/address-pr-comments
SKILL.md
Address PR Comments Workflow
Intelligently triage PR review comments, address actionable feedback, and resolve informational comments.
Input
Accept PR number (123, #123) or branch name (feature-branch).
Workflow
- Match input to PR
- Fetch unresolved comments
- Classify comments
- Get user confirmation on ALL comments (user selects which to address/skip/discuss)
- Address user-selected comments with code changes
- Reply and resolve threads
Step 1: Match Input to PR
# PR number: gh pr view <number> --json number,title,headRefName,state
# Branch: git branch --show-current && gh pr list --head <branch> --json number,title,state
Step 2: Fetch Unresolved Comments
gh api graphql -f query='
query {
repository(owner: "hw-native-sys", name: "pypto") {
pullRequest(number: <number>) {
reviewThreads(first: 50) {
nodes {
id isResolved
comments(first: 1) {
nodes { id databaseId body path line }
}
}
}
}
}
}'
Filter to isResolved: false only.
Step 3: Classify Comments
| Category | Description | Examples |
|---|---|---|
| A: Actionable | Code changes required | Bugs, missing validation, security issues |
| B: Discussable | May skip if follows .claude/rules/ |
Style preferences, premature optimizations |
| C: Informational | Resolve without changes | Acknowledgments, "optional" suggestions |
Present summary showing category, file:line, and issue for each comment. For Category B, explain why code may already comply with .claude/rules/.
Step 4: Get User Confirmation on ALL Comments
Always let the user decide which comments to address and which to skip. Present ALL unresolved comments (A, B, and C) in a numbered list with their classification and a brief summary.
Present a numbered list and ask the user to specify which comments to address, skip, or discuss:
- Recommend addressing Category A items
- Mark Category B with rationale for skipping or addressing
- Mark Category C as skippable by default
User choices per comment: Address (make changes) / Skip (resolve as-is) / Discuss (need clarification)
Only proceed with the comments the user explicitly selects. Do NOT auto-resolve any comment without user consent.
Step 5: Address Comments
For user-selected comments only:
- Read files with Read tool
- Make changes with Edit tool
- Commit using
/commitskills and skip testing and review
Commit message format:
chore(pr): resolve review comments for #<number>
- Fixed validation bug (comment #1)
- Added null check (comment #2)
When to skip testing/review:
- Minor documentation/comment fixes
- Changes already tested in original PR
- Fast iteration needed
Step 6: Resolve Comments
Reply using gh api repos/:owner/:repo/pulls/<number>/comments/<comment_id>/replies -f body="..." then resolve thread with GraphQL resolveReviewThread mutation.
Response templates:
- Fixed: "Fixed in
<commit>- description" - Skip: "Current follows
.claude/rules/<file>" - Acknowledged: "Acknowledged, thank you!"
Best Practices
| Area | Guidelines |
|---|---|
| Analysis | Reference .claude/rules/; when unsure → Category B |
| Changes | Read full context; minimal edits; follow project conventions |
| Communication | Be respectful; explain reasoning; reference rules |
Error Handling
| Error | Action |
|---|---|
| PR not found | gh pr list; ask user to confirm |
| Not authenticated | "Run: gh auth login" |
| Unclear comment | Mark Category B for discussion |
Checklist
- PR matched and validated
- Unresolved comments fetched and classified
- ALL comments presented to user for selection
- Code changes made and committed (use
/commit) - Changes pushed to remote
- All comments replied to and resolved
Remember
Not all comments require code changes. Evaluate against .claude/rules/ first. When in doubt, consult user.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?