Skip to content

refactor(cli): Use multi-agent parallel review in pr-review command#1286

Merged
yamadashy merged 3 commits intomainfrom
chore/improve-pr-review-command
Mar 21, 2026
Merged

refactor(cli): Use multi-agent parallel review in pr-review command#1286
yamadashy merged 3 commits intomainfrom
chore/improve-pr-review-command

Conversation

@yamadashy
Copy link
Copy Markdown
Owner

@yamadashy yamadashy commented Mar 21, 2026

Replace single-agent review with 6 specialized parallel agents, aligned with the review-loop command (#1285):

  1. Code quality — Bugs, logic errors, edge cases, code smells
  2. Security — Vulnerabilities, injection risks, secret exposure
  3. Performance — Inefficiencies, resource leaks, unnecessary allocations
  4. Test coverage — Missing tests, untested edge cases, test quality
  5. Conventions — Project conventions (.agents/rules/base.md), naming, structure
  6. Holistic review — Overall design, side effects, integration risks

Also adds double-filter pattern: each agent reports only noteworthy findings, then the main agent re-filters before posting.

AI Bot inline comment evaluation and commenting sections are unchanged.

Checklist

  • Run npm run test
  • Run npm run lint

Open with Devin

Replace single-agent review with 6 specialized parallel agents:
code quality, security, performance, test coverage, conventions,
and holistic review. Add double-filter pattern where each agent
reports only noteworthy findings and the main agent re-filters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the pr-review command to transition from a single-agent review process to a more robust multi-agent parallel review system. This change aims to significantly enhance the depth and breadth of code analysis by leveraging specialized agents for different aspects of code quality, security, performance, and more, ultimately leading to more thorough and insightful pull request feedback.

Highlights

  • Multi-agent parallel review: The pr-review command has been refactored to utilize 6 specialized parallel agents for comprehensive code analysis, aligning with the review-loop command.
  • Specialized Agent Roles: Each agent is assigned a specific focus area: Code quality, Security, Performance, Test coverage, Conventions, and Holistic review, ensuring a thorough examination from various perspectives.
  • Double-filter pattern: A new double-filter mechanism has been implemented where individual agents report only noteworthy findings, which are then re-filtered by a main agent before being presented.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 21, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2f88de89-7049-4d2a-bbc8-7dc2d0cbd62b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR review command guidance was updated from a single maintainer-style checklist to an orchestrated multi-agent review workflow where six parallel agents provide distinct review perspectives, with consolidated noteworthy findings.

Changes

Cohort / File(s) Summary
PR Review Guidance
.agents/commands/git/pr-review.md
Changed review approach from single maintainer checklist to multi-agent orchestration with six parallel agents covering code quality, security, performance, test coverage, conventions, and holistic perspectives.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring the pr-review command to use multi-agent parallel review instead of a single-agent approach.
Description check ✅ Passed The description is comprehensive, covering the purpose, all six agent specializations, the double-filter pattern, and unchanged sections. However, it includes unrelated elements (Devin review badge) and the required checklist items lack substantive detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 chore/improve-pr-review-command

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 and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 21, 2026

⚡ Performance Benchmark

Latest commit:d3aa21b
Status:✅ Benchmark complete!
Ubuntu:2.50s (±0.01s) → 2.50s (±0.02s) · -0.00s (-0.1%)
macOS:1.40s (±0.23s) → 1.31s (±0.05s) · -0.09s (-6.5%)
Windows:2.99s (±0.12s) → 2.95s (±0.09s) · -0.04s (-1.4%)
Details
  • Packing the repomix repository with node bin/repomix.cjs
  • Warmup: 2 runs (discarded)
  • Measurement: 10 runs / 20 on macOS (median ± IQR)
  • Workflow run

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the pr-review command to use a multi-agent parallel review process. The changes in .agents/commands/git/pr-review.md update the agent's instructions to spawn six specialized agents. My review focuses on ensuring that important context and instructions from the previous single-agent prompt are not lost in this transition. I've suggested two improvements to the agent prompts to retain references to crucial convention documents and to preserve the valuable 'premortem analysis' task.

- **Agent 2 — Security**: Vulnerabilities, injection risks, secret exposure, unsafe patterns
- **Agent 3 — Performance**: Inefficiencies, resource leaks, unnecessary allocations
- **Agent 4 — Test coverage**: Missing tests, untested edge cases, test quality
- **Agent 5 — Conventions**: Project conventions (.agents/rules/base.md), naming, structure
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The reference to CLAUDE.md for style and conventions has been removed. The CLAUDE.md file contains core project guidelines and is marked as alwaysApply: true. To ensure the conventions agent has full context, consider explicitly mentioning CLAUDE.md in its instructions, as it was in the previous version of the prompt.

Suggested change
- **Agent 5 — Conventions**: Project conventions (.agents/rules/base.md), naming, structure
- **Agent 5 — Conventions**: Project conventions (from CLAUDE.md and .agents/rules/base.md), naming, structure

- **Agent 3 — Performance**: Inefficiencies, resource leaks, unnecessary allocations
- **Agent 4 — Test coverage**: Missing tests, untested edge cases, test quality
- **Agent 5 — Conventions**: Project conventions (.agents/rules/base.md), naming, structure
- **Agent 6 — Holistic review**: Overall design concerns, side effects of changes, integration risks that individual agents may miss
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The previous prompt included a valuable instruction to 'Perform a premortem analysis'. While the new 'Holistic review' agent's scope is related, explicitly retaining the 'premortem analysis' instruction would better guide the agent to consider a broader range of potential failures, such as deployment risks. This ensures that this important aspect of the review is not lost.

Suggested change
- **Agent 6 — Holistic review**: Overall design concerns, side effects of changes, integration risks that individual agents may miss
- **Agent 6 — Holistic review**: Perform a premortem analysis. Look for overall design concerns, side effects, integration risks, and deployment risks that individual agents may miss.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 21, 2026

Review — PR #1286

Reviewed by 6 parallel agents (code quality, security, performance, test coverage, conventions, holistic). Here's the consolidated feedback.

Overall: Clean, well-structured change. No blocking issues. The multi-agent parallel review approach aligns well with the existing review-loop command and the double-filter pattern is a good addition.

Suggestions (non-blocking)

1. Consider structured triage instead of "noteworthy" — the review-loop command does this better

The review-loop.md command uses an explicit "Fix vs Skip" taxonomy with a summary table, while this command relies on the vague "noteworthy" criterion for both filter passes. Adopting the same structured triage would make the double-filter pattern more consistent and effective across commands.

2. Minor: commit scope cli vs agents

The changed file lives in .agents/commands/git/, not src/cli/. A scope like agents would more precisely reflect what was changed. Very minor nit — not worth a force-push.

Verified non-issues

  • Premortem analysis removal: The old premortem responsibilities (failure scenarios, edge cases, deployment risks, mitigations) are distributed across the new agents — Agent 1 covers edge cases, Agent 2 security scenarios, Agent 3 resource leaks, Agent 6 integration risks and side effects. Not a regression.
  • CLAUDE.md → .agents/rules/base.md: Confirmed the two files have identical content. base.md uses alwaysApply: true frontmatter, making it the correct agents-framework equivalent.
  • Security: No concerns — this is a markdown prompt template with no executable code, no secrets, no injection surface, and no changes to allowed tools/permissions.
  • Test coverage: Agent command definitions are prompt configurations, not testable source code. No tests expected.

LGTM 👍


🤖 Generated with Claude Code

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 21, 2026

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: d3aa21b
Status:⚡️  Build in progress...

View logs

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@f92b634). Learn more about missing BASE report.
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1286   +/-   ##
=======================================
  Coverage        ?   87.18%           
=======================================
  Files           ?      115           
  Lines           ?     4324           
  Branches        ?     1002           
=======================================
  Hits            ?     3770           
  Misses          ?      554           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

yamadashy and others added 2 commits March 22, 2026 00:54
- Add CLAUDE.md reference back to conventions agent alongside
  .agents/rules/base.md
- Add premortem analysis to holistic review agent (pr-review)
- Clarify bot comment evaluation happens before spawning agents

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLAUDE.md and .agents/rules/base.md contain the same content,
so referencing both is redundant.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yamadashy yamadashy merged commit 506d7cf into main Mar 21, 2026
52 of 53 checks passed
@yamadashy yamadashy deleted the chore/improve-pr-review-command branch March 21, 2026 15:55
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.

1 participant