Marketplace

reviewing-readability

Code readability review based on "The Art of Readable Code" and Miller's Law (7±2). Triggers: 可読性, 理解しやすい, わかりやすい, 明確, 命名, 変数名, 関数名, ネスト, 深いネスト, 関数設計, コメント, 複雑, 難しい, 難読, Miller's Law, ミラーの法則, 認知負荷, AI-generated, 過剰設計.

allowed_tools: Read, Grep, Glob, Task

$ 安裝

git clone https://github.com/thkt/claude-config /tmp/claude-config && cp -r /tmp/claude-config/skills/reviewing-readability ~/.claude/skills/claude-config

// tip: Run this command in your terminal to install the skill


name: reviewing-readability description: > Code readability review based on "The Art of Readable Code" and Miller's Law (7±2). Triggers: 可読性, 理解しやすい, わかりやすい, 明確, 命名, 変数名, 関数名, ネスト, 深いネスト, 関数設計, コメント, 複雑, 難しい, 難読, Miller's Law, ミラーの法則, 認知負荷, AI-generated, 過剰設計. allowed-tools:

  • Read
  • Grep
  • Glob
  • Task agent: readability-reviewer user-invocable: false

Readability Review - Code Clarity & Cognitive Load

Target: New team member understands code in < 1 minute.

Miller's Law Limits (7±2)

ContextIdealMaximum
Function arguments35
Class methods57
Conditional branches35
Function length5-10 lines15 lines
Nesting depth23

Section-Based Loading

SectionFileFocusTriggers
Control Flowreferences/control-flow.mdNesting, guard clausesネスト, Miller's Law
Commentsreferences/comments-clarity.mdWhy not What, intentコメント, 意図
AI Antipatternsreferences/ai-antipatterns.mdOver-engineering detectionAI-generated, 過剰設計

Note: Naming conventions → @../../patterns/code/naming.md

Quick Checklist

Naming

  • Concrete over abstract (validateUserEmail not processData)
  • Searchable, pronounceable names
  • Intent is obvious from name

Control Flow

  • Nesting depth ≤ 3
  • Guard clauses for early returns
  • Complex conditions extracted to functions

Comments

  • Explain "why", not "what"
  • Update or delete outdated comments
  • Code is self-documenting first

AI Code Smells

  • No premature abstractions (interface for single impl)
  • No unnecessary classes for simple tasks
  • No "future-proof" flexibility nobody asked for

Key Principles

PrincipleApplication
Clarity > ClevernessSimple code wins
Respect 7±2 limitBreak into chunks
Tell, Don't AskDirect method calls

References

  • [@../../skills/applying-code-principles/SKILL.md] - Cognitive limits science
  • [@../../rules/development/READABLE_CODE.md] - Detailed guidelines
  • @./references/ai-antipatterns.md - AI over-engineering patterns