Automatically fetch and fix valid code review findings from PR comments and/or review markdown files. Pulls review comments from the current branch's open PR (GitHub review comments, inline suggestions, and general comments that look like code reviews — from Claude Code, Codex, and other AI or human reviewers), triages them, and fixes the valid ones. Also accepts local review markdown files. Triggers on requests like "fix PR reviews", "fix review comments", "fix PR feedback", "apply review fixes", "fix code review findings", or any mention of fixing issues from PR comments or review files.
Automatically fetch and fix valid code review findings from PR comments and/or local review markdown files.
This skill pulls findings from two sources (either or both):
PR comments (automatic) — Fetched from the open PR for the current branch via gh. Includes:
Local review files (if provided) — Markdown files the user passes explicitly (e.g., review1.md, review2.md). Accept any number of files in any format (structured or free-form).
Determine the PR — Run gh pr list --head <current-branch> --json number,url --jq '.[0]' to find the open PR for the current branch. If no PR exists and no local files are provided, inform the user and stop.
Fetch PR comments — If a PR exists, fetch all review data:
# Get PR review comments (inline code comments)
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments --paginate
# Get PR reviews (top-level review bodies)
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews --paginate
# Get general issue comments on the PR
gh api repos/{owner}/{repo}/issues/{pr_number}/comments --paginate
Filter for review content — From the fetched comments, keep only those that look like code reviews. Include a comment if it matches ANY of:
src/foo.ts, components/bar.tsx)```suggestion)Exclude comments that are clearly non-review (e.g., "LGTM", "thanks!", merge coordination, CI status discussions).
Collect local review files — If the user provided review files, read them too.
Build a unified issue list — Extract every distinct finding across PR comments and local files. Deduplicate: if multiple sources flag the same issue (same file + same concern), merge them into one entry. Preserve the strongest/clearest description. Track the source of each finding (PR comment URL or local file name).
Triage each finding — Classify every finding into one of:
When in doubt, lean toward skipping. The goal is to fix real bugs, not gold-plate the code.
Fix valid issues — For each "Fix" finding:
Report summary — After all fixes, output a brief summary:
## Review fixes applied
### Sources
- PR #<number>: <count> comments fetched, <count> review findings extracted
- <local-file>: <count> findings extracted
- Deduplicated to <total> unique findings
### Fixed
- <file:line> — <one-line description> (source: <PR comment URL or file>)
### Skipped (not valid / nit / overly defensive)
- <one-line description> — <reason skipped>
Commit and push — After all fixes are applied:
git add the specific files that were modified.fix: address PR review findings followed by a short list of what was fixed.git push. This updates the existing PR automatically.git pull --rebase) then push again.```suggestion), use the suggested code directly.gh is not authenticated or the repo has no remote, fall back to local review files only and inform the user.