Skip to content

feat(agents): Add AI bot inline comment evaluation to PR review#1044

Merged
yamadashy merged 2 commits intomainfrom
feat/pr-review-ai-bot-evaluation
Dec 30, 2025
Merged

feat(agents): Add AI bot inline comment evaluation to PR review#1044
yamadashy merged 2 commits intomainfrom
feat/pr-review-ai-bot-evaluation

Conversation

@yamadashy
Copy link
Owner

Add functionality to evaluate and respond to AI bot review comments (e.g., gemini-code-assist, coderabbitai) during PR reviews.

Purpose

This reduces maintainer cognitive load by having Claude automatically evaluate AI bot inline comments and provide priority judgments:

  • Priority: Required - Security issues, clear bugs, potential crashes
  • Priority: Recommended - Code quality improvements, best practice violations
  • Priority: Not needed - Style suggestions, false positives, already addressed

Changes

  • Add gh api commands to allowed-tools for fetching/replying to PR review comments
  • Add "AI Bot Inline Comment Evaluation" section with clear workflow
  • Skip Claude's own comments and already-replied comments
  • Use backtick format for priority labels

Example Output

`Priority: Not needed`

Already addressed. The `getSkillLocation()` function was added which uses `getSkillBaseDir()` to correctly determine the skill location.

Checklist

  • Run npm run test
  • Run npm run lint

Add functionality to evaluate and respond to AI bot review comments
(e.g., gemini-code-assist, coderabbitai) during PR reviews.

This reduces maintainer cognitive load by providing priority judgments:
- Required: Security issues, clear bugs, potential crashes
- Recommended: Code quality improvements, best practice violations
- Not needed: Style suggestions, false positives, already addressed

Key changes:
- Add gh api commands to allowed-tools for fetching/replying to comments
- Add "AI Bot Inline Comment Evaluation" section with clear workflow
- Skip Claude's own comments and already-replied comments
- Use backtick format for priority labels (e.g., `Priority: Required`)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

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.

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

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

This PR updates the PR review workflow documentation to introduce a structured AI Bot Inline Comment Evaluation process. It adds detailed steps for fetching, filtering, judging, and replying to bot inline comments, and extends the allowed-tools configuration with two new gh API endpoints for managing inline comments.

Changes

Cohort / File(s) Change Summary
PR Review Workflow Documentation
.agents/commands/git/pr-review.md
Adds new "AI Bot Inline Comment Evaluation" section with step-by-step workflow for handling bot comments. Replaces and expands item 5 with explicit AI bot evaluation guidance. Restructures step 6 into detailed numbered procedure with command examples and formatting recommendations.
Allowed Tools Configuration
allowed-tools/allowedTools (or similar)
Extends allowed-tools list by appending two new gh API endpoints for pulling and replying to inline comments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main feature being added: AI bot inline comment evaluation functionality in the PR review workflow.
Description check ✅ Passed The PR description fully addresses the template requirements with a comprehensive summary, clear purpose, detailed changes, example output, and completed checklist items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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 @yamadashy, 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 integrates an advanced AI-driven system to streamline the pull request review process. It empowers an AI agent, Claude, to intelligently assess and categorize inline comments generated by other AI bots. By assigning clear priority levels to these comments, the system aims to significantly reduce the manual effort required from human maintainers, allowing them to concentrate on the most impactful feedback and accelerate code integration.

Highlights

  • New Feature: AI Bot Inline Comment Evaluation: Introduces functionality for an AI agent (Claude) to automatically evaluate and respond to inline review comments made by other AI bots (e.g., gemini-code-assist, coderabbitai) within pull requests.
  • Reduced Maintainer Cognitive Load: The primary purpose is to reduce the cognitive burden on human maintainers by having Claude assign priority judgments ('Required', 'Recommended', 'Not needed') to bot-generated comments, helping maintainers focus on critical feedback.
  • Enhanced Tooling for PR Review: Adds new gh api commands to the allowed tools, enabling the AI agent to fetch PR comments and their replies, which is crucial for the new evaluation workflow.
  • Detailed Evaluation Workflow: A comprehensive workflow is documented, outlining how to fetch, filter (skipping Claude's own comments and already-replied comments), judge, and reply to bot inline comments with specific priority labels and explanations.

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

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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

@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 capability for the AI agent to evaluate and respond to comments from other AI bots on a pull request. The changes primarily involve updating the agent's instruction file (pr-review.md) with a new workflow and granting it the necessary permissions to use the GitHub API for comments. My review focuses on the clarity and correctness of these new instructions. I've identified a few areas where the instructions are ambiguous or contain syntactically incorrect commands, which could lead to incorrect or failed behavior by the agent. My suggestions aim to clarify these instructions and fix the command syntax to ensure the new feature works reliably.

@claude
Copy link
Contributor

claude bot commented Dec 30, 2025

PR Review Summary

Overall Assessment: Approve - This PR is well-structured and achieves its goal of reducing maintainer cognitive load for AI bot review comments.

Feedback

The implementation is clear and follows good documentation practices. A few minor suggestions:

1. Clarify duplicate reply detection logic

In section 2, the instruction mentions:

SKIP if Claude already replied - check in_reply_to_id field

The in_reply_to_id field identifies what comment a reply responds to, not who replied. To detect if Claude already replied, you need to check all comments where in_reply_to_id matches the bot comment's ID and verify the author isn't Claude. Consider clarifying this:

- **SKIP if Claude already replied** - check all comments for any with `in_reply_to_id` matching this comment's ID and author = `claude`
2. Consider adding error handling guidance (optional)

The workflow could benefit from brief guidance on handling API failures (rate limits, auth issues). For example:

If the API call fails, skip the bot comment evaluation and proceed with the standard review.

This is a nice-to-have, not a blocker.

Premortem Analysis

Scenario Risk Notes
GitHub API rate limiting Medium Unlikely for typical PR reviews, but could occur with many bot comments
No bot inline comments Low Workflow handles gracefully (nothing to evaluate)
Ambiguous bot feedback Low Section 5 addresses with clarification request pattern

Verdict

This is a thoughtful feature that will help maintainers quickly triage AI bot suggestions. The documentation is comprehensive with good examples. Ready to merge.


🤖 Generated with Claude Code

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.34%. Comparing base (4497ff1) to head (8bc2c56).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1044   +/-   ##
=======================================
  Coverage   90.34%   90.34%           
=======================================
  Files         123      123           
  Lines        9457     9457           
  Branches     1709     1709           
=======================================
  Hits         8544     8544           
  Misses        913      913           

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

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 30, 2025

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8bc2c56
Status: ✅  Deploy successful!
Preview URL: https://cedcd82c.repomix.pages.dev
Branch Preview URL: https://feat-pr-review-ai-bot-evalua.repomix.pages.dev

View logs

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: 0

🧹 Nitpick comments (1)
.agents/commands/git/pr-review.md (1)

50-50: Add language specifications to fenced code blocks.

The code blocks at lines 50, 57, 63, and 69 are missing language identifiers. Per Markdown linting standards (MD040), fenced code blocks should specify a language (e.g., ```markdown or ```text).

🔎 Proposed fix

Replace the opening ``` markers with ```markdown (or ```text):

-   ```
+   ```markdown
    `Priority: Recommended`
    
    This suggestion appears valid, but I need clarification: Is this pattern used elsewhere in the codebase?
-   ```
+   ```

Apply the same change to all four code blocks (lines 50, 57, 63, 69).

Also applies to: 57-57, 63-63, 69-69

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4497ff1 and 7d16746.

📒 Files selected for processing (1)
  • .agents/commands/git/pr-review.md
🧰 Additional context used
🪛 LanguageTool
.agents/commands/git/pr-review.md

[uncategorized] ~81-~81: The official name of this software platform is spelled with a capital “H”.
Context: ... highlighting specific code issues, use mcp__github_inline_comment__create_inline_comment ...

(GITHUB)

🪛 markdownlint-cli2 (0.18.1)
.agents/commands/git/pr-review.md

50-50: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


57-57: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


63-63: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


69-69: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Build and run (macos-latest, 24.x)
  • GitHub Check: Build and run (macos-latest, 25.x)
  • GitHub Check: Build and run (windows-latest, 25.x)
  • GitHub Check: Build and run (windows-latest, 24.x)
  • GitHub Check: Build and run (windows-latest, 20.x)
  • GitHub Check: Build and run (windows-latest, 22.x)
  • GitHub Check: Test (windows-latest, 25.x)
  • GitHub Check: Test (windows-latest, 22.x)
  • GitHub Check: Test (macos-latest, 20.x)
  • GitHub Check: Test (windows-latest, 20.x)
  • GitHub Check: Test (windows-latest, 24.x)
  • GitHub Check: Test (macos-latest, 24.x)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
.agents/commands/git/pr-review.md (2)

44-47: Bash command formatting may not preserve multi-line body parameter.

The bash command at line 44 splits the body parameter across multiple lines within the code block. Shell execution may fail or produce unexpected output if newlines aren't properly escaped. Ensure the template demonstrates proper escaping for multi-line content.

🔎 Suggested clarification for the bash command

Consider reformatting to show proper escaping or use a clearer pattern. For example:

gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
  -f body="\`Priority: {Required/Recommended/Not needed}\`

{Brief explanation of your judgment}"

Alternatively, use shell variable substitution to make the multi-line handling clearer.


2-2: Excellent structured workflow for AI bot inline comment evaluation.

The PR introduces a clear, well-documented process for evaluating AI bot review comments with well-defined priority tiers and helpful examples. The allowed-tools extension appropriately adds the necessary gh api endpoints for fetching and replying to inline comments. The emphasis on skipping Claude's own comments and existing replies reduces redundant processing effectively. This is a solid enhancement to the PR review workflow.

Also applies to: 21-84

- Fix multi-line command syntax by using \n for newlines
- Clarify in_reply_to_id check logic for detecting existing replies
- Add path field check to filter inline comments only
@claude
Copy link
Contributor

claude bot commented Dec 30, 2025

PR Review Update (Post-fix commit)

Overall Assessment: Approve - The second commit successfully addresses the feedback from the initial review.

Changes Since Previous Review

The fix commit 8bc2c56 addressed:

  • ✅ Multi-line command syntax using \n for newlines
  • ✅ Clarified in_reply_to_id check logic for detecting existing replies
  • ✅ Added path field check to filter inline comments only

Remaining Minor Suggestions

1. Missing language identifiers in code blocks (nitpick)

Per CodeRabbit's feedback, the code blocks at lines 47, 54, 60, and 66 are missing language identifiers. Consider adding text or markdown:

-   ```
+   ```text
    `Priority: Recommended`

This is a style preference, not a blocker.

Premortem Analysis

Scenario Risk Mitigation
GitHub API rate limiting Medium Workflow is designed for typical PR review volumes
Bot comment format changes Low Priority parsing uses flexible backtick matching
No bot inline comments None Workflow gracefully skips when nothing to evaluate

Verdict

This PR is ready to merge. The feature will help maintainers efficiently triage AI bot suggestions with clear priority labels.


🤖 Generated with Claude Code

@yamadashy yamadashy merged commit 8122f26 into main Dec 30, 2025
60 checks passed
@yamadashy yamadashy deleted the feat/pr-review-ai-bot-evaluation branch December 30, 2025 10:18
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