/rp1-dev:pr-reviewfrom rp1-dev
Intent-aware map-reduce PR review with CI/CD support, confidence gating, and intelligent comment deduplication. Automates code review with phased analysis and comment posting.
Ships in rp1-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
§ROLE: Map-reduce PR review orchestrator. 6 phases, local + CI modes, comment deduplication.
§CTX: Use the pre-resolved projectRoot, kbRoot, and workRoot values from the generated Workflow Bootstrap section. Do not hardcode .rp1/work/ or .rp1/context/ paths.
§GUARDRAILS
.rp1/work/ or anywhere inside the target project's .rp1/ directory.| File | Purpose | When to Load |
|---|---|---|
references/link-artifacts.md | Reusable external link artifact registration pattern and PR review binding | During finalization phase (after P4 reporting) |
references/analysis-phases.md | P0.5 visual gen, P1 splitting, P2 analysis, P3 synthesis, P4 reporting, P5 comment posting | After P0 resolves target and intent |
stateDiagram-v2
[*] --> reviewing
reviewing --> posting : analysis_complete
posting --> [*] : done
On each phase transition, report via:
rp1 agent-tools emit \
--workflow pr-review \
--type status_change \
--run-id {RUN_ID} \
--step {CURRENT_STATE} \
--data '{"status": "running"}'
RUN_ID comes from the generated Workflow Bootstrap sectionRUN_NAME from the resolved PR context: use "PR #{pr_number}" when a PR number is available, otherwise use "PR: {branch_name}" as fallback--name "{RUN_NAME}" to label the runOn session start, emit the status change:
rp1 agent-tools emit \
--workflow pr-review \
--type status_change \
--run-id {RUN_ID} \
--name "{RUN_NAME}" \
--step reviewing \
--data '{"status": "running"}'
State Progression Protocol:
--step with --data '{"status": "running"}' when you enter that state→ [*] transitions): report with --data '{"status": "completed"}' and --close-run when the step's work finishesState mapping:
reviewing covers: P-1 (config), P0 (input resolution), P0.5 (visual gen), P1 (splitting), P2 (sub-reviewers), P3 (synthesis)posting covers: P4 (reporting), P5 (comment posting)Example sequence:
--workflow pr-review --step reviewing --name "PR #42" --data '{"status": "running"}' # first emit includes --name
--workflow pr-review --step posting --data '{"status": "running"}' # analysis done, entering posting phase
--workflow pr-review --step posting --data '{"status": "completed"}' --close-run # posting done, workflow complete
§ARCH
P-1 (seq): Config Load -> CI Detection -> Early Exit Check
P0 (seq): Input Resolution -> Intent Model
P0.5 (bg): Visual Gen (conditional, parallel w/ P1)
P1 (seq): Splitter -> ReviewUnit[]
P2 (par): N x Sub-Reviewers -> Findings + Summaries
P3 (seq): Synthesizer -> Cross-File Issues + Judgment
P4 (seq): Reporter -> Markdown Report + Structured Data
P5 (seq): Comment Posting (CI only) -> GitHub Review
§PROC
Execute immediately. No approval prompts.
Load config: Read {projectRoot}/.rp1/config/pr-review.yaml if exists:
enabled: boolean # default: false
review_drafts: boolean # default: true
ai_harness: string # "claude-code" | "opencode", default: "claude-code"
add_comments: boolean # default: true
collapse_summary: boolean # default: false
verdict: string # "approve" | "request_changes" | "comment" | "auto", default: "auto"
max_comments: integer # default: 25
bot_marker: string # default: "<!-- rp1-review -->"
visualize: boolean # default: true
ci_platform: string # "github" | "buildkite" | "gitlab", default: "github"
Missing file -> use defaults.
Detect CI: CI=true env -> CI_MODE=true, else CI_MODE=false
Platform: CI_PLATFORM = config.ci_platform (default: github)
Env overrides:
| Env Var | Overrides |
|---|---|
| RP1_PR_REVIEW_ENABLED | enabled |
| RP1_PR_REVIEW_VERDICT | verdict |
| RP1_PR_REVIEW_ADD_COMMENTS | add_comments |
| RP1_PR_REVIEW_VISUALIZE | visualize |
Early exit (CI only):
if CI_MODE AND NOT config.enabled -> Output config instructions, EXIT
Build CI_CONTEXT (GitHub only):
GITHUB_EVENT_PATH -> pr_number, action, is_draftGITHUB_REPOSITORY -> owner, repoGITHUB_TOKEN, GITHUB_HEAD_REF, GITHUB_BASE_REFStore: {"pr_number": N, "owner": "...", "repo": "...", "token": "...", "head_ref": "...", "base_ref": "...", "is_draft": false}
Draft check (CI only):
if CI_MODE AND CI_CONTEXT.is_draft AND NOT config.review_drafts -> Skip, EXIT
Skip if CI_MODE=true.
git status --porcelainrp1 agent-tools emit \
--workflow pr-review \
--type waiting_for_user \
--run-id {RUN_ID} \
--step reviewing \
--data '{"prompt": "Stash local changes and continue, or abort the review?", "context": "PR review needs a clean local git worktree before analysis"}'
{% ask_user "Stash and continue?", options: "Stash and continue", "Abort" %}git stash push -m "rp1-pr-review-auto-stash", set STASHED=true
Abort:
rp1 agent-tools emit end-run \
--run-id {RUN_ID} \
--outcome cancelled \
--reason "User aborted review instead of stashing local changes"
Exit "Review cancelled."pr_branch, base_branch (BASE_BRANCH if provided), pr_numbergh pr view {{pr_number}} --json title,body,url 2>/dev/null -> PR_METADATAREVIEWED_PR_URL = PR_METADATA.url when present, else REVIEWED_PR_URL=""problem_statement, body -> expected_changes, acceptance_criteria
Parse fails -> mode="ci_minimal", problem_statement="Review PR #{{pr_number}}"; keep REVIEWED_PR_URL if url was parsedSet REVIEWED_PR_URL=""
Resolve target:
| Input | Detection | Resolution |
|---|---|---|
| Empty | No TARGET | git branch --show-current |
| PR# | Numeric | gh pr view {{target}} --json headRefName,baseRefName,title,body,url and set REVIEWED_PR_URL from url when present |
| PR URL | /pull/ | Extract #, fetch above and set REVIEWED_PR_URL from url when present |
| Branch | Non-numeric | Use directly |
gh pr view {{branch}} --json title,body,headRefName,baseRefName,url 2>/dev/null
REVIEWED_PR_URL from url when presentREVIEWED_PR_URL="" and continue in branch-only or git-only mode3a. Get repo URL: gh repo view --json url --jq '.url' 2>/dev/null -> GITHUB_URL (empty if fails)
Build Intent Model:
full): title -> problem_statement, parse body, fetch linked issuesuser_provided): use descriptionbranch_only): problem_statement="Review changes on {{branch}}"Add: git log {{base}}..{{branch}} --oneline --no-decorate -> commit_summaries
Base: PR metadata > BASE_BRANCH > 'main'
Intent Model: {"mode": "...", "problem_statement": "", "expected_changes": "", "should_not_change": "", "acceptance_criteria": [], "commit_summaries": []}
Read references/analysis-phases.md and follow it. It carries conditional visual generation, splitting, detailed analysis, synthesis, reporting, and CI comment posting.
After markdown report registration and CI comment posting (or skip), register the reviewed PR URL as an external link artifact. Read references/link-artifacts.md for the full reusable pattern and PR review binding.
Skip when REVIEWED_PR_URL is empty. If registration fails, warn and continue.
If STASHED=true: git stash pop
CI Mode:
{{EMOJI}} PR Review Complete (CI Mode)
Judgment: {{JUDGMENT}}
{{RATIONALE}}
Findings: Critical={{critical}}, High={{high}}, Medium={{medium}}, Low={{low}}
{{IF REVIEWED_PR_URL}}Reviewed PR: {{REVIEWED_PR_URL}}{{/IF}}
GitHub Review: {{REVIEW_URL}}
Comments Posted: {{COMMENTS_POSTED}}
Duplicates Skipped: {{dedup_output.duplicates_skipped}}
Reactions Added: {{REACTIONS_ADDED}}
{{IF POSTING_ERRORS}}Errors: {{POSTING_ERRORS}}{{/IF}}
Local Report: {{REPORT_PATH}}
Local Mode:
{{EMOJI}} PR Review Complete
Judgment: {{JUDGMENT}}
{{RATIONALE}}
Findings: Critical={{critical}}, High={{high}}, Medium={{medium}}, Low={{low}}
{{IF REVIEWED_PR_URL}}Reviewed PR: {{REVIEWED_PR_URL}}{{/IF}}
Report: {{REPORT_PATH}}
{{IF STASHED}}Restored stashed changes{{/IF}}
Emoji: approve->check, request_changes->warning, block->stop
§ERR
| Error | Action |
|---|---|
| CI not enabled | Exit w/ config instructions |
| Draft PR skipped | Exit w/ message |
| Dirty git (local) | Prompt stash/abort |
| Unknown branch | Ask user (local) or fail (CI) |
| gh unavailable | git-only mode |
| Visual fails | Continue w/o (non-blocking) |
| Splitter fails | Abort w/ error |
| >50% reviewers fail | Abort |
| Synthesizer fails | Findings-only judgment |
| Reporter fails | Inline output |
| fetch-comments fails | Skip P5, warn |
| Deduplicator fails | Post all (no dedup) |
| Poster fails | Output error, report still generated |
§OUT
<thinking> tagsWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (rp1-run/rp1) — no native marketplace selected
npx claudepluginhub p/rp1-run-rp1-dev-plugins-dev-224 skills in this plugin
/address-pr-feedbackUnified PR feedback workflow - collect, triage, and fix review comments in a single command./arcade-collabStructured guidance for agents to read, classify, and act on user feedback (annotations and direct file edits) from the Arcade./blueprintGuided parent-owned project charter and PRD interviews with durable artifact-only resume./blueprint-archiveArchives a completed PRD to the archives directory with associated features and closure summary./blueprint-auditAudits a PRD against implementation status and guides lifecycle decisions./bootstrapBootstrap a greenfield project with parent-owned interviews and bounded plan, revision, and apply actions.2 plugins in one repository ship this exact skill · first indexed Aug 16, 2026
Other plugins' skills for the same job