mcpField
P
principle-minimize-reader-load

principle-minimize-reader-load

github.com/mdsmithaustinDevelopment9198 installsUpdated 1d ago
Repository

About principle-minimize-reader-load

A coding skill for reducing the effort readers need to understand code. It helps developers assess indirection and mutable state, and decide when to simplify layers or narrow state scope.

Key features

  1. 01Evaluate tracing layers and hidden state
  2. 02Collapse unnecessary wrappers and adapters
  3. 03Prefer compressed interfaces
  4. 04Reduce mutable state scope
  5. 05State invariants at boundaries

Use cases

  1. 01Reviewing a proposed abstraction
  2. 02Simplifying pass-through layers
  3. 03Tracing where values come from
  4. 04Reducing shared mutable state

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mdsmithaustin/pstack --skill principle-minimize-reader-load

After installing, type/principle-minimize-reader-loadin Claude Code to confirm it loaded.

Bundled filesagents/openai.yaml

Details

From the project README

Minimize Reader Load

Maintainability is the work a reader must do to understand code. Track two axes: layers to trace (indirections between the question and the answer) and state to hold (hidden or mutable context the reader must keep in their head). LOC, cyclomatic complexity, and "clean architecture" are proxies. Reader load is the thing that matters. The two axes are independent. A flat file with 50 globals can be as hard to reason about as a 6-layer adapter stack. Guard both. This is the human analog of Guard the Context Window. Working memory is finite for readers too.

  • Collapse layers that cost more than they save: wrappers with one caller, adapters with no second implementation, speculative indirection that was never needed. Inline them.
  • Make adjacent layers change the abstraction. A layer that repeats the same methods and arguments adds reader load without compression. Collapse pass-through layers.
  • Demand interface compression. A broad interface that hides little complexity makes readers learn both the surface and the implementation. Prefer boundaries that hide meaningful decisions.
  • Shrink state scope: prefer pure functions (returns over mutations), locals over fields, fields over module state, and module state over globals. Derive instead of sync.
  • Name the invariant at the boundary, not in every consumer, so the reader learns it once.
  • Before adding a layer or a piece of state, ask: does it reduce reader load elsewhere by at least as much?

The test: can a new reader answer "where does X come from?" and "what can change X?" in under 30 seconds? If not, cut layers or cut state.

Comments

Markdown supported