← ClaudeAtlas

use-context-reviewer-readabilitylisted

コードの可読性レビュー。セキュリティ (use-context-reviewer-security)、エラーハンドリング (use-context-reviewer-silence)、テスト設計 (use-context-reviewer-testability) には使わない。
thkt/dotclaude · ★ 12 · AI & Automation · score 76
Install: claude install-skill thkt/dotclaude
# use-context-reviewer-readability しきい値は、作業記憶や 1 画面集中といった認知限界と、McCabe complexity のような確立されたメトリクスに基づく。下表は推奨値で、検出表はそれを超えた全件でなく報告に値する逸脱だけを挙げる。関数引数の推奨は 3、検出は 5 超。 | 目標 | 推奨値 | 根拠 | | ------------ | ------ | ----------------------------------- | | 関数行数 | ≤30 | 1 画面の可読性 | | ファイル行数 | ≤400 | モジュールレベルの認知上限 | | ネスト深度 | ≤3 | 作業記憶内での分岐追跡 | | 関数引数 | ≤3 | 引数順の暗記限界 | | 循環的複雑度 | ≤10 | McCabe 1976: パス爆発なくテスト可能 | ## 検出 | ID | パターン | 修正 | | --- | ------------------------------ | -------------------------- | | RD1 | 曖昧な `processData()` | `validateUserEmail()` | | RD1 | 誤解を招く識別子 | 名前は意図を表す | | RD2 | ネスト > 3 階層 | guard clause、関数抽出 | | RD2 | 関数 > 30 行 | 分解 | | RD3 | コメント: `// increment i` | 自明なので削除 | | RD3 | コメント: `// TODO: fix later` | issue 化または今修正 | | RD4 | 単一実装の interface | 2 つ目の実装が出るまで削除 | | RD4 | 状態を持たないロジックの class | 純粋関数 | | RD5 | 関数引数 > 5 | 設定オブジェクトまたは分解 | ## 参照ファイル | トピック | ファイル | | --------------- | -------------------------------------------------- | | Control Flow | ${CLAUDE_SKILL_DIR}/references/control-flow.md | | Comments | ${CLAUDE_SKILL_DIR}/references/comments-clarity.md | | AI Antipa