Skip to content

Rewrite pr-review-toolkit review workflow - #54

Merged
cblecker merged 10 commits into
mainfrom
pr-review-toolkit-workflow-rewrite-docs
Jun 24, 2026
Merged

Rewrite pr-review-toolkit review workflow#54
cblecker merged 10 commits into
mainfrom
pr-review-toolkit-workflow-rewrite-docs

Conversation

@cblecker

@cblecker cblecker commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rewrite the review-pr skill workflow script with enriched candidate findings, strengthened review board synthesis, organized reviewer registry, and improved interaction patterns
  • Add validation for required config args, logging for empty reviewer findings, and dedup key improvements for robustness
  • Document the workflow rewrite plan, capability spike results, and PR review requirements

Test plan

  • Run /review against a test PR and verify the full workflow executes end-to-end
  • Confirm reviewer agents produce structured findings with enriched context
  • Verify the review board synthesis produces a coherent summary
  • Validate plugin with claude plugin validate ./pr-review-toolkit

Summary by CodeRabbit

  • New Features

    • Introduced a new review-board experience for PR reviews, with grouped findings, coverage summaries, and an action plan.
    • Added an interactive flow to draft, preview, challenge, and approve review comments before posting.
    • Improved support for large and complex PRs with clearer review outcomes and overlap handling.
  • Documentation

    • Expanded guidance on how the review workflow operates, including usage, permissions, validation, and review expectations.
    • Added detailed requirements and planning docs to clarify the end-to-end review process.

Copilot AI review requested due to automatic review settings June 24, 2026 15:34
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cblecker, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 32 minutes and 18 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 84b3bc9e-241a-478d-9052-2a860ebefc30

📥 Commits

Reviewing files that changed from the base of the PR and between 0e87df8 and 5b9228b.

📒 Files selected for processing (8)
  • README.md
  • pr-review-toolkit/.claude-plugin/plugin.json
  • pr-review-toolkit/README.md
  • pr-review-toolkit/docs/PR_REVIEW_REQUIREMENTS.md
  • pr-review-toolkit/docs/WORKFLOW_REWRITE_CONTEXT.md
  • pr-review-toolkit/docs/WORKFLOW_REWRITE_PLAN.md
  • pr-review-toolkit/skills/review-pr/SKILL.md
  • pr-review-toolkit/skills/review-pr/review-pr.js
📝 Walkthrough

Walkthrough

The pr-review-toolkit plugin is rewritten from a parallel-agents/findings model to a shared-context Collect/Analyze/Synthesize workflow that produces a structured review board. review-pr.js gains new JSON schemas, synthesis algorithms, a specialist reviewer registry, and a three-phase orchestration engine. SKILL.md is rewritten with a board-first drafting and posting contract. Three new documentation files capture requirements, design context, and a detailed rewrite plan.

Changes

PR Review Toolkit Rewrite

Layer / File(s) Summary
Plugin metadata, README, and design documentation
README.md, pr-review-toolkit/.claude-plugin/plugin.json, pr-review-toolkit/README.md, pr-review-toolkit/docs/PR_REVIEW_REQUIREMENTS.md, pr-review-toolkit/docs/WORKFLOW_REWRITE_CONTEXT.md, pr-review-toolkit/docs/WORKFLOW_REWRITE_PLAN.md
Bumps plugin version to 1.5.0 and updates descriptions to "review board using shared workflow context." Expands pr-review-toolkit/README.md with Review Flow, Review Board, MCP Permissions, and Validation sections. Adds three new docs: enduring requirements/principles, rewrite context (pain points, constraints, design decisions), and a full rewrite plan with data models, migration steps, validation matrix, and capability-spike results.
Output schemas: FINDING, THREAD, BOARD_ITEM, REVIEW_BOARD
pr-review-toolkit/skills/review-pr/review-pr.js
Updates meta.phases to ['Collect','Analyze','Synthesize']. Replaces the prior finding shape with a richer FINDING_SCHEMA (structured location, expanded evidence, postability object). Updates THREAD_SCHEMA required fields. Introduces BOARD_ITEM_SCHEMA and REVIEW_BOARD_SCHEMA with outcome buckets, actionPlan, and coverageSummary. Adds JSON-string args parsing and required-input validation.
Specialist reviewer registry and synthesis utilities
pr-review-toolkit/skills/review-pr/review-pr.js
Adds REVIEWER_PROMPTS and the REVIEWERS registry mapping lens identifiers to prompts and model/effort options. Adds utility helpers and implements synthesis algorithms: token-based overlap scoring, overlap inference against existing threads, board-section routing, item merging, and action-plan ordering. Adds file-path categorization, signal computation, PR normalization, file-page merging, summary construction, reviewer selection, and boardItemFromFinding fallback helpers.
Board finalization and Collect/Analyze/Synthesize orchestration
pr-review-toolkit/skills/review-pr/review-pr.js
Implements finalizeBoard (required sections, normalized overlap/sorting, sequential IDs, attaching pr/summary/reviewMeta). Replaces the prior verify/contextualize execution flow with: Collect (PR metadata, paginated file pages, review threads via read-only MCP), Analyze (parallel specialist agents aggregating findings), and Synthesize (synthesis agent producing board, finalized via finalizeBoard).
SKILL.md: board-first interaction and posting contract
pr-review-toolkit/skills/review-pr/SKILL.md
Restricts allowed-tools and marks workflow/agents as analysis-only. Replaces Phase 1/2 metadata collection with a Workflow tool call returning a review-board contract. Replaces severity-section presentation with a fixed-order board grouped by outcome. Changes user interaction to free-text commands on board IDs. Adds "Draft Selected Comments" (conversation-only), "Preview And Confirm" (exact preview + re-approval), and "Post Approved Review" with line-comment vs review-body branching and invalid-location recovery.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant Skill as review-pr skill
  participant Workflow as Workflow (review-pr.js)
  participant MCP as GitHub MCP read tools
  participant Specialists as Specialist agents
  participant SynthAgent as Synthesis agent
  participant GitHubWrite as GitHub MCP write tools

  User->>Skill: /pr-review-toolkit:review-pr pr-url
  Skill->>Workflow: invoke(owner, repo, pullNumber)

  rect rgba(70, 130, 180, 0.5)
    note over Workflow,MCP: Collect phase (read-only)
    Workflow->>MCP: get PR metadata
    Workflow->>MCP: get paginated changed-file pages
    Workflow->>MCP: get review threads
  end

  rect rgba(100, 160, 100, 0.5)
    note over Workflow,Specialists: Analyze phase (parallel)
    Workflow->>Specialists: run selected lens agents with shared PrContext
    Specialists-->>Workflow: findings + positiveObservations
  end

  rect rgba(160, 100, 160, 0.5)
    note over Workflow,SynthAgent: Synthesize phase
    Workflow->>SynthAgent: aggregate findings → REVIEW_BOARD_SCHEMA
    SynthAgent-->>Workflow: raw review board
    Workflow->>Workflow: finalizeBoard()
  end

  Workflow-->>Skill: structured review board
  Skill->>User: Present Review Board (grouped by outcome)
  User->>Skill: select findings / challenge / draft
  Skill->>User: Draft + Preview (no write tools)
  User->>Skill: approve exact preview
  Skill->>GitHubWrite: create pending review, add line comments, submit
  GitHubWrite-->>Skill: review posted
  Skill->>User: confirmation
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • cblecker/claude-plugins#45: Implements the earlier multi-agent workflow orchestration in review-pr.js that this PR replaces with the Collect/Analyze/Synthesize pipeline.
  • cblecker/claude-plugins#51: Adds the Contextualize phase classifying findings as new/duplicate/partial_overlap against existing threads — the logic this PR supersedes with synthesis-time overlap inference in the review board.
  • cblecker/claude-plugins#52: Modifies review-pr.js phases, finding verification, and presentation contract that this PR fully rewrites into the board-based output shape.

Poem

🐇 A board of findings, grouped just right,
Collect, Analyze, Synthesize the night!
No more parallel agents running free —
Shared context flows for you and me.
Draft first, preview, then post with care,
A rabbit-approved review, beyond compare! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: a rewrite of the pr-review-toolkit review workflow.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr-review-toolkit-workflow-rewrite-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

cblecker added 9 commits June 24, 2026 08:35
Capture durable review principles, implementation plan, and context for reworking the PR review toolkit around a Workflow-backed comprehensive review model.

Assisted-by: Codex:gpt-5
Add Workflow runtime findings from empirical testing against a 509-file
PR. Key discoveries: args arrive as JSON strings requiring parsing, and
structured-output response size (not workflow variable capacity) is the
bottleneck for large file collection — requiring workflow-level
pagination for the rewrite's collection phase.

Assisted-by: Claude:claude-opus-4-6
Assisted-by: Codex:gpt-5
Assisted-by: Codex:gpt-5
Assisted-by: Codex:gpt-5
Assisted-by: Codex:gpt-5
Validate required config args before workflow execution, log when
reviewer agents produce no findings, widen dedup key to reduce
collision risk, clarify intentional schema extension, and remove
misleading ID instruction from synthesizer prompt.

Assisted-by: Claude:claude-opus-4-6

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pr-review-toolkit/README.md`:
- Line 76: The README link text uses the lowercase product name for the GitHub
plugin, which should be branded consistently. Update the sentence in the
documentation to use GitHub with the proper capitalization, keeping the existing
link target and surrounding wording unchanged.

In `@pr-review-toolkit/skills/review-pr/review-pr.js`:
- Around line 1403-1416: The selected reviewer loop in review-pr.js only warns
when result is missing, but an empty findings array is also a diagnostic “empty
findings” case that currently disappears. Update the selected.forEach handling
to detect when result.findings is an empty array and emit a log message for that
case as well, alongside the existing no-result warning, using the same selected
name and REVIEWERS[name] context so the empty-reviewer path is visible in
diagnostics.
- Around line 729-736: The candidateLocation function is coercing invalid or
non-numeric finding.line values to 0, which creates bad GitHub locations and
affects overlap handling. Update candidateLocation so it only sets location.line
when rawLocation.line or finding.line can be parsed into a valid number, and
leave it unset when parsing fails. Keep the behavior localized to
candidateLocation and preserve the existing path resolution logic.
- Around line 1028-1040: The actionPlanForBoard() summary is incorrectly
flattening discussionOnly findings into the suggestions bucket, which can hide
critical and important items. Update the bucket construction so discussionOnly
entries are grouped by each item’s own severity alongside the other actionable
findings, while keeping suggestions limited to true suggestion-level items.
Preserve the existing severity ordering and use actionPlanForBoard() and its
critical/important/suggestions fields as the main place to adjust the
classification logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 35cba42b-07d3-4bc8-b4f7-a1c4d0fb5cac

📥 Commits

Reviewing files that changed from the base of the PR and between 41c517d and 0e87df8.

📒 Files selected for processing (8)
  • README.md
  • pr-review-toolkit/.claude-plugin/plugin.json
  • pr-review-toolkit/README.md
  • pr-review-toolkit/docs/PR_REVIEW_REQUIREMENTS.md
  • pr-review-toolkit/docs/WORKFLOW_REWRITE_CONTEXT.md
  • pr-review-toolkit/docs/WORKFLOW_REWRITE_PLAN.md
  • pr-review-toolkit/skills/review-pr/SKILL.md
  • pr-review-toolkit/skills/review-pr/review-pr.js

Comment thread pr-review-toolkit/README.md
Comment thread pr-review-toolkit/skills/review-pr/review-pr.js
Comment thread pr-review-toolkit/skills/review-pr/review-pr.js
Comment thread pr-review-toolkit/skills/review-pr/review-pr.js

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rewrites the pr-review-toolkit plugin's review-pr workflow from a parallel-agents/scored-findings pipeline into a shared-context "review board" model. The workflow now owns PR collection (metadata, paginated changed files, review threads), runs specialist reviewer lenses against one shared PrContext, and synthesizes findings into outcome-grouped buckets (recommendedToPost, possiblePlusOnes, partialOverlaps, discussionOnly, alreadyCovered, discarded). The skill conversation then presents the board, supports interactive selection/drafting, and posts only after explicit approval. The change removes the previous per-finding verifier and resolved-thread verifier phases, drops the git/Bash-based local-diff path, and adds extensive design documentation.

Changes:

  • Replaced the finding/verify/contextualize pipeline in review-pr.js with collect → analyze → synthesize phases, new schemas, a reviewer registry, dedup/merge/routing helpers, args validation, and empty-finding logging.
  • Rewrote SKILL.md around launching the analysis workflow, presenting the board, free-text interaction, drafting, preview, and approved posting; trimmed allowed-tools (removed git Bash, added AskUserQuestion).
  • Added three planning/requirements/context docs and refreshed both READMEs and plugin.json (1.4.0 → 1.5.0).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pr-review-toolkit/skills/review-pr/review-pr.js Core rewrite: new phases, schemas, reviewer registry, manifest/thread context, board synthesis & normalization helpers.
pr-review-toolkit/skills/review-pr/SKILL.md New skill flow: launch workflow, present board, interact, draft, preview, post; updated tool allowlist and return shape.
pr-review-toolkit/README.md Documents review flow, board outcomes, interaction/posting, MCP permissions, and validation guidance.
pr-review-toolkit/docs/WORKFLOW_REWRITE_PLAN.md New implementation plan, data models, migration phases, and capability-spike results.
pr-review-toolkit/docs/WORKFLOW_REWRITE_CONTEXT.md New background/context for the rewrite.
pr-review-toolkit/docs/PR_REVIEW_REQUIREMENTS.md New enduring requirements/principles document.
pr-review-toolkit/.claude-plugin/plugin.json Version bump to 1.5.0 and updated description.
README.md Updated marketplace table description for the plugin.

Key points raised in line comments: a paginated collector page size of 100 that conflicts with the spike's observed ~17-entry structured-output cap (possible silent manifest truncation on large PRs), a thread-overlap heuristic where the same-line proximity bonus can force unrelated findings into the overlap buckets, and a now-stale "setup section" reference in the embedded code-reviewer prompt.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pr-review-toolkit/skills/review-pr/review-pr.js Outdated
Comment thread pr-review-toolkit/skills/review-pr/review-pr.js Outdated
Comment thread pr-review-toolkit/skills/review-pr/review-pr.js
Keep invalid finding line values out of board locations, preserve discussion-only findings in severity action-plan buckets, and log empty reviewer findings as diagnostics.

Assisted-By: Codex:gpt-5
@cblecker
cblecker force-pushed the pr-review-toolkit-workflow-rewrite-docs branch from 0e87df8 to 5b9228b Compare June 24, 2026 16:02
@cblecker
cblecker requested a review from Copilot June 24, 2026 16:03
@cblecker
cblecker merged commit 18df456 into main Jun 24, 2026
12 checks passed
@cblecker
cblecker deleted the pr-review-toolkit-workflow-rewrite-docs branch June 24, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

let duplicateCount = 0
let partialOverlapCount = 0
let newCount = 0
const pr = normalizePr(prResult)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants