Skip to content

refactor(pr-review-toolkit): simplify overlap sections and restructure report#65

Merged
cblecker merged 2 commits into
mainfrom
refactor/pr-review-simplify-overlap
Jul 3, 2026
Merged

refactor(pr-review-toolkit): simplify overlap sections and restructure report#65
cblecker merged 2 commits into
mainfrom
refactor/pr-review-simplify-overlap

Conversation

@cblecker

@cblecker cblecker commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Collapse possiblePlusOnes and partialOverlaps into a single relatedToExisting board section, simplifying the overlap status enum to none/overlaps/already_covered and the recommendation enum from 6 to 5 values
  • Remove actionPlan and coverageSummary from the board schema — heading now derives counts from section array lengths and lists full reviewer agent names from reviewMeta.selectedReviewers
  • Restructure SKILL.md report layout: heading with counts, full-detail sections with per-finding recommendation rationale, one-liner sections for already-covered/discarded, positive observations last
  • Replace the 9-command keyword interaction system with contextual AskUserQuestion options that adapt to board state (recommended findings, only overlaps, nothing postable)
  • Add thread reply posting for overlap findings via add_reply_to_pull_request_comment — uses a new numeric commentId field in THREAD_SCHEMA and BOARD_ITEM_SCHEMA to post as replies to existing threads instead of creating duplicate comments

Test plan

  • Validate plugin: claude plugin validate ./pr-review-toolkit
  • Grep for removed terms (possiblePlusOnes, partialOverlaps, possible_plus_one, partial_overlap, actionPlanForBoard, coverageSummary) — zero matches
  • Verify review-pr.js has no syntax errors: node -c pr-review-toolkit/skills/review-pr/review-pr.js
  • Run /review-pr on a PR with existing review threads to verify overlap findings route to relatedToExisting and the contextual interaction flow works
  • Run /review-pr on a clean PR (no existing threads) to verify recommended findings display correctly with the new heading format
  • Verify overlap finding drafts preview as "Reply to thread on path:line" and post via add_reply_to_pull_request_comment when approved

Summary by CodeRabbit

  • New Features

    • Updated review output categories to better distinguish items that overlap with existing discussion and items already covered.
    • Added support for replying directly in existing comment threads when posting review feedback.
  • Bug Fixes

    • Improved handling of review item placement so comments are more consistently routed to the right review section.
    • Refined validation and preview behavior before posting, making final review submission clearer.

Copilot AI review requested due to automatic review settings July 3, 2026 17:59
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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 reviews.

How do review 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 refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 745523bc-31fa-4a14-b234-1cc43eea51e0

📥 Commits

Reviewing files that changed from the base of the PR and between 07fee48 and dc16454.

📒 Files selected for processing (2)
  • pr-review-toolkit/skills/review-pr/SKILL.md
  • pr-review-toolkit/skills/review-pr/review-pr.js
📝 Walkthrough

Walkthrough

Updates the review-pr plugin's overlap classification taxonomy (replacing possiblePlusOnes/partialOverlaps with overlaps/already_covered/relatedToExisting), adds commentId-based thread reply posting, removes action-plan/coverage-summary generation, rewrites SKILL.md's git preflight and posting instructions, and bumps the manifest version.

Changes

Review Board Overlap & Posting Refactor

Layer / File(s) Summary
Manifest version and README docs
pr-review-toolkit/.claude-plugin/plugin.json, pr-review-toolkit/README.md
Bumps version to 1.8.0 and updates README's board outcome categories and validation checklist wording.
SKILL.md permissions and git preflight
pr-review-toolkit/skills/review-pr/SKILL.md
Adds reply-posting tool to allowed-tools, tightens constraints, and rewrites the local git preflight flow with fallbackReason handling, merge-ref verification, and diff manifest parsing.
SKILL.md posting flow
pr-review-toolkit/skills/review-pr/SKILL.md
Defines overlap findings as thread replies, updates line-comment vs review-body selection, review event options, preview/confirm requirements, and invalid-location remediation.
review-pr.js schema and contract updates
pr-review-toolkit/skills/review-pr/review-pr.js
Updates postability recommendation enum, thread schema with commentId, board item overlap status, board section definitions, and prompt text.
Overlap inference and routing logic
pr-review-toolkit/skills/review-pr/review-pr.js
Updates overlap mapping, ranking, thread-overlap classification, section routing, and recommendation ranking functions to the new status set with commentId propagation.
Board synthesis cleanup and prompts
pr-review-toolkit/skills/review-pr/review-pr.js
Removes action-plan/coverage-summary generation from fallback and finalized boards, and updates thread-collection and synthesizer prompts for new board sections.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • cblecker/claude-plugins#45: Both PRs modify the same review-pr.js schema and orchestration contract for board/overlap logic.
  • cblecker/claude-plugins#51: Both refactor thread-overlap matching schemas and prompt logic including commentId-style thread metadata.
  • cblecker/claude-plugins#54: Both change the same review-board contract/schemas and posting interaction rules in review-pr.js and SKILL.md.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 refactor: simplifying overlap handling and restructuring the report.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/pr-review-simplify-overlap

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.

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 refactors the pr-review-toolkit review board model and reporting flow to simplify overlap handling, streamline the board header content, and enable posting overlap findings as replies to existing review threads.

Changes:

  • Consolidates overlap sections into relatedToExisting and simplifies overlap/recommendation enums in the workflow schemas.
  • Restructures the SKILL report format and replaces the command-keyword interaction flow with contextual AskUserQuestion options.
  • Adds support (and instructions) for posting overlap findings as thread replies using a numeric commentId.

Reviewed changes

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

File Description
pr-review-toolkit/skills/review-pr/SKILL.md Updates the board presentation, interaction flow, and adds guidance for posting overlap findings as thread replies.
pr-review-toolkit/skills/review-pr/review-pr.js Updates schemas and routing to support the new overlap model (relatedToExisting) and includes commentId in thread/overlap data.
pr-review-toolkit/.claude-plugin/plugin.json Bumps plugin version to 1.8.0.

💡 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
Comment thread pr-review-toolkit/skills/review-pr/review-pr.js
Comment thread pr-review-toolkit/skills/review-pr/SKILL.md
@cblecker cblecker force-pushed the refactor/pr-review-simplify-overlap branch from e1cbfa4 to 0d82f39 Compare July 3, 2026 18:30
…e report

Collapse possiblePlusOnes/partialOverlaps into a single relatedToExisting
section, simplify overlap and recommendation enums to binary
(overlaps/already_covered), remove actionPlan and coverageSummary from the
board schema, restructure the SKILL.md report layout with per-finding
recommendation rationale, replace the 9-command keyword system with
contextual AskUserQuestion options, and add thread reply posting for
overlap findings via add_reply_to_pull_request_comment.

Assisted-by: Claude:claude-opus-4-6
Copilot AI review requested due to automatic review settings July 3, 2026 19:02
@cblecker cblecker force-pushed the refactor/pr-review-simplify-overlap branch from 0d82f39 to 07fee48 Compare July 3, 2026 19:02

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 4 out of 4 changed files in this pull request and generated no new comments.

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pr-review-toolkit/skills/review-pr/review-pr.js (1)

873-879: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve commentId when merging equal-strength overlaps.

Equal-ranked statuses always keep the left overlap, so merging two overlaps items can drop a commentId found on the right item. That breaks the downstream thread-reply path for relatedToExisting.

Proposed fix
   const leftStatus = (left && left.status) || 'none'
   const rightStatus = (right && right.status) || 'none'
   const selected = (order[rightStatus] > order[leftStatus]) ? right : left
   if (!selected) return { status: 'none', threadId: '', rationale: '' }
+  const fallback = selected === left ? right : left
 
   return {
     status: selected.status || 'none',
-    threadId: selected.threadId || '',
-    commentId: selected.commentId || undefined,
+    threadId: selected.threadId || (fallback && fallback.threadId) || '',
+    commentId: selected.commentId != null
+      ? selected.commentId
+      : fallback && fallback.commentId != null
+        ? fallback.commentId
+        : undefined,
     rationale: combineText(left && left.rationale, right && right.rationale)
   }
🤖 Prompt for 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.

In `@pr-review-toolkit/skills/review-pr/review-pr.js` around lines 873 - 879, The
overlap merge logic in review-pr.js is dropping commentId when two items have
equal-strength statuses because the tie always selects the left entry. Update
the selection/merge behavior around the selected overlap object so that, when
statuses are equal, any existing commentId from the right overlap is preserved
if the left one is missing. Keep the fix localized to the overlap resolution
path that returns status, threadId, and commentId so downstream
relatedToExisting thread replies still have the right identifier.
🤖 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/.claude-plugin/plugin.json`:
- Line 3: The plugin manifest version is too low for a breaking change; update
the version in plugin.json to a new major release because the board field
removal and posting contract change are not backward compatible. Adjust the
manifest’s version field to the next major version so it clearly signals the
compatibility break.

In `@pr-review-toolkit/skills/review-pr/review-pr.js`:
- Around line 776-779: The overlap handling in overlapFromFinding() and
inferThreadOverlap() is short-circuiting recommendation-only overlaps before
thread-matching can run, so reply-capable findings can miss their existing
thread context. Update inferThreadOverlap() to keep processing when overlap
status is overlaps but threadId/commentId are still missing, and let the
matching logic infer a target thread before returning. Make sure the overlap
object construction around overlapFromFinding(), status handling, and the
related checks in inferThreadOverlap() and nearby overlap resolution paths still
preserve existing non-empty threadId/commentId when present.

---

Outside diff comments:
In `@pr-review-toolkit/skills/review-pr/review-pr.js`:
- Around line 873-879: The overlap merge logic in review-pr.js is dropping
commentId when two items have equal-strength statuses because the tie always
selects the left entry. Update the selection/merge behavior around the selected
overlap object so that, when statuses are equal, any existing commentId from the
right overlap is preserved if the left one is missing. Keep the fix localized to
the overlap resolution path that returns status, threadId, and commentId so
downstream relatedToExisting thread replies still have the right identifier.
🪄 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: 42a45c87-caa4-42ab-8338-c6830522158f

📥 Commits

Reviewing files that changed from the base of the PR and between b5a8b05 and 07fee48.

📒 Files selected for processing (4)
  • pr-review-toolkit/.claude-plugin/plugin.json
  • pr-review-toolkit/README.md
  • pr-review-toolkit/skills/review-pr/SKILL.md
  • pr-review-toolkit/skills/review-pr/review-pr.js

Comment thread pr-review-toolkit/.claude-plugin/plugin.json
Comment thread pr-review-toolkit/skills/review-pr/review-pr.js
…rning

Tighten prose across all sections to bring estimated token count under
the 3,000-token skillsaw warn threshold (~3,379 → ~2,450). Preserves
all behavioral instructions including ad-hoc script prohibition and
allowed-tools constraints.

Assisted-by: Claude:claude-opus-4-6
@cblecker cblecker force-pushed the refactor/pr-review-simplify-overlap branch from 07fee48 to dc16454 Compare July 3, 2026 19:11
@cblecker cblecker enabled auto-merge July 3, 2026 19:11
@cblecker cblecker merged commit 39a04cc into main Jul 3, 2026
13 checks passed
@cblecker cblecker deleted the refactor/pr-review-simplify-overlap branch July 3, 2026 19:12
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