Agent skill
prc
Review and address code review comments on PR. Use when asked to 'address review comments', 'fix PR feedback', 'handle review comments', 'respond to PR comments', or 'address CR comments'. NOT for initiating code review (use /sr), NOT for task-based implementation with CR mode (use /si).
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/prc
SKILL.md
PR Review Comments Handler
PRIMARY OBJECTIVE
Fetch, analyze, and address code review comments on the current PR. Present an action plan for user approval before implementing fixes, then commit and reply to reviewers.
Related Skills
/sr— Initiate a code review (before merge). Use that skill to start a review, this skill to address the results./si— Task-based implementation with "Address CR" mode. Use/siwhen review feedback requires structured task-driven changes; use/prcfor direct, ad-hoc PR comment handling.
GATE 1: Identify PR & Fetch Comments
Step 1: Resolve PR
If $ARGUMENTS contains a PR number, use it. Otherwise:
- Run
git branch --show-currentto get the current branch - Run
gh pr view --json number,title,urlto find the open PR
Error — no PR found:
Inform user: "No open PR found for branch {branch}. Verify the branch is pushed and the PR is open." Stop execution.
Step 2: Fetch Comments
- Run
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviewsto get reviews - Run
gh api repos/{owner}/{repo}/pulls/{pr_number}/commentsto get inline comments - Also check
gh pr view {pr_number} --json commentsfor general PR comments
Error — no comments found: Inform user: "No review comments found on PR #{number}. Nothing to address." Stop execution.
GATE 2: Analyze & Present Plan
Step 1: Categorize Comments
For each review comment, evaluate:
- Is the feedback valid and technically correct?
- Is it applicable to the current code?
- Does it align with project conventions and architecture?
- Is it a blocker or a nice-to-have suggestion?
Classify each comment into one of:
- Address — Valid feedback, will fix
- Skip — Not applicable or already handled (provide reason)
- Discuss — Ambiguous or disagreed, needs user input
Step 2: Present Action Plan
Display a table:
| # | File:Line | Comment Summary | Action | Complexity |
|---|-----------|-----------------|--------|------------|
| 1 | src/foo.ts:42 | Missing null check | Address | Simple |
| 2 | src/bar.ts:15 | Rename variable | Address | Simple |
| 3 | src/baz.ts:88 | Architecture concern | Discuss | Significant |
STOP — Use AskUserQuestion to confirm the plan. Ask user to approve, modify, or flag any items they disagree with. Do not proceed until user approves.
GATE 3: Implement & Verify
Step 1: Apply Fixes
For each approved "Address" item:
- Read the target file
- Make the necessary code change using Edit
- Track progress with TodoWrite
For "Discuss" items the user resolved: apply the agreed-upon fix.
Step 2: Run Verification
- Run project tests (
npm testor equivalent) - Run lint checks (
npm run lintor equivalent) - Run type checks if applicable (
tsc --noEmit)
Error — tests or lint fail: Present failures to user. Do not proceed to GATE 4. Work with user to resolve, or revert changes if needed.
GATE 4: Commit, Push & Reply
Step 1: Commit & Push
- Stage changed files with
git add(specific files only) - Ask user permission before committing
- Create a focused commit:
fix: address PR review feedback - Push to update the PR
Step 2: Reply to Comments
For each addressed comment:
- Reply with a brief description of what was done (1-2 sentences)
- Use
gh api repos/{owner}/{repo}/pulls/comments/{comment_id}/replies -f body="..."to reply
For skipped comments:
- Reply explaining why respectfully
Error — gh API reply fails: Report the error and suggest manual reply via GitHub UI.
Output Format
Provide a final summary:
## PR Review Summary
**PR**: #XX - Title
**Reviewer(s)**: @username
### Comments Addressed:
1. [file:line] - Brief description of fix
2. [file:line] - Brief description of fix
### Comments Skipped (if any):
1. [file:line] - Reason why not applicable
### Changes Made:
- List of files modified
- New commit: {hash}
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?