jpskill.com
🛠️ 開発・MCP コミュニティ

review-changes

Code review of current git changes, compare to related plan if exists, identify bad engineering, over-engineering, or suboptimal solutions. Use when user asks to review changes, check git diff, validate implementation quality, or assess code changes.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o review-changes.zip https://jpskill.com/download/18242.zip && unzip -o review-changes.zip && rm review-changes.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18242.zip -OutFile "$d\review-changes.zip"; Expand-Archive "$d\review-changes.zip" -DestinationPath $d -Force; ri "$d\review-changes.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して review-changes.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → review-changes フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Git の変更をレビューする

手順

現在のワーキングコピーの変更を徹底的にコードレビューし、必要に応じて計画と比較し、エンジニアリング上の問題を特定します。

フェーズ 1: 変更とコンテキストの発見

ステップ 1: 現在の変更を取得する

# 変更されたファイルを確認する
git status

# 詳細な差分を確認する
git diff

# ステージングされた変更を個別に確認する
git diff --cached

# ステージング済みと未ステージングの両方を確認する
git diff HEAD

ステップ 2: 関連する計画を特定する (存在する場合)

関連する計画ファイルを検索します。

  • 関連する計画について、.plans/ ディレクトリを確認します
  • ブランチ名に記載されている計画を探します
  • どの計画が適用されるか不明な場合は、ユーザーに確認します
  • 計画が存在しない場合は、一般的なベストプラクティスに照らしてレビューします

計画が存在する場合:

  • 計画全体を読みます
  • 意図された設計とアーキテクチャを理解します
  • 特定の要件と制約をメモします

ステップ 3: 変更されたファイルを分類する

ファイルの種類ごとにグループ化します。

  • 新規ファイル: スクラッチから作成されたファイル
  • 変更されたファイル: 既存のファイルが変更されたファイル
  • 削除されたファイル: 削除されたファイル
  • 名前変更/移動されたファイル: 組織的な変更

レビューする変更されたファイルごとに 1 つの項目を含む ToDo リストを作成します。

フェーズ 2: 体系的なファイルレビュー

ToDo リストの変更されたファイルごとに:

ステップ 1: 現在の状態を読み取る

  • 現在の状態のファイル全体を読みます
  • 何をするかを理解します
  • その責任をメモします

ステップ 2: 変更を分析する

git diff を読んで、何が変更されたかを正確に確認します。

  • 何が追加されましたか?
  • 何が削除されましたか?
  • 何が修正されましたか?

ステップ 3: 計画に対する評価 (該当する場合)

計画が存在する場合は、以下を確認します。

  • 実装は計画と一致していますか?

    • 計画された機能は正しく実装されていますか?
    • アーキテクチャは守られていますか?
    • ファイル名は指定どおりですか?
  • スコープの遵守:

    • この変更は計画に含まれていますか?
    • 計画の目標に必要ですか?
    • スコープクリープですか?
  • REMOVAL SPEC への準拠:

    • 計画でコードを削除するように指示されている場合、削除されましたか?
    • 古いコードは、存在すべきでない場合にまだ存在しますか?

ステップ 4: エンジニアリング上の問題を特定する

Bad Engineering を確認します。

  • バグ: ロジックエラー、オフバイワンエラー、競合状態
  • 不十分なエラー処理: エラーの握りつぶし、汎用的なキャッチ
  • 検証の欠落: 入力検証なし、null チェックなし
  • ハードコードされた値: マジックナンバー、ハードコードされた URL/パス
  • 強い結合: モジュール間の不要な依存関係
  • SRP の違反: クラス/関数が多くのことを行いすぎている
  • 誤ったパターン: デザインパターンの誤用
  • 型に関する問題: any の使用、型の欠落、間違った型
  • エッジケースの欠落: 空/null/エラーケースを処理しない

Over-Engineering を確認します。

  • 不要な抽象化: 単純なロジックに対して多すぎるレイヤー
  • 時期尚早な最適化: 測定されていないパフォーマンスのための複雑なコード
  • フレームワークの過剰使用: 単純なタスクに重いライブラリを使用する
  • 機能クリープ: 要件にない機能を追加する
  • 金メッキ: 重要でないコードに過度の磨きをかける
  • YAGNI の違反: 「後で必要になるかもしれない」シナリオのためのコード
  • メリットのない複雑さ: 単純な方法でうまくいく場合に複雑にする

Suboptimal Solutions を確認します。

  • 重複: 抽出の代わりにコピーペーストされたコード
  • 車輪の再発明: 標準ライブラリが存在する場合にカスタムコード
  • 間違ったツール: 不適切なデータ構造/アルゴリズムを使用する
  • 非効率的なアプローチ: O(n) が明らかな場合に O(n²)
  • 不適切な命名: 不明瞭な変数/関数名
  • 再利用の欠落: 既存のユーティリティ/型が使用されていない
  • 一貫性のないパターン: コードベースのスタイルと一致しない
  • 技術的負債: 適切な解決策の代わりにクイックハック

ステップ 5: コード品質を確認する

  • 可読性: コードは明確で自己文書化されていますか?
  • 保守性: 後で簡単に変更できますか?
  • テスト容易性: 簡単にテストできますか?
  • パフォーマンス: 明らかなパフォーマンスの問題はありますか?
  • セキュリティ: セキュリティの脆弱性はありますか?
  • 一貫性: 既存のコードベースのパターンと一致していますか?

ステップ 6: 調査結果を記録する

メモリに保存します。

File: path/to/file.ts
Change Type: [New|Modified|Deleted]
Plan Compliance: [Matches|Deviates|Not in plan]
Issues:
  Bad Engineering:
    - [行番号付きの特定の問題]
  Over-Engineering:
    - [行番号付きの特定の問題]
  Suboptimal:
    - [行番号付きの特定の問題]
Severity: [CRITICAL|HIGH|MEDIUM|LOW]

ステップ 7: ToDo を更新する

ToDo リストでファイルをレビュー済みとしてマークします。

フェーズ 2.5: 問題/タスクのカバレッジ検証 (必須)

CRITICAL: レビューを完了する前に、元の問題/タスクの要件の 100% が実装されていることを確認します。

ステップ 1: ソース要件を特定する

次の場所から元の要件を見つけます。

  • GitHub issue (gh issue view <number>)
  • 問題を参照する PR の説明
  • .plans/ のタスクチケットまたは計画ファイル
  • 作業を説明するコミットメッセージ

ステップ 2: すべての要件を抽出する

網羅的なチェックリストを作成します。

  • 機能要件 (何をすべきか)
  • 受け入れ基準 (検証方法)
  • 言及されたエッジケース
  • エラー処理の要件

ステップ 3: 各要件を検証する

# Requirement Status Evidence
1 [requirement] ✅/❌/⚠️ file:line or "Missing"

ステップ 4: カバレッジ評価

Requirements Coverage = (Implemented / Total) × 100%

100% 未満の場合は、すぐに変更をリクエストしてください

レポートに追加します。

## Issue/Task Coverage

**Source**: [Issue #X / Plan file]
**Coverage**: X% (Y of Z requirements)

### Missing Requirements
- ❌ [Requirement X]: 実装されていません
- ❌ [Requirement Y]: 部分的に実装されています - [何が欠けているか]

**VERDICT**: カバレッジが不完全です。100% 実装されるまで承認できません。

フェーズ 3: ファイル間の分析

すべてのファイルをレビューした後:

ステップ 1: アーキテクチャへの影響

  • 変更はシステム全体のアーキテクチャにどのように影響しますか?
  • 破壊的な変更はありますか?
  • 変更によって新しい依存関係が導入されますか?
  • 計画からのアーキテクチャのずれはありますか?

ステップ 2: パターンの整合性

  • 変更は互いに一貫性がありますか?
  • 同じパターンに従っていますか?
  • 矛盾するアプローチはありますか?

ステップ 3: 完全性

(原文はここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Review Git Changes

Instructions

Perform thorough code review of current working copy changes, optionally compare to plan, and identify engineering issues.

Phase 1: Discover Changes & Context

Step 1: Get Current Changes

# See changed files
git status

# See detailed diff
git diff

# See staged changes separately
git diff --cached

# See both staged and unstaged
git diff HEAD

Step 2: Identify Related Plan (if exists)

Search for related plan file:

  • Check .plans/ directory for relevant plan
  • Look for plan mentioned in branch name
  • Ask user if unsure which plan applies
  • If no plan exists, review against general best practices

If plan exists:

  • Read the entire plan
  • Understand intended design and architecture
  • Note specific requirements and constraints

Step 3: Categorize Changed Files

Group files by type:

  • New files: Created from scratch
  • Modified files: Existing files changed
  • Deleted files: Removed files
  • Renamed/moved files: Organizational changes

Create todo list with one item per changed file to review.

Phase 2: Systematic File Review

For EACH changed file in the todo list:

Step 1: Read Current State

  • Read the entire file in its current state
  • Understand what it does
  • Note its responsibilities

Step 2: Analyze the Changes

Read git diff to see exactly what changed:

  • What was added?
  • What was removed?
  • What was modified?

Step 3: Assess Against Plan (if applicable)

If plan exists, check:

  • Does implementation match plan?

    • Are planned features implemented correctly?
    • Is architecture followed?
    • Are file names as specified?
  • Scope adherence:

    • Is this change in the plan?
    • Is it necessary for the plan's goals?
    • Is it scope creep?
  • REMOVAL SPEC compliance:

    • If plan said to remove code, was it removed?
    • Is old code still present when it shouldn't be?

Step 4: Identify Engineering Issues

Check for Bad Engineering:

  • Bugs: Logic errors, off-by-one, race conditions
  • Poor error handling: Swallowed errors, generic catches
  • Missing validation: No input validation, no null checks
  • Hard-coded values: Magic numbers, hardcoded URLs/paths
  • Tight coupling: Unnecessary dependencies between modules
  • Violation of SRP: Class/function doing too many things
  • Incorrect patterns: Misuse of design patterns
  • Type issues: Use of any, missing types, wrong types
  • Missing edge cases: Doesn't handle empty/null/error cases

Check for Over-Engineering:

  • Unnecessary abstraction: Too many layers for simple logic
  • Premature optimization: Complex code for unmeasured performance
  • Framework overuse: Using heavy library for simple task
  • Feature creep: Adding features not in requirements
  • Gold plating: Excessive polish on non-critical code
  • YAGNI violations: Code for "might need later" scenarios
  • Complexity without benefit: Complicated when simple works

Check for Suboptimal Solutions:

  • Duplication: Copy-pasted code instead of extraction
  • Reinventing wheel: Custom code when standard library exists
  • Wrong tool: Using inappropriate data structure/algorithm
  • Inefficient approach: O(n²) when O(n) is obvious
  • Poor naming: Unclear variable/function names
  • Missing reuse: Existing utilities/types not used
  • Inconsistent patterns: Doesn't match codebase style
  • Technical debt: Quick hack instead of proper solution

Step 5: Check Code Quality

  • Readability: Is code clear and self-documenting?
  • Maintainability: Will this be easy to change later?
  • Testability: Can this be tested easily?
  • Performance: Any obvious performance issues?
  • Security: Any security vulnerabilities?
  • Consistency: Matches existing codebase patterns?

Step 6: Record Findings

Store in memory:

File: path/to/file.ts
Change Type: [New|Modified|Deleted]
Plan Compliance: [Matches|Deviates|Not in plan]
Issues:
  Bad Engineering:
    - [Specific issue with line number]
  Over-Engineering:
    - [Specific issue with line number]
  Suboptimal:
    - [Specific issue with line number]
Severity: [CRITICAL|HIGH|MEDIUM|LOW]

Step 7: Update Todo

Mark file as reviewed in todo list.

Phase 2.5: Issue/Task Coverage Verification (MANDATORY)

CRITICAL: Before completing the review, verify that 100% of the original issue/task requirements are implemented.

Step 1: Identify Source Requirements

Locate the original requirements from:

  • GitHub issue (gh issue view <number>)
  • PR description referencing issues
  • Task ticket or plan file in .plans/
  • Commit messages describing the work

Step 2: Extract ALL Requirements

Create exhaustive checklist:

  • Functional requirements (what it should do)
  • Acceptance criteria (how to verify)
  • Edge cases mentioned
  • Error handling requirements

Step 3: Verify Each Requirement

# Requirement Status Evidence
1 [requirement] ✅/❌/⚠️ file:line or "Missing"

Step 4: Coverage Assessment

Requirements Coverage = (Implemented / Total) × 100%

Anything less than 100% = REQUEST CHANGES immediately

Add to report:

## Issue/Task Coverage

**Source**: [Issue #X / Plan file]
**Coverage**: X% (Y of Z requirements)

### Missing Requirements
- ❌ [Requirement X]: Not implemented
- ❌ [Requirement Y]: Partially implemented - [what's missing]

**VERDICT**: Coverage incomplete. Cannot approve until 100% implemented.

Phase 3: Cross-File Analysis

After reviewing all files:

Step 1: Architectural Impact

  • How do changes affect overall system architecture?
  • Are there breaking changes?
  • Do changes introduce new dependencies?
  • Is there architectural drift from the plan?

Step 2: Pattern Consistency

  • Are changes consistent with each other?
  • Do they follow same patterns?
  • Any conflicting approaches?

Step 3: Completeness Check

  • Are all related changes present?
  • Missing files that should be changed?
  • Orphaned references?

Phase 4: Generate Review Report

Create report at .reviews/code-review-[timestamp].md:

# Code Review Report
**Date**: [timestamp]
**Branch**: [branch name]
**Related Plan**: [plan file or "None"]
**Files Changed**: X
**Issues Found**: Y

---

## Executive Summary
- **Critical Issues**: X (must fix before merge)
- **High Priority**: Y (should fix)
- **Medium Priority**: Z (consider fixing)
- **Low Priority**: W (suggestions)

**Overall Assessment**: [APPROVE|REQUEST CHANGES|REJECT]

---

## Plan Compliance (if applicable)

### Matches Plan ✅
- Feature X implemented correctly
- Architecture follows design
- File naming conventions followed

### Deviates from Plan ⚠️
- Implementation differs from planned approach in [area]
- Missing feature Y from plan
- Scope creep: Added Z not in plan

### REMOVAL SPEC Status
- ✅ Old code removed from `file.ts:50-100`
- ❌ Legacy function still exists in `auth.ts:42` (should be removed)

---

## Issues by Severity

### CRITICAL: Bad Engineering

#### Logic Bug in `src/services/auth.ts:125`
```typescript
// Current code:
if (user.role = 'admin') { // Assignment instead of comparison
  grantAccess()
}

Issue: Assignment operator used instead of equality check. This always evaluates to true and grants everyone admin access. Severity: CRITICAL - Security vulnerability Fix: Change = to ===

Unhandled Promise in src/api/client.ts:67

// Current code:
fetchData().then(data => process(data)) // No error handling

Issue: Promise rejection not handled, will crash silently Severity: CRITICAL - Application stability Fix: Add .catch() or use try/catch with async/await

HIGH: Over-Engineering

Unnecessary Abstraction in src/utils/formatter.ts

// Current code: 50 lines of abstraction
class FormatterFactory {
  createFormatter(type: string): IFormatter { /* ... */ }
}
class StringFormatter implements IFormatter { /* ... */ }
// ... only used once for simple string formatting

Issue: Complex factory pattern for single use case Severity: HIGH - Maintenance burden Better Approach: Simple function formatString(value: string): string

MEDIUM: Suboptimal Solutions

Code Duplication in src/components/

Files: user-form.tsx, admin-form.tsx Issue: Both contain identical validation logic (30 lines duplicated) Severity: MEDIUM - Maintenance issue Better Approach: Extract to src/utils/form-validation.ts

Not Using Existing Type in src/types/user.ts

// Current code:
interface UserData {
  id: string
  email: string
  name: string
}
// But `User` type already exists with same fields in `src/models/user.ts`

Issue: Duplicate type definition Severity: MEDIUM - Type inconsistency risk Fix: Import and use existing User type

LOW: Suggestions

Verbose Naming in src/services/database-connection-manager.ts

Issue: Overly verbose filename Suggestion: Simplify to src/services/database.service.ts


Issues by Category

Bad Engineering (X issues)

  • Logic bugs: X
  • Missing error handling: Y
  • Type issues: Z
  • Missing validation: W

Over-Engineering (Y issues)

  • Unnecessary abstraction: X
  • Premature optimization: Y
  • Feature creep: Z

Suboptimal Solutions (Z issues)

  • Code duplication: X
  • Reinventing wheel: Y
  • Poor naming: Z
  • Not using existing code: W

Architectural Assessment

Positive Changes

  • Clean separation of concerns in new modules
  • Proper use of dependency injection
  • Good test coverage added

Concerns

  • New dependency introduced without discussion
  • Breaking change to public API
  • Coupling between previously independent modules

Technical Debt Introduced

  • Quick hack in auth.ts:200 marked with TODO
  • Temporary file temp-processor.ts added
  • Migration code that should be removed later

Detailed File Reviews

src/services/auth.ts (Modified)

Plan Compliance: Matches Changes: 45 lines added, 20 removed Issues:

  • CRITICAL: Logic bug at line 125 (assignment vs equality)
  • HIGH: Missing error handling at line 89 Positive:
  • Good use of existing types
  • Clear function names

src/components/user-form.tsx (New)

Plan Compliance: Not in plan (scope creep) Changes: 150 lines added Issues:

  • MEDIUM: Duplicates logic from admin-form.tsx
  • LOW: Could use existing form validation utility Positive:
  • Clean component structure
  • Good TypeScript usage

[Continue for all changed files]


Statistics

By Severity:

  • Critical: X
  • High: Y
  • Medium: Z
  • Low: W

By Category:

  • Bad Engineering: X
  • Over-Engineering: Y
  • Suboptimal: Z

By File Type:

  • Services: X issues
  • Components: Y issues
  • Utils: Z issues

Recommendations

Must Fix (Before Merge)

  1. Fix logic bug in auth.ts:125 - Security issue
  2. Add error handling in client.ts:67 - Stability issue
  3. Remove temporary file temp-processor.ts - Plan violation

Should Fix

  1. Extract duplicated validation logic
  2. Simplify over-abstracted formatter
  3. Use existing types instead of duplicates

Consider

  1. Rename verbose files
  2. Add more inline documentation
  3. Improve variable naming in complex functions

Overall Assessment

Recommendation: REQUEST CHANGES

Reasoning:

  • 2 critical security/stability issues must be fixed
  • Over-engineering in several areas adds unnecessary complexity
  • Code duplication will cause maintenance issues
  • Some scope creep not discussed in plan

After Fixes: Changes will be solid. Core implementation is sound, just needs cleanup and bug fixes.


### Phase 5: Summary for User

Provide concise summary:

```markdown
# Code Review Complete

## Assessment: [APPROVE|REQUEST CHANGES|REJECT]

## Critical Issues (X)
- Security bug in `auth.ts:125` - assignment vs equality
- Unhandled promise in `client.ts:67` - will crash

## High Priority (Y)
- Over-engineering in `formatter.ts` - unnecessary abstraction
- Missing error handling in multiple files

## Medium Priority (Z)
- Code duplication between forms
- Not using existing types

## Plan Compliance
- ✅ Core features implemented correctly
- ⚠️ Some scope creep (user-form not in plan)
- ❌ REMOVAL SPEC incomplete (legacy code still exists)

## Must Fix Before Merge
1. Fix logic bug in auth.ts
2. Add error handling
3. Remove legacy code per REMOVAL SPEC

**Full Report**: `.reviews/code-review-[timestamp].md`

Critical Principles

  • NEVER EDIT FILES - This is review only, not implementation
  • BE THOROUGH - Review every changed file
  • BE SPECIFIC - Point to exact line numbers
  • BE CONSTRUCTIVE - Explain why and suggest better approach
  • CHECK PLAN - If plan exists, verify compliance
  • VERIFY REMOVAL SPEC - Ensure old code was removed
  • IDENTIFY PATTERNS - Note systemic issues across files
  • BE HONEST - Don't approve bad code to be nice
  • SUGGEST ALTERNATIVES - Don't just criticize, help improve

Success Criteria

A complete code review includes:

  • 100% of issue/task requirements verified as implemented
  • All changed files reviewed
  • Plan compliance verified (if plan exists)
  • All engineering issues identified and categorized
  • Severity assigned to each issue
  • Specific line numbers referenced
  • Alternative approaches suggested
  • Overall assessment provided
  • Structured report generated

CRITICAL: If issue/task coverage is less than 100%, the review MUST request changes regardless of code quality.