pr-review
A Claude Code plugin that turns GitHub PR review feedback into a deliberate, step-by-step workflow: fetch and triage comments, apply fixes locally, post replies on GitHub, and extract recurring patterns into permanent coding rules.
Overview
Most PR review tools either auto-apply suggestions or just surface comments. This plugin does neither — it keeps you in control at every step:
1. Triage — fetch all review threads and classify each one (fix, skip, clarify) 2. Apply — make the code changes locally, no commit yet 3. Post — preview every reply, confirm, then post to GitHub 4. Learn — when the same mistake appears across 2+ PRs, propose a rule for CLAUDE.md
Prerequisites
- A git repository with an open GitHub PR
ghCLI installed and authenticated (gh auth status)jqinstalled
Installation
Registration and installation are one-time steps:
# Register the marketplace (local path or GitHub URL)
/plugin marketplace add ~/work/claude-plugins/pr-review-plugin
# Or from GitHub:
# /plugin marketplace add Shreeyak/pr-review-plugin
# Install (one-time)
/plugin install pr-review@pr-review --scope user
# Reload to activate
/reload-plugins
Updating
After editing plugin files, commit and run the update commands:
# In the plugin repo
git add -A && git commit -m "your change"
# In Claude Code
/plugin marketplace update pr-review
/plugin update pr-review@pr-review
/reload-plugins
For rapid iteration without the commit-update cycle, launch with a live directory reference:
claude --plugin-dir ~/work/claude-plugins/pr-review-plugin/
Usage: The PR Review Pipeline
Run these in order after automated reviewers (Copilot, CodeRabbit) comment on your PR:
# Step 1: Fetch and triage review comments → creates plan file
/pr-review:pr-review-plan
# Step 2: (Optional) Edit the plan file at .pr-review/pr-<N>-plan.md
# - Adjust triage decisions
# - Edit draft replies
# - Mark threads to skip
# Step 3: Apply fixes to your code (does not commit)
/pr-review:pr-review-apply
# Step 4: Review the diff, commit when ready
git add -A && git commit -m "address review feedback"
# Step 5: Preview replies, confirm, then post to GitHub + resolve threads
/pr-review:pr-review-post
# Step 6: (Optional) Check for recurring patterns across PRs
/pr-review:pr-review-extract-lessons
Each skill enforces ordering — apply won't run without a triaged plan, post won't run without fixed status.
Workflow Diagram
/pr-review:pr-review-plan ← fetch + triage review comments
↓
(edit plan if needed)
↓
/pr-review:pr-review-apply ← apply fixes to working tree
↓
git add . && git commit
↓
/pr-review:pr-review-post ← preview replies, confirm, post to GitHub
↓
/pr-review:pr-review-extract-lessons ← run periodically to update CLAUDE.md
Skills
/pr-review:pr-review-plan
Fetches all review comments from the current branch's PR (or a PR number you specify) and triages them into a plan file at .pr-review/pr-<N>-plan.md.
Each thread gets a classification:
| Classification | Meaning | |---|---| | apply_suggestion | Reviewer provided correct code — apply as-is | | fix | Valid feedback — needs a manual implementation | | skip_stale | Comment is outdated, no longer applies | | skip_disagree | Feedback is incorrect — skip with explanation | | skip_style | Subjective preference — not worth changing | | needs_clarification | Ambiguous — draft reply asking for more detail |
A draft reply is written for every thread. You can edit the plan file before proceeding.
/pr-review:pr-review-apply
Reads the plan file and applies all fix and apply_suggestion threads to local source files. Edits are applied bottom-up within each file to avoid line-number drift.
The skill verifies each issue still exists before touching the file. It does not commit — you review the diff and commit when ready.
/pr-review:pr-review-post
Reads the plan file and always shows a preview of every reply before touching GitHub. You must explicitly confirm before anything is posted.
On confirmation, it posts replies and resolves threads via the GitHub API. Partial failures are reported; re-run to retry.
The plan file status is updated to posted when complete.
/pr-review:pr-review-extract-lessons
Analyzes completed plan files for recurring mistake patterns. A pattern must appear in 2 separate PRs before a rule is proposed for CLAUDE.md — this prevents noise from one-off mistakes.
Candidate patterns are tracked at .claude/pr-lesson-candidates.md (in the main repo). When a pattern hits the threshold, you approve or reject the proposed rule. Only approved rules are written to CLAUDE.md.
Plan file
Plan files live at .pr-review/pr-<N>-plan.md and are automatically added to .gitignore. They are plain Markdown — edit triage decisions or draft replies before running apply or post.
Safety
The following never happen without your explicit action:
- No code is committed automatically
- No reply is posted without a preview and confirmation step
CLAUDE.mdis never modified without your approval- Each skill checks the plan file status and won't re-process work already done
Troubleshooting
| Problem | Fix | |---|---| | PR number not detected | Pass it explicitly: /pr-review:pr-review-plan 123 | | gh auth error | Run gh auth login | | Post partially failed | Fix the issue (e.g. auth, network), re-run /pr-review:pr-review-post | | Plan already in fixed state | Skip apply and go straight to /pr-review:pr-review-post | | Wrong plan file loaded | Check .pr-review/ and specify the PR number |









