Code Review

VerifiedSafe

Reviews code changes (local branch, GitHub PR, uncommitted diffs) by running parallel sub-agents for quality, performance, security, and guideline compliance. Helps catch issues before merging, with optional breaking change detection for APIs, schemas, and dependencies.

Sby Skills Guide Bot
DevelopmentIntermediate
806/2/2026
Claude Code
#code-review#quality-assurance#best-practices#security-review

Recommended for

Our review

This skill performs a comprehensive code review of local changes or a GitHub Pull Request, covering quality, performance, security, and guideline compliance.

Strengths

  • Interactively determines the review scope via user questions
  • Runs multiple specialized sub-agents in parallel for multi-dimensional analysis
  • Detects breaking changes (API, schema, configuration, dependencies)
  • Outputs a structured report with scores and prioritized findings

Limitations

  • Relies on GitHub CLI for PRs, requiring prior authentication
  • Does not substitute for a human review, especially for business logic
  • Can be time-consuming for large diffs due to parallel sub-agent execution
When to use it

Before merging a branch, to get quick and systematic feedback on code quality.

When not to use it

For trivial changes (typos, comments) where the overhead outweighs the benefit.

Security analysis

Safe
Quality score85/100

The skill uses Bash only for safe, read-only git commands (git diff, gh pr view/diff). No destructive operations, data exfiltration, or safety bypasses are instructed. Although the PR number input from AskUserQuestion is inserted into shell commands without explicit sanitization, the user is the one providing the input in their own environment, so command injection risk is minimal and inherent to any interactive shell usage.

No concerns found

Examples

Review local branch diff
コードレビューして
Review current GitHub PR
現在のPRをレビューして

name: code-review description: 現在のブランチをコードレビューする。「コードレビューして」「レビューして」「PRの前にチェック」「破壊的変更をチェック」といった依頼、またはマージ前の品質確認が必要な場合に使用する。 allowed-tools:

  • Read
  • Grep
  • Glob
  • Bash
  • Task
  • AskUserQuestion

コードレビュー

概要

目的: ローカルブランチまたは GitHub PR の変更内容をレビューし、品質・一貫性・潜在的な問題を検出する。

AskUserQuestion ツールを使ってレビュー条件をインタビューし、適切なサブエージェントでレビューを実行する。


フェーズ 1: レビュー対象の確認

AskUserQuestion ツールを使って質問する。

質問内容:

  • question: "レビュー対象は?"
  • header: "対象"
  • options:
    • label: "ローカルブランチ", description: "現在のブランチと main の差分をレビュー"
    • label: "GitHub PR", description: "現在のブランチPRの差分をレビュー"
    • label: "ローカル差分", description: "ローカルにある差分をレビュー"
    • label: "ステージ済みのローカル差分", description: "ローカルにあるステージ済みの差分をレビュー"

フェーズ 2: 破壊的変更チェックの確認

AskUserQuestion ツールを使って質問する。

質問内容:

  • question: "破壊的変更チェックは?"
  • header: "破壊的変更"
  • options:
    • label: "行う", description: "API/スキーマ変更確認"
    • label: "行わない", description: "通常レビューのみ"

フェーズ 3: 変更内容の取得

フェーズ 1 の回答に基づいて変更内容を取得する。

ローカルブランチの場合:

git diff main...HEAD
git diff --name-only main...HEAD

GitHub PR の場合:

AskUserQuestion ツールを使って PR 番号を確認する。

<rules> - **AskUserQuestion ツールを必ず使用** - 会話形式の質問は不可 </rules>

その後:

gh pr view <PR番号> --json title,body,files,additions,deletions
gh pr diff <PR番号>

フェーズ 4: レビューの実行

全てのサブエージェントを並列で実行する。

サブエージェント

| サブエージェント | 専門領域 | |------------------|----------| | review-quality | コード品質(命名、SRP、複雑度、エラー処理) | | review-performance | パフォーマンス(計算効率、メモリ、レンダリング) | | review-security | セキュリティ(XSS、SQLi、入力検証) | | review-guideline | ガイドライン準拠(TypeScript/React/テストルール) |


フェーズ 6: 破壊的変更のチェック

「行う」を選択した場合のみ実行する。

| カテゴリ | 例 | |----------|-----| | API 変更 | 関数の引数追加/削除、戻り値の型変更 | | スキーマ変更 | DB カラムの削除、型変更、NOT NULL 追加 | | 設定変更 | 環境変数の追加/削除、デフォルト値の変更 | | 依存関係 | メジャーバージョンアップ、パッケージの削除 |


フェーズ 7: 結果の出力

レビュー観点(サブエージェント別)

| サブエージェント | チェック内容 | |------------------|-------------| | review-quality | 命名規則、単一責任原則、関数複雑度、エラーハンドリング | | review-performance | 計算効率、メモリ管理、レンダリング最適化、N+1問題 | | review-security | XSS、SQLi、入力検証、認証・認可、OWASP Top 10 | | review-guideline | TypeScript/React/テストルール準拠、コードスタイル |

出力形式

## コードレビュー結果

### サマリー
- レビュー対象: ローカルブランチ / PR #XXX
- 変更ファイル数: X
- 追加行数: +XXX
- 削除行数: -XXX

### スコア一覧

| 観点 | スコア |
|------|--------|
| 品質 | A/B/C/D |
| パフォーマンス | A/B/C/D |
| テスト | A/B/C/D |
| ドキュメント | A/B/C/D |
| セキュリティ | A/B/C/D |
| ガイドライン | A/B/C/D |
| Design Doc | A/B/C/D(設計書ありの場合) |

### 破壊的変更
🔴 あり / 🟢 なし

### 発見事項

#### 🔴 Critical(修正必須)
- [ファイル名:行番号] 問題の説明

#### 🟡 Warning(推奨)
- [ファイル名:行番号] 改善提案

#### 🟢 Good(良い点)
- 良かった実装のポイント

### 総評
全体的な評価とコメント

重要な注意事項

  • AskUserQuestion ツールを必ず使用 - 会話形式の質問は不可
  • 各フェーズで必ず AskUserQuestion を呼び出してからユーザーの回答を待つ
Related skills