Skip to content

chore(cli): Add review-loop command#1285

Merged
yamadashy merged 5 commits intomainfrom
chore/add-review-loop-command
Mar 21, 2026
Merged

chore(cli): Add review-loop command#1285
yamadashy merged 5 commits intomainfrom
chore/add-review-loop-command

Conversation

@yamadashy
Copy link
Owner

@yamadashy yamadashy commented Mar 21, 2026

Add a review-loop custom command that performs iterative code review and fix cycles.

The command spawns 5 parallel review agents, each examining the diff from a different angle:

  • Correctness: Bugs, logic errors, edge cases, regressions
  • Security: Vulnerabilities, injection risks, secret exposure
  • Performance: Inefficiencies, resource leaks, unnecessary allocations
  • Conventions: Project conventions (CLAUDE.md), naming, structure, test coverage
  • Free review: Catch-all for anything the other agents missed

It then triages findings (fix vs skip), applies fixes, verifies with lint+test, and repeats until clean (max 3 iterations).

Checklist

  • Run npm run test
  • Run npm run lint

Open with Devin

yamadashy and others added 2 commits March 22, 2026 00:02
Iterative review-and-fix cycle that reviews current diff, triages
findings as fix/skip, applies fixes, verifies with lint+test, and
repeats until clean (max 3 iterations).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add an iterative review-and-fix command that spawns 5 parallel review
agents (correctness, security, performance, conventions, free review),
triages findings, fixes actionable items, verifies with lint+test,
and repeats until clean (max 3 iterations).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2026

⚡ Performance Benchmark

Latest commit:e2fca26
Status:✅ Benchmark complete!
Ubuntu:2.42s (±0.01s) → 2.42s (±0.02s) · -0.00s (-0.0%)
macOS:1.40s (±0.10s) → 2.06s (±0.51s) · +0.66s (+47.6%)
Windows:3.59s (±0.04s) → 3.59s (±0.03s) · -0.00s (-0.1%)
Details
  • Packing the repomix repository with node bin/repomix.cjs
  • Warmup: 2 runs (discarded)
  • Measurement: 10 runs / 20 on macOS (median ± IQR)
  • Workflow run

@coderabbitai
Copy link
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: e6edf071-7b0c-4a12-b8b4-713af1324f18

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

A new markdown file is added that documents an iterative code review workflow process. The workflow defines repeating cycles (maximum 3) of parallel multi-agent reviews across categories (Correctness, Security, Performance, Conventions, Free), followed by triage and selective fix application with verification steps.

Changes

Cohort / File(s) Summary
Code Review Workflow Documentation
.agents/commands/code/review-loop.md
New markdown document defining a 3-cycle iterative code review process with multi-agent parallel reviews, triage/consolidation of findings into "Fix" and "Skip" categories, fix application with verification via linting and testing, and re-review of newly changed lines only.

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 clearly describes the main change: adding a new review-loop command to the CLI tooling.
Description check ✅ Passed The PR description thoroughly explains the review-loop command's functionality, the five parallel review agents, the iterative process, and checklist items are completed.
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/add-review-loop-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.

@gemini-code-assist
Copy link
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 adds a new command-line tool, review-loop, designed to streamline the code review process. It automates the process of iterative review, triage, and fixing, aiming to improve code quality and reduce manual effort.

Highlights

  • New Feature: Introduces a review-loop command to automate iterative code review and fix cycles.
  • Parallel Review Agents: Spawns 5 parallel review agents, each focusing on different aspects: correctness, security, performance, conventions, and a free review.
  • Automated Triage and Fix: Includes automated triage of findings, application of fixes, and verification with linting and testing.

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

Copy link
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
Contributor

claude bot commented Mar 21, 2026

PR Review: chore(cli): Add review-loop command

Overall: Looks good ✅ — This is a small, self-contained addition of a new agent command file. The prompt is well-structured and the review angles are complementary.

Feedback

Minor suggestions (non-blocking)
  1. Hardcoded npm run commands: The prompt references npm run lint and npm run test directly. This is consistent with the existing lint-fix.md and perf-tuning.md commands, so it's fine for this project. Just noting that if the project ever changes its task runner, these commands would need updating across multiple files.

  2. Agent count consideration: Spawning 5 parallel agents is a meaningful resource commitment. The perf-tuning.md spawns 10 agents, so this is within precedent for the project. The rationale for 5 specific angles is clear and well-justified — each has a distinct, non-overlapping focus.

  3. "Free review" scope: Agent 5's description ("Anything else worth flagging that the other agents may have missed") is intentionally broad, which is a good catch-all. No change needed.

  4. Iteration cap: Max 3 iterations is a reasonable safeguard against infinite loops. The stop condition ("no Fix items remain or 3 iterations reached") is clear.

Premortem Analysis

Scenario Risk Mitigation
Agent findings conflict with each other Low Triage step (step 2) explicitly classifies findings, giving the orchestrator a chance to resolve conflicts
Re-review (step 5) re-raises previously skipped items Low Prompt explicitly says "Do not re-raise skipped items"
Fixes introduce new regressions Medium Step 4 requires lint+test verification before continuing, which is a good safeguard
5 parallel agents produce redundant findings Low Each agent has a distinct review angle; triage step deduplicates

Verdict

Clean, well-scoped PR. The command follows the established patterns of other .agents/commands/ files (lint-fix.md, perf-tuning.md). No bugs, no security concerns, no test coverage needed (it's a prompt file). Approve.

@cloudflare-workers-and-pages
Copy link

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

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: e2fca26
Status: ✅  Deploy successful!
Preview URL: https://2d5cb03e.repomix.pages.dev
Branch Preview URL: https://chore-add-review-loop-comman.repomix.pages.dev

View logs

Copy link
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 introduces a new review-loop custom command by adding a markdown file that defines its behavior. The command orchestrates an iterative review-and-fix cycle using multiple specialized agents, which is a comprehensive approach. The process is well-defined, but I have one suggestion to enhance the clarity of the verification step's instructions to prevent potential ambiguity for the agent executing the command.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.agents/commands/code/review-loop.md (1)

16-16: Allow skipped items to be reconsidered if new changes affect them.

“Do not re-raise skipped items” is a bit too absolute; skipped findings can become valid after later edits. Consider reopening only when newly changed lines alter the original context.

Suggested wording tweak
-5. **Re-review** only the newly changed lines. Do not re-raise skipped items.
+5. **Re-review** only the newly changed lines. Do not re-raise skipped items unless new changes materially affect their context.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/commands/code/review-loop.md at line 16, The sentence "Re-review
only the newly changed lines. Do not re-raise skipped items." is too absolute;
update the rule to allow previously skipped items to be reopened if later edits
affect their context. Replace that line (the "Re-review only..." sentence) with
wording that requires reviewers to re-review only changed lines but permits
reopening skipped findings when new changes touch or alter the original context
(for example: re-review changed lines and reopen skipped items only when new
edits affect their context). Ensure the new text appears where the current
sentence is located and references the same rule heading ("Re-review") so intent
remains clear.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/commands/code/review-loop.md:
- Line 11: Agent 4 — Conventions currently points to CLAUDE.md instead of the
project’s canonical rules; update the conventions agent to load and use the
project's canonical rules source (base.md) for checks. Locate the "Agent 4 —
Conventions" entry in the review-loop config and replace the CLAUDE.md reference
with the canonical rules file (base.md), ensuring the agent reads and applies
that ruleset during triage so conventions checks use the project-specific
source.

---

Nitpick comments:
In @.agents/commands/code/review-loop.md:
- Line 16: The sentence "Re-review only the newly changed lines. Do not re-raise
skipped items." is too absolute; update the rule to allow previously skipped
items to be reopened if later edits affect their context. Replace that line (the
"Re-review only..." sentence) with wording that requires reviewers to re-review
only changed lines but permits reopening skipped findings when new changes touch
or alter the original context (for example: re-review changed lines and reopen
skipped items only when new edits affect their context). Ensure the new text
appears where the current sentence is located and references the same rule
heading ("Re-review") so intent remains clear.
🪄 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: ff6f42cb-83fb-4a39-a589-2ebd57555158

📥 Commits

Reviewing files that changed from the base of the PR and between c66ec5c and f8396b7.

📒 Files selected for processing (1)
  • .agents/commands/code/review-loop.md

- Reference .agents/rules/base.md instead of CLAUDE.md for conventions
- Make verify step explicit about repeating until checks pass

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

claude bot commented Mar 21, 2026

PR Review Update: chore(cli): Add review-loop command

Since my previous review, the code hasn't changed. Adding incremental feedback on AI bot comments for maintainer triage.

AI Bot Inline Comment Evaluation

CodeRabbit — Line 11: Conventions agent rule reference

Priority: Not needed

CodeRabbit's actionable comment suggests the conventions agent references CLAUDE.md instead of the project's canonical rules. This is a false positive — the file already correctly references .agents/rules/base.md (which exists in the repo). No change needed.

CodeRabbit — Line 16: "Do not re-raise skipped items" wording

Priority: Not needed

CodeRabbit suggests softening "Do not re-raise skipped items" to allow reopening when new changes affect context. While theoretically sound, in practice this adds ambiguity to the prompt. The current strict wording prevents the re-review step from devolving into re-litigating the same findings every iteration — which is the more likely failure mode. If a fix truly changes the context of a skipped item, the "Free review" agent (Agent 5) would catch it anyway. Current wording is better for prompt clarity.

Gemini Code Assist — General review comment

Priority: Not needed

Gemini's review suggested enhancing the verification step's instructions. The current step 4 is already clear: "Fix any regressions and repeat this step until all checks pass before continuing." This is sufficient and consistent with other command files in the repo.

Devin — No issues found

Agreed. Clean PR.

Verdict (unchanged)

Approve — Clean, well-scoped PR. No new concerns.

🤖 Generated with Claude Code

yamadashy and others added 2 commits March 22, 2026 00:42
…ories

Reorganize review agents to match established patterns:
- Correctness → Code quality (adds code smells)
- Free review → Test coverage (dedicated agent)
- Conventions no longer includes test coverage
- Add double-filter: agents report only noteworthy findings,
  triage step re-filters before classifying Fix/Skip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Agent 6 for overall design concerns, side effects, and
integration risks that the other 5 specialized agents may miss.

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

claude bot commented Mar 21, 2026

PR Review: No new feedback

Previous Claude reviews (2 rounds) already covered this PR comprehensively. The code (single 20-line markdown file) hasn't changed since. All bot inline comments were evaluated and triaged.

Verdict: Approve — Clean, well-scoped addition following established .agents/commands/ patterns.

🤖 Generated with Claude Code

@yamadashy yamadashy merged commit f92b634 into main Mar 21, 2026
59 checks passed
@yamadashy yamadashy deleted the chore/add-review-loop-command branch March 21, 2026 15:47
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.18%. Comparing base (c66ec5c) to head (e2fca26).
⚠️ Report is 10 commits behind head on main.

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

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

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