ほとんどのソフトウェアチームにとって、誰かにコードレビューをしてもらっているステップは「急いで仕上げたのに、待たされる(hurry up and wait)」というプロセスになりがちです。機能を実装し、プルリクエスト(PR)を作成したら……待たされる。私たちのチームも同じ問題を抱えていました。この待ち時間が進捗を遅らせ、開発者のフラストレーションになっていたのです。具体的には、以下のような「痛み」がありました。
長い待ち時間
PRを出してから最初のレビューが終わるまで数時間、時には丸一日かかることもありました。開発者は手が止まってしまったり、別のタスクに頭を切り替えたりしなければならず、生産性が低下していました。
レビュアーの疲弊
シニアエンジニアたちは、コーディングスタイルや構文ミス、些細なエッジケースといった細かい修正の指摘に多くの時間を費やしていました。これらは重要ですが、シニアな経験を活かす最善の方法とは言えません。
新人エンジニアにとってのハードル
ジュニアエンジニアは、コーディング規約を学んだり、ブロッキングを解消したりするためだけに、フィードバックを何時間も待つ必要がありました。これでは学習スピードが遅くなり、ストレスも溜まります。
以前は rubocop などのツールを使ったり、すべてのPRに対してCIでスタイルチェックを実行したりして、レビュアーの負担を減らそうとしました。これらは役立ちましたが、日々のコードレビューが全員にとって負担であることに変わりはありませんでした。
幸いなことに、最近のLLMの進化に伴い、AIツールに負荷を分散できるようになりました。現在、AIツールがレビューにおける反復作業の多くを処理してくれています。そのおかげで、より速く、よりストレスなくレビューを行えるようになりました。つまり、アーキテクチャの設計、ビジネスロジックの改善、複雑な問題の解決といった「人間が得意とすること」に、より多くの時間を使えるようになったのです。
この記事では弊社で導入しているAIコードレビューの現状について紹介します。
AIコードレビュアーの導入
今のところ2つのAIツールをワークフローに組み込んでます。Gemini Code Review と Cursor の Bugbot です。
Gemini Code Review: 万能なファーストレビュアー
Geminiは、疲れを知らない「最初のレビュアー」として機能します。PRが作成されると同時に、その内容の分析を開始します。その目的は、完全な一次レビューを行い、品質のベースラインを確保することです。
- 即時のPR要約: 変更内容の要約を自動的に投稿してくれるため、人間のレビュアーはコンテキストを素早く理解できます。
- 包括的なフィードバック: バグやスタイルの問題点などを探し出し、明確なコメントと共に重要度をマークしてくれます。
- 修正案の提示: 単に問題を指摘するだけでなく、ワンクリックで適用できる修正コードも提案してくれます。
Cursor の Bugbot: 深層バグハンター
Geminiが全体的なレビューを担当する一方で、Cursorの「Bugbot」はスペシャリストとして振る舞います。人間が見落としがちな、複雑でリスクの高い問題を深く掘り下げます。

- ロジックとセキュリティへの集中: 複雑なロジックエラー、競合状態(レースコンディション)、潜在的なセキュリティリスクを見つけるのに優れています。
- 重大な問題のみを報告: 私たちは、確度が高く重大な問題のみを報告するように設定しています。これによりノイズが減り、Cursor Botがコメントした時は「本当に重要な問題がある」と判断できます。
- チーム全員が日々の業務でCursor AIを使用しているため、Cursor Botが見つけた問題をエディタ上やブラウザ上で直接修正できるのも強みです。
導入後の姿: 新しくなった高速ワークフロー
現在のコードレビュープロセスは以下のようになりました。AIコードレビュー前と比べてかなり効率が上がりました。
- 開発者がPRを作成: 開発者は以前と同じようにコードをプッシュし、PRを作成します。
- AIによる一次レビュー(数秒): 人間のレビュアーがアサインされる前に、Gemini が自動的に実行されます。要約を投稿し、スタイル、エラー、ベストプラクティスに関する最初の一連のコメントを残します。
- スペシャリストによるバグハント(数分): 同時に、Cursor Bot が詳細なチェックを行い、重大なバグやセキュリティ問題が見つかればピンポイントでコメントを追加します。
- 開発者による自己修正: PR作成者はAIのフィードバックを確認し、提案の多く(Geminiの修正案など)を人間のレビュアーを呼ぶ前に適用します。このステップだけで、レビューの往復を1回分減らすことができます。
- 人間による本質的なレビュー: シニアエンジニアがPRを開く頃には、ノイズは消え去っています。コードはきれいで、スタイルガイドに従っており、単純なミスもありません。そのため、細かい修正ではなく、ハイレベルな設計、アーキテクチャ、ロジックに集中してレビューできるようになりました。
成功の鍵: PRの概要欄は「プロンプト」として扱う
このフローで運用してみて学んだ重要な教訓は、「AIツールは、与えられたコンテキスト次第で賢くもなれば愚かにもなる」ということです。AIレビューの質を上げる最良の方法は、明確なPR概要(ディスクリプション)を書くことです。
次のように考えてみてください。
- コンテキストがない場合: AIは「コードの変更(What)」しか見えません。構文エラーは見つけられますが、なぜその変更をしたのか(Why)は分かりません。
- コンテキストがある場合: AIは「意図(Why)」を理解します。宣言されたゴールに対してコードが正しいかをレビューできるため、真のパートナーとして機能します。
違いの実例を見てみましょう。
悪いPR概要:
「ユーザーロジックを更新」
- AIのレビュー: 一般的。「この関数は長すぎます」「変数
xの意味が不明確です」といった表面的な指摘に留まります。
良いPR概要:
タイトル: “Feat: Google OAuthによるソーシャルログインの実装 (Fixes #123)”
本文:
- 目的: ユーザーがGoogleアカウントを使ってサインアップおよびログインできるようにする。
- アプローチ:
- 新しいエンドポイント
/auth/googleを追加。- 該当メールアドレスのユーザーが存在すればアカウントを紐付け、存在しなければ新規作成する。
- チェックしてほしい点: Googleからのコールバック失敗時のエラーハンドリングが堅牢かどうか不安なので確認してほしい。
- AIのレビュー: 焦点を絞った強力なものになります。AIはOAuthフローのセキュリティ、アカウント紐付け対作成のロジックを具体的にチェックし、リクエスト通りエラーハンドリングを入念に確認してくれます。
PRの概要欄を「AIチームメイトへのプロンプト」として扱うことで、より賢く、より役立つフィードバックを得ることができるのです。
まとめ
AIコードレビューは私たちの開発プロセスでなくてはならないものになっています。反復作業をAIが引き受けてくれるおかげで、私たちは設計、ロジック、そして優れた機能の構築に集中できています。
もちろん完璧ではありません(時々見落としもあります)。しかし、使い方を改善していくことで、毎週のように精度は向上しています。重要なのはバランスです。人間は判断力と創造性を持ち寄り、AIはスピードと一貫性を提供するという分担がいいと思っています。
この両輪が揃うことで、開発プロセスはより速く、より賢く、そして何より楽しいものになると信じています。
(ファット)
How We Use AI to Improve Our Code Reviews
For most software teams, code review is a “hurry up and wait” process. You finish building a feature, open a pull request (PR), and then… you wait. Our team had the same problem. This delay slowed down our progress and frustrated developers. Here are some common pain points we faced:
Long Wait Times:
PRs often waited for the first review for many hours, sometimes even a whole day. Developers got stuck or had to switch tasks, which hurt productivity.
Reviewer Fatigue:
Senior developers spent too much time fixing small issues like coding style, syntax mistakes, or minor edge cases. These are important but not the best use of their experience.
Hard for New Developers:
Junior developers often waited hours for feedback just to learn our coding standards and get unblocked. It made learning slower and more stressful.
We tried to reduce reviewer fatigue by using tools like rubocop and running code style checks in CI for every PR. This helped, but daily code reviews were still tiring for everyone.
Luckily, with the growth of large language models (LLMs) this year, we began using AI tools to share the workload. These tools now handle many repetitive review tasks, helping us review code faster and with less stress. This means we can spend more time on what humans do best — designing architecture, improving business logic, and solving complex problems.
AI Code Reviewers
After exploring our options, we integrated two powerful AI tools into our workflow, — each with its own role: Gemini Code Review and Cursor Bot.
Gemini Code Review: The All-Round Reviewer
Gemini works as our tireless “first reviewer.” As soon as a pull request (PR) is opened, it starts analyzing the whole thing. Its goal is to give a complete first review and set a solid quality baseline.
- Instant PR Summaries: It automatically posts a summary of the changes so human reviewers can quickly understand the context.
- Comprehensive Feedback: It looks for bugs, style issues, and other problems, leaving clear comments and marking their severity.
- Actionable Suggestions: It doesn’t just point out issues — it also suggests fixes that developers can apply with a single click.
Cursor Bot: The Deep Bug Hunter
While Gemini handles the overall review, Cursor’s “Bugbot” acts as a specialist. It digs deep to find tricky, high-risk issues that humans might overlook.
- Logic and Security Focus: It’s great at catching complex logic errors, race conditions, and possible security risks.
- Serious Issues Only: We’ve set it to only report serious, high-confidence problems. This helps reduce noise — so when Cursor Bot leaves a comment, we know it really matters.
- Since everyone on our team already uses Cursor AI in their daily work, we can use Cursor Bot to fix the issues it finds directly in the editor or even in the browser with Cursor AI.
The “After” Picture: Our New, Supercharged Workflow
Here’s what our code review process looks like now — and it’s a real game-changer.
- Developer Creates a PR: A developer pushes their code and create a PR just like before.
- AI First Review (Seconds): Before any human reviewer is tagged, Gemini automatically runs. It posts a summary and leaves its first round of comments on style, errors, and best practices.
- Specialist Bug Hunt (Minutes): Simultaneously, Cursor Bot runs a deep check and adds focused comments if it finds any serious bugs or security issues.
- Developer Self-Correction: The PR author reviews all AI feedback and can apply most of the suggestions (like Gemini’s “ready-to-commit” fixes) before tagging a human reviewer. This step alone removes one full review cycle.
- Focused Human Review: By the time a senior developer opens the PR, all the noise is gone. The code is cleaner, follows our style guide, and is free from simple mistakes. Their review now focuses on high-level design, architecture, and logic — not small fixes.
The Secret Sauce: Treat Your PR Description as a Prompt
We learned that AI tools are only as good as the context you give them. The best way to improve AI reviews is to write a clear PR description.
Think of it this way:
- Without Context: The AI only sees the code changes (the “what”). It can find syntax errors, but it has no idea why you made the change.
- With Context: The AI understands the intent (the “why”). It can now review your code against your stated goal, acting as a true partner.
Here’s a practical example of the difference:
Bad PR Description:
“Updates user logic.”
- AI Review: Generic. “This function is long.” “Variable
xis unclear.”
Good PR Description:
Title: “Feat: Implement social login via Google OAuth (Fixes #123)”
Body:
- Purpose: This PR adds the ability for users to sign up and log in using their Google account.
- Approach:
- Adds a new
/auth/googleendpoint.- If a user with that email already exists, it links the account. If not, it creates a new user.
- Area to check: I’m not sure if the error handling for a failed Google callback is robust enough.
- AI Review: Focused and powerful. The AI will now specifically check the security of the OAuth flow, validate the logic for linking vs. creating accounts, and pay special attention to the error handling, just as you asked.
By treating our PR descriptions as prompts for AI teammates, we get much smarter and more helpful feedback.
Wrapping Up
AI has become a real teammate in our code review process. It handles the repetitive work so we can focus on design, logic, and building great features.
It’s not perfect — sometimes it misses things — but it’s getting better every week as we refine how we use it. The key is balance: humans bring judgment and creativity, while AI brings speed and consistency.
Together, they make our development process faster, smarter, and a lot more enjoyable.
(Phat)
