From ccflow
Address PR review comments — fetch, evaluate, fix, reply, push, re-request review
How this skill is triggered — by the user, by Claude, or both
Slash command
/ccflow:address-reviewThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Read the `subagent-safety` reference skill before delegating work to subagents.
Read the subagent-safety reference skill before delegating work to subagents.
Config check: Before anything else, verify .claude/config.json exists by reading it. If the file does not exist, stop immediately and tell the user:
"ccflow is not configured for this project. Run /ccflow:configure first to set up."
Read .claude/config.json.
Shell rules: Read the shell-rules skill before running any gh commands (covers heredoc temp-file pattern).
Parse $ARGUMENTS:
The first token is the PR number. Everything after it is optional user context (additional instructions or focus areas).
Split $ARGUMENTS into:
# prefix stripped.
For example: #42 focus on the API comments → number 42, 7 → number 7.42 only address the test coverage comments → context is only address the test coverage comments.Read .claude/rules/lessons-learned.md before addressing any comments.
This pipeline has 6 phases. Execute them in order. Between major phases, report progress to the user.
Fetch the PR metadata and all review comments.
Prerequisites: Config loaded, PR number parsed.
Extract owner/repo from git remote get-url origin (e.g. [email protected]:owner/repo.git → owner/repo), then run:
gh pr view <number> --repo <owner>/<repo> --json number,title,body,headRefName,state,reviewDecision,reviews,reviewRequests
Verify the PR is open:
AskUserQuestion. If no → stop.Run both in parallel:
gh api repos/<owner>/<repo>/pulls/<number>/reviews
gh api repos/<owner>/<repo>/pulls/<number>/comments
From the fetched comments, filter to actionable items:
Include:
Exclude:
github-actions[bot], dependabot[bot], etc.)outdated flag)If no actionable comments remain after filtering → report "No actionable review comments found on this PR." and stop.
Find or check out the PR branch.
Prerequisites: PR metadata fetched, PR is open, actionable comments exist.
Check if a worktree exists for this PR's branch:
git worktree list --porcelain
Scan the output for a worktree whose branch matches the PR's headRefName. Also check .worktrees/ directory.
If worktree exists: Use it as the working directory for all subsequent phases.
If no worktree exists: Check out the PR branch:
gh pr checkout <number>
git pull --rebase origin <headRefName>
If the pull fails (e.g., conflicts), warn the user and ask how to proceed.
Group, evaluate, and get user approval on how to handle each comment.
Prerequisites: Working in the PR branch, actionable comments filtered.
Group comments by reviewer and thread. For each thread, capture:
Present a high-level summary to the user:
If user context was provided in $ARGUMENTS, mention it and explain how it steers your evaluation.
For each comment/thread, evaluate using these principles:
CLAUDE.md or .claude/rules/?For each comment, recommend one of:
| Action | When to use |
|---|---|
| Fix | The feedback is valid and the change should be made |
| Push back | The suggestion is incorrect, conflicts with architecture, or is YAGNI |
| Clarify | The feedback is ambiguous — need more info from the reviewer before acting |
| Acknowledge | Valid point but out of scope for this PR — defer to future work |
Sort the "Fix" items by priority:
Present the full evaluation to the user: each comment with your recommended action and reasoning.
Use AskUserQuestion to confirm the plan. Options:
If "Modify": ask which comments to change and what action to take instead, then re-present.
Only proceed to Phase 4 after the user approves.
Make code changes for all comments marked "Fix".
Prerequisites: User approved the action plan, working in the PR branch.
For each comment marked Fix, in the priority order from Phase 3:
After all individual fixes are applied, run the full build and test suite:
<build command from config or CLAUDE.md>
<test command from config or CLAUDE.md>
If the full test suite fails after all fixes:
Post replies on each review comment thread.
Prerequisites: All fixes implemented and tests passing (or user has approved proceeding despite failures).
For each comment, post a reply based on the action taken:
| Action | Reply format |
|---|---|
| Fixed | "Fixed — [brief description of what changed]" |
| Pushed back | "[Technical reasoning why the suggestion isn't appropriate]" |
| Clarify | "[Specific question for the reviewer]" |
| Acknowledge | "Noted — deferring to [ticket/future work] because [reason]" |
Tone rules (from receiving-code-review principles):
For each inline review comment:
printf '%s' '<reply text>' > /tmp/claude/pr-reply-<comment-id>.md
REPLY=$(cat /tmp/claude/pr-reply-<comment-id>.md)
gh api repos/<owner>/<repo>/pulls/<number>/comments/<comment-id>/replies -f body="$REPLY"
For general PR review comments, post as a PR comment:
printf '%s' '<reply text>' > /tmp/claude/pr-comment.md
COMMENT=$(cat /tmp/claude/pr-comment.md)
gh pr comment <number> --repo <owner>/<repo> --body "$COMMENT"
Threads are resolved by the reviewer — do not attempt to resolve them.
Commit changes, push to the PR branch, and re-request review.
Prerequisites: All fixes applied, tests passing, replies posted.
Stage and commit all changes:
git add -A
git commit -m "fix(review): address PR feedback
- <summary of changes made>"
If no files were changed (all comments were pushed back, clarified, or acknowledged), skip the commit and push steps.
git push origin <headRefName>
If the push fails (e.g., sandbox network restriction, SSH remote):
Re-request review from the reviewers who left comments:
gh pr edit <number> --repo <owner>/<repo> --add-reviewer <reviewer-login>
Run once per reviewer who left actionable comments.
Present a final summary to the user:
## Review Addressed
PR #<number>: <title>
- **Fixed**: N comments
- **Pushed back**: N comments
- **Clarified**: N comments
- **Acknowledged**: N comments
Changes committed and pushed. Review re-requested from: <reviewer list>
STOP HERE. Your job is done. Do not:
npx claudepluginhub matteobortolazzo/claude-tools --plugin ccflowReads open GitHub PR review comments, triages by severity, applies code fixes, and drafts replies. Use when addressing PR feedback or code review.
Interactively responds to PR review feedback: fetches comments, verifies findings, asks for user approval, makes changes, and posts replies. Use when addressing GitHub pull request reviews.
Walks through code review comments one at a time, triaging each with the user before making any code changes. Supports review.jsonl, GitHub PRs, documents, and conversation input.