principle-minimize-reader-load

Reviews code for excessive indirection layers and hidden mutable state to reduce reader cognitive load.

4|1|Updated Dec 16, 2023
One-click install
npx skills add https://github.com/Shtian/AuthentiClash --skill principle-minimize-reader-load-shtian
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-minimize-reader-load
Source: https://github.com/Shtian/AuthentiClash/tree/main/.claude/skills/principle-minimize-reader-load
Command: npx skills add https://github.com/Shtian/AuthentiClash --skill principle-minimize-reader-load-shtian

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code that is hard to trace forces readers to jump through wrapper layers and hold hidden mutable state in their heads, making maintenance slow and error-prone. This Skill gives you a concrete framework to measure and reduce that reader load. ## Core Features & Use Cases - Layer Analysis: Counts indirections between a question and its answer, flagging one-caller wrappers, pass-through adapters, and speculative abstractions for inlining. - State Scope Reduction: Guides shrinking mutable scope from globals to module state, fields, locals, and pure functions, preferring derivation over synchronization. - Use Case: During a code review of a service with six adapter layers and scattered module-level state, apply this Skill to identify which layers add no compression and which state can be derived, then refactor so a new reader can answer "where does X come from?" in under 30 seconds. ## Quick Start Ask the AI to review a hard-to-trace module using the minimize reader load principle and suggest which layers to collapse and which state to shrink.

Frequently Asked Questions about principle-minimize-reader-load

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make hard-to-trace code easier to understand?▼

Count the layers between a question and its answer, then collapse wrappers with one caller and adapters with no second implementation. Also shrink mutable state scope by preferring pure functions, locals over fields, and derivation over synchronization.

What is reader load in code maintainability?▼

Reader load is the work a reader must do to understand code, measured on two axes: layers of indirection to trace and hidden mutable state to hold in memory. It matters more than proxies like LOC or cyclomatic complexity because code is read far more than it is written.

When should I collapse an abstraction layer?▼

Collapse a layer when it costs more than it saves: wrappers with a single caller, adapters with no second implementation, or pass-through layers that repeat the same methods and arguments. A layer should change the abstraction or hide meaningful decisions.

How do I reduce hidden state in a codebase?▼

Prefer pure functions that return values over mutations, locals over fields, fields over module state, and module state over globals. Derive values instead of syncing them, and name invariants once at the boundary rather than in every consumer.

When is adding a new abstraction layer justified?▼

A new layer or piece of state is justified only if it reduces reader load elsewhere by at least as much as it adds. Test whether a new reader can answer where a value comes from and what can change it in under 30 seconds.