Agent skill
resolve-comments
Resolve PR review comments
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/resolve-comments
SKILL.md
Resolve Comments
You are assisting with resolving PR review comments. Follow these steps:
1. Fetch Review Comments
First, get PR info and review comments:
gh pr view --json number,headRepositoryOwner
gh api /repos/{owner}/{repo}/pulls/{number}/comments
Format and display comments showing: author, file path, line number, diff hunk, and comment body.
Then, for actions that require thread IDs (reply/resolve), fetch via GraphQL:
gh api graphql -f query='
query {
repository(owner: "OWNER", name: "REPO") {
pullRequest(number: NUMBER) {
reviewThreads(first: 50) {
nodes {
id
isResolved
comments(first: 10) {
nodes {
databaseId
body
path
line
}
}
}
}
}
}
}'
2. Analyze and Propose Response
For each unresolved comment, analyze the feedback and make a professional judgment:
- Assess validity: Is the feedback technically correct? Does it improve the code?
- Evaluate trade-offs: Consider complexity, scope, and practical impact
- Propose action: Recommend either fixing or explaining why no change is needed
Present your analysis and recommendation to the user for each comment. The user makes the final decision, but you should provide clear reasoning for your recommendation.
3. Handle Response
If fix required:
- Make the necessary code changes
- Reply to acknowledge the fix (e.g., "Done")
- Resolve the thread
- Inform user to use
/fixupor/commitafter all fixes are complete
If no action needed:
- Draft a reply with clear rationale (e.g., "Won't fix because...", "Intentional design because...")
- Match the language of the original comment (e.g., reply in Japanese if the comment is in Japanese)
- Reply to the last comment in the thread (use its
databaseIdascomment_id) - Post the reply:
gh api /repos/{owner}/{repo}/pulls/{number}/comments/{comment_id}/replies -X POST -f body="..." - Resolve the thread:
gh api graphql -f query='
mutation {
resolveReviewThread(input: {threadId: "THREAD_ID"}) {
thread { isResolved }
}
}'
4. Summary
After processing all comments:
- List what was fixed (if any)
- List what was resolved without changes (if any)
- Suggest next steps (e.g.,
/fixupto amend,/publishto push)
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?