Automatically selects appropriate review perspectives based on file type and characteristics. Use when initiating code review to determine which review-points files should be applied.
このskillは、実装ファイルの種別に応じて適切なレビュー観点デッキを自動選択します。
.claude/review-points/*.md)を選択ファイルパターン:
src/utils/*.ts - ユーティリティ関数src/lib/*.ts - ライブラリ関数src/services/*.ts - ビジネスロジック適用観点:
typescript.md (必須) - 型安全性理由: ビジネスロジックの正確性と型安全性が重要
ファイルパターン:
src/types/*.tssrc/**/*.types.ts適用観点:
typescript.md (必須) - 型安全性理由: 型の正確性とnull安全性が重要
ファイルパターン:
src/components/**/*.tsxsrc/pages/**/*.tsxsrc/app/**/*.tsxsrc/App.tsx適用観点:
typescript.md (必須) - 型安全性react-component.md (推奨) - Reactのベストプラクティスproject-structure.md (推奨) - コンポーネント配置理由: Reactのベストプラクティスと型安全性が重要
ファイルパターン:
src/stores/*.ts - Zustand/Redux等src/store/*.tssrc/state/*.ts適用観点:
typescript.md (必須) - 型安全性理由: 状態の型安全性が重要
ファイルパターン:
src/hooks/*.tssrc/hooks/*.tsx適用観点:
typescript.md (必須) - 型安全性react-component.md (推奨) - Reactフックのルール理由: Reactフックのルールと型安全性が重要
ファイルパターン:
src/utils/constants.tssrc/constants/*.tssrc/config/*.ts適用観点:
typescript.md (必須) - 型安全性理由: 定数の型安全性が重要
ファイルパターン:
src/**/*.test.tssrc/**/*.test.tsxsrc/**/*.spec.tssrc/**/*.spec.tsxsrc/__tests__/**/*.ts適用観点:
test-quality.md (必須) - テスト品質チェックtypescript.md (必須) - 型安全性utils.test.ts → 実装ファイル utils.ts の観点を継承Component.test.tsx → react-component.md も適用理由: テストは実装と同じ観点で検証すべき + テスト固有の品質観点
ファイルパターン:
vite.config.tstsconfig.jsonpackage.jsonbiome.json適用観点:
project-structure.md (推奨) - プロジェクト構成理由: プロジェクト全体の構成に影響する
function selectReviewPerspectives(filePath: string): string[] {
const perspectives: string[] = [];
// 全ファイルに適用
perspectives.push('typescript.md');
// テストファイル
if (/\.(test|spec)\.(ts|tsx)$/.test(filePath) || /__tests__\//.test(filePath)) {
perspectives.push('test-quality.md'); // テスト品質チェック(必須)
// 対応する実装ファイルの観点を継承
const implFilePath = filePath
.replace(/\.(test|spec)\.(ts|tsx)$/, '.$1')
.replace(/__tests__\//, '');
perspectives.push(...selectReviewPerspectives(implFilePath).filter(p => p !== 'test-quality.md'));
return [...new Set(perspectives)];
}
// React コンポーネント
if (/\.tsx$/.test(filePath) && /components|pages|app/.test(filePath)) {
perspectives.push('react-component.md');
perspectives.push('project-structure.md');
}
// カスタムフック
if (/hooks\//.test(filePath)) {
perspectives.push('react-component.md');
}
// プロジェクト構造(新規ファイル追加時)
if (isNewFile(filePath)) {
perspectives.push('project-structure.md');
}
// 設定ファイル
if (/vite\.config|tsconfig|package\.json|biome\.json/.test(filePath)) {
perspectives.push('project-structure.md');
}
return [...new Set(perspectives)]; // 重複削除
}
// classify-filesの結果からファイル種別を取得
const filePath = "src/utils/helpers.ts";
// skillを使って観点を自動選択
Use the review-perspective-selector skill to determine appropriate review perspectives for ${filePath}
// 出力例:
// - typescript.md
// review-fileエージェントに渡す
{
"subagent_type": "review-file",
"prompt": `以下の観点ファイルを使用して ${filePath} をレビューしてください:
観点ファイル:
- .claude/review-points/typescript.md
PASS/WARN/FAILで判定してください。`
}
結論: 現状の .claude/review-points/ のままでOK
理由:
.claude/review-points/ = 観点の内容(what).claude/skills/review-perspective-selector/ = 観点の選択ロジック(which)skillにすべき場合:
/tdd-next) での使用### ステップ5: review-file エージェント起動 (Refactor判断)
1. review-perspective-selector skill を使用して観点を選択
2. 選択された観点ファイルを指定してreview-fileエージェントを起動
3. テストファイルも必ず確認
/review-code での使用既存の /review-code コマンドは classify-files エージェントが観点を自動選択しているため、このskillと統合できます。
performance.md)accessibility.md)security.md)test-coverage.md)これらの観点が追加されたら、このskillの選択ロジックを更新してください。