skills/fix-pr-reviews/SKILL.md
Fetch and triage 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, Copilot, etc.), classifies which findings are valid versus ignorable, explains how valid findings should be fixed, and sets up a thread watcher for new PR review comments when working against a GitHub PR. Does not modify code unless the user explicitly gives approval to apply fixes. Also accepts local review files. When explicitly asked to commit and push review fixes, pushes the branch and comments "@codex review" on the PR to request a fresh review. Triggers on requests like "fix PR reviews", "fix review comments", "fix PR feedback", "apply review fixes", "fix code review findings", "check new findings", or any mention of fixing/issues from PR comments or review files.
npx skillsauth add ilamanov/skills fix-pr-reviewsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch and triage valid code review findings from PR comments and/or local review markdown files. The default first pass is analysis only: report which findings are valid, which can be ignored, and how each valid finding should be fixed. Do not edit files until the user explicitly gives a green light to apply fixes.
Important permission boundary:
When this skill is invoked together with the pr skill, the combined workflow is PR-first:
pr skill to create or update the GitHub PR before trying to fetch review findings.Do not wait for the first review findings or for approved fixes before creating the watcher in this combined workflow.
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.
Report triage and proposed fixes — Stop after the first exploration pass and output a brief summary. Include enough code references to make the triage auditable:
## Review findings triage
### Sources
- PR #<number>: <count> comments fetched, <count> review findings extracted
- <local-file>: <count> findings extracted
- Deduplicated to <total> unique findings
### Valid findings
- <file:line> — <one-line description>. Proposed fix: <specific minimal approach>. (source: <PR comment URL or file>)
### Ignored findings
- <one-line description> — <reason skipped>
### Blockers / inaccessible findings
- <source> — <what could not be fetched or verified>
End by asking for explicit approval before applying any fixes if the user has not already given it.
Only after explicit approval: fix valid issues — If the user clearly says to apply fixes, then for each approved "Valid" finding:
After approved fixes, 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>
### Verification
- <commands run and results>
Start or refresh a PR review watcher — If the run is working against a GitHub PR, set up a heartbeat automation attached to the current thread to watch that PR for new review comments. Do this immediately when this skill is used together with the pr skill, and otherwise do it after the initial PR comment triage pass or after approved fixes. Skip this for local-review-file-only runs or if no PR was found.
Use the app automation tool when available; if it is unavailable, say the watcher could not be created and include the exact manual command/check the user can run later. Prefer updating an existing watcher for the same PR over creating a duplicate.
Watcher requirements:
Watch PR #<number> review findings.Watcher state line with fetched comment/review/issue-comment IDs and timestamps it has already processed.Watcher state, and process every unseen or updated review-like comment. This must handle multiple back-to-back new comments in one run.Review findings triage format: sources, valid findings, ignored findings, blockers, and explicit approval request before fixes.fix: address PR review findings.git push. This updates the existing PR automatically.@codex review to trigger a fresh Codex review. Use gh pr comment <number> --body "@codex review" or the equivalent GitHub API. Do this only after the push succeeds; if no open PR exists, say no review trigger was posted.```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.development
Map every Codex and Claude Code session for a project to the git worktrees they ran in, in an interactive local UI. Use whenever someone wants to see, search, audit, or clean up past AI coding-agent conversations and the worktrees those ran in — e.g. "what Codex sessions ran on this repo", "list my Claude Code sessions", "which worktree was that session in", "find the chat where I refactored auth", "archive old Codex sessions", or "show every session across my worktrees". Reach for it to untangle which of many worktrees still has live agent history attached. This is about Codex and Claude Code transcript history plus git worktrees — not HTTP, login, or auth sessions, not terminal or tmux sessions, and not user-research sessions.
tools
Generally-applicable conventions for how code is written and arranged — tooling/package manager, import style, file & component naming, comments, and where files live (colocation vs. global folders). Use whenever creating, naming, moving, or importing a file, running project commands, or deciding where a new module belongs. Consult BEFORE writing the code so the conventions are baked in, not retrofitted. If a convention below matches the work, apply it — don't ask, just follow it (call out the choice in one line so the user can override).
development
Generally-applicable frontend/UI best practices. Use whenever building, modifying, or reviewing UI — adding a form/button/dialog/modal, wiring keyboard shortcuts, creating any interactive surface that submits a form, or any time TSX/JSX is being written or edited. Consult BEFORE writing the code so the patterns are baked in, not retrofitted. If a scenario described in the skill body matches the work, apply the pattern — don't ask, just follow it (call out the choice in one line so the user can override).
tools
Generally-applicable backend/data best practices. Use whenever writing or modifying backend/data code — API routes, server actions, DB writes, background jobs, agent tools, import flows, webhooks, paste handlers, or anywhere data enters the system. Consult BEFORE writing the code so the patterns are baked in, not retrofitted. If a scenario described in the skill body matches the work, apply the pattern — don't ask, just follow it (call out the choice in one line so the user can override).