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

fresh-eyes-review

コミットやPR作成前の最終確認として、セキュリティやロジック、ビジネスルールの潜在的なバグを検出するSkill。

📜 元の英語説明(参考)

This skill should be used as a mandatory final sanity check before git commit, PR creation, or declaring work done. Triggers on "commit", "push", "PR", "pull request", "done", "finished", "complete", "ship", "deploy", "ready to merge". Catches security vulnerabilities, logic errors, and business rule bugs that slip through despite passing tests.

🇯🇵 日本人クリエイター向け解説

一言でいうと

コミットやPR作成前の最終確認として、セキュリティやロジック、ビジネスルールの潜在的なバグを検出するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

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

🎯 この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-17
取得日時
2026-05-17
同梱ファイル
1

📖 Skill本文(日本語訳)

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

Fresh-Eyes レビュー

基本原則

「Fresh-Eyes レビューなしにコミットしない」

これは、実装の完了、テストの合格、およびピアレビューのに実行される最終的な品質ゲートです。この規律は、明示的なスキル発動がなくても普遍的に適用されます。

主な違い

Fresh-Eyes レビューは、テストやコードレビューとは根本的に異なります。

アプローチ 焦点 盲点
テスト 期待される動作を検証する 未知のエッジケースをテストできない
コードレビュー パターンと品質 レビュアーは作成者の意図を信頼する
Fresh-Eyes 心理的距離を置いて意図的に再読する 正しいと思っていたものを見つける

重要な洞察: 「100% のテストカバレッジと合格シナリオ」は、「発見を待つ重大なバグ」と共存し得ます。

必須プロセス

ステップ 1 - コミットメントの宣言

明示的に「[N] 個のファイルの Fresh-Eyes レビューを開始します。これには 2~5 分かかります。」と宣言します。

この宣言は、説明責任を生み出し、あなたの考え方を実装から監査へと再構築します。

ステップ 2 - セキュリティ脆弱性チェックリスト

影響を受けるすべてのファイルについて、セキュリティ上の問題がないかレビューします。

脆弱性 確認事項
SQL インジェクション すべてのデータベースクエリでパラメーター化されたステートメントを使用し、文字列連結は決して使用しない
XSS すべてのユーザー提供コンテンツは、HTML でレンダリングする前にエスケープされている
パストラバーサル ファイルパスが検証され、../ シーケンスが拒否または正規化されている
コマンドインジェクション シェルコマンドにサニタイズされていないユーザー入力が含まれていない
IDOR リソースはアクセス制御されており、推測不可能な ID だけでなく保護されている
認証バイパス すべての保護されたエンドポイントで認証と認可がチェックされている

発見例:

// Before: SQL injection vulnerability
const user = await db.query(`SELECT * FROM users WHERE id = '${userId}'`);

// After: Parameterized query
const user = await db.query('SELECT * FROM users WHERE id = $1', [userId]);

ステップ 3 - ロジックエラーチェックリスト

エラータイプ 確認事項
オフバイワン 配列インデックス、ループ境界、ページネーション制限
競合状態 共有状態への同時アクセス、非同期操作
Null/undefined すべての . チェーンで例外が発生する可能性があるか。防御的なチェックが存在するか。
型強制 ===== の違い、暗黙的な型変換
状態の変更 入力パラメーターに予期しない副作用がないか。
エラーの無視 空の catch ブロック、無視された Promise の拒否

発見例:

// Before: Off-by-one in pagination
const hasMore = results.length < pageSize;

// After: Correct boundary
const hasMore = results.length === pageSize;

ステップ 4 - ビジネスルールチェックリスト

チェック 質問
計算 数式は要件と完全に一致しているか。通貨の丸めは正しいか。
条件 AND と OR のロジックは正しいか。否定は適切に適用されているか。
エッジケース 空の入力、単一項目、最大値、ゼロ値はどうか。
エラーメッセージ ユーザーフレンドリーか。機密情報が漏洩していないか。
デフォルト値 オプションフィールドが省略された場合、適切なデフォルト値が設定されているか。

発見例:

// Before: Tax calculation uses wrong rounding
const tax = price * 0.08;

// After: Proper currency rounding
const tax = Math.round(price * 0.08 * 100) / 100;

ステップ 5 - パフォーマンスチェックリスト

問題 確認事項
N+1 クエリ データベース呼び出しを行うループはバッチ処理されるべき
無制限ループ 最大反復回数、タイムアウト保護
メモリリーク イベントリスナーが削除されているか、ストリームが閉じられているか、参照がクリアされているか
インデックスの欠落 クエリはインデックス付き列でフィルタリング/ソートされているか
大きなペイロード ページネーションは実装されているか。応答サイズは制限されているか。

ステップ 6 - 直ちに修正

完了を宣言する前に発見事項に対処します。

  1. 修正を行う
  2. 問題をカバーするテストを追加する(存在しない場合)
  3. 全テストスイートを再実行する
  4. リンター/型チェッカーを再実行する

ステップ 7 - 結果の宣言

必須の発表:

Fresh-Eyes 完了。[N] 件の問題が発見され、修正されました。
- [各問題と修正の簡単な説明]

発見がゼロの場合でもこれを含めてください。それは実行を証明します。

所要時間

ファイル数 予想所要時間
1~3 ファイル 2 分
4~10 ファイル 3~4 分
10+ ファイル 最大 5 分

警告サイン:

  • 2 分より速い場合は、深さが不十分であることを示唆します。
  • 5 分を超える場合は、スコープクリープを示します。変更されたコードに集中してください。

拒否すべき抵抗パターン

以下の正当化は明示的に拒否されなければなりません。

正当化 現実
「テストは包括的です」 テストは設計を検証するものであり、正確性を検証するものではありません
「正しいと確信しています」 自信はバグと反比例します
「パートナーが待っています」 今 3 分かければ、後でデバッグに 3 時間かかるのを防げます
「本番環境がブロックされています」 急ぐことが、急いで修正しようとしている障害の原因になります
「シニア開発者がすでに承認しました」 彼らは意図をレビューしたのであり、実装の詳細をレビューしたのではありません
「ほんの小さな変更です」 小さな変更が大きな障害を引き起こします

これらの状況は、まさに重大なバグが本番環境に漏れるときを表しています。

ワークフロー例

User: 「認証機能の実装が終わったので、コミットします」
Assistant: [fresh-eyes-review スキルをトリガー]

4 ファイルの Fresh-Eyes レビューを開始します。これには 2~5 分かかります。

[auth.ts をセキュリティについてレビュー]
- 発見: メールフィールドの入力検証が不足
- 修正: メール形式の検証を追加

[handler.ts をロジックについてレビュー]
- 発見: ページネーションでオフバイワンエラー
- 修正: 境界チェックで < を <= に変更

[db.ts をパフォーマンスについてレビュー]
- 問題なし

[api.ts をビジネスルールについてレビュー]
- 問題なし

テストを再実行中... すべてのテストが合格

Fresh-Eyes 完了。2 件の問題が発見され、修正されました。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Fresh-Eyes Review

Core Principle

"NO COMMIT WITHOUT FRESH-EYES REVIEW FIRST"

This represents a final quality gate executed after implementation completion, passing tests, and peer review. The discipline applies universally, even without explicit skill activation.

Key Distinctions

Fresh-eyes review differs fundamentally from testing and code review:

Approach Focus Blind Spots
Testing Validates expected behavior Can't test for unknown edge cases
Code review Patterns and quality Reviewer trusts author's intent
Fresh-eyes Deliberate re-reading with psychological distance Catches what you thought was correct

Critical insight: "100% test coverage and passing scenarios" can coexist with "critical bugs" waiting discovery.

Required Process

Step 1 - Announce Commitment

Explicitly declare: "Starting fresh-eyes review of [N] files. This will take 2-5 minutes."

This announcement creates accountability and reframes your mindset from implementation to audit.

Step 2 - Security Vulnerability Checklist

Review all touched files for security issues:

Vulnerability What to Check
SQL Injection All database queries use parameterized statements, never string concatenation
XSS All user-provided content is escaped before rendering in HTML
Path Traversal File paths are validated, ../ sequences rejected or normalized
Command Injection Shell commands don't include unsanitized user input
IDOR Resources are access-controlled, not just unguessable IDs
Auth Bypass Every protected endpoint checks authentication and authorization

Example finding:

// Before: SQL injection vulnerability
const user = await db.query(`SELECT * FROM users WHERE id = '${userId}'`);

// After: Parameterized query
const user = await db.query('SELECT * FROM users WHERE id = $1', [userId]);

Step 3 - Logic Error Checklist

Error Type What to Check
Off-by-one Array indices, loop bounds, pagination limits
Race conditions Concurrent access to shared state, async operations
Null/undefined Every . chain could throw; defensive checks present?
Type coercion == vs ===, implicit conversions
State mutations Unexpected side effects on input parameters?
Error swallowing Empty catch blocks, ignored promise rejections

Example finding:

// Before: Off-by-one in pagination
const hasMore = results.length < pageSize;

// After: Correct boundary
const hasMore = results.length === pageSize;

Step 4 - Business Rule Checklist

Check Questions
Calculations Do formulas match requirements exactly? Currency rounding correct?
Conditions AND vs OR logic correct? Negations applied properly?
Edge cases Empty input, single item, maximum values, zero values?
Error messages User-friendly? Leak no sensitive information?
Default values Sensible defaults when optional fields omitted?

Example finding:

// Before: Tax calculation uses wrong rounding
const tax = price * 0.08;

// After: Proper currency rounding
const tax = Math.round(price * 0.08 * 100) / 100;

Step 5 - Performance Checklist

Issue What to Check
N+1 queries Loops that make database calls should be batched
Unbounded loops Maximum iterations, timeout protection
Memory leaks Event listeners removed, streams closed, references cleared
Missing indexes Queries filter/sort on indexed columns?
Large payloads Pagination implemented? Response size bounded?

Step 6 - Fix Immediately

Address findings before declaring completion:

  1. Make the fix
  2. Add test covering the issue (if not present)
  3. Re-run full test suite
  4. Re-run linter/type checker

Step 7 - Declare Results

Mandatory announcement:

Fresh-eyes complete. [N] issues found and fixed:
- [Brief description of each issue and fix]

Include this even for zero findings—it proves execution.

Time Commitment

File Count Expected Duration
1-3 files 2 minutes
4-10 files 3-4 minutes
10+ files 5 minutes max

Warning signs:

  • Faster than 2 minutes suggests insufficient depth
  • More than 5 minutes indicates scope creep—stay focused on the changed code

Resistance Patterns to Reject

The following rationalizations must be explicitly rejected:

Rationalization Reality
"Tests are comprehensive" Tests validate design, not correctness
"I'm confident it's correct" Confidence is inversely correlated with bugs
"Partner is waiting" 3 minutes now saves 3 hours debugging later
"Production is blocked" Rushing causes the outages being rushed to fix
"Senior dev already approved" They reviewed intent, not implementation details
"It's just a small change" Small changes cause large outages

These circumstances represent precisely when critical bugs escape into production.

Example Workflow

User: "I'm done implementing the auth feature, let me commit"
Assistant: [Triggers fresh-eyes-review skill]

Starting fresh-eyes review of 4 files. This will take 2-5 minutes.

[Reviews auth.ts for security]
- Found: Missing input validation on email field
- Fixed: Added email format validation

[Reviews handler.ts for logic]
- Found: Off-by-one error in pagination
- Fixed: Changed < to <= in boundary check

[Reviews db.ts for performance]
- No issues found

[Reviews api.ts for business rules]
- No issues found

Re-running tests... All tests pass

Fresh-eyes complete. 2 issues found and fixed.