principle-minimize-reader-load
Make code quicker to trace. Use when code is hard to follow: count the layers between question and answer and the hidden state a reader must hold, collapse one-caller wrappers, shrink mutable scope.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- principle-minimize-reader-load
- description
- Make code quicker to trace. Use when code is hard to follow: count the layers between question and answer and the hidden state a reader must hold, collapse one-caller wrappers, shrink mutable scope.
- user-invocable
- false
03 SKILL.md 正文
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. Working memory is finite for agents and humans alike.
- 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.
04 同仓库更多 Skills
writing-for-agents
Write docs that agents read (skills, AGENTS.md, CLAUDE.md). Use when creating or editing a skill, or changing AGENTS.md or CLAUDE.md.
unslop
Make prose sound human, not AI-written. Use whenever you write a PR description, commit message, doc, README, release note, post, email or UI copy, or when asked to unslop or de-AI text.
tutor
Run a study session from my exam plan and progress files in the study repo. Use when I say study, teach me, quiz me, practice for an exam, or check whether I really understand a topic.
threads
Start, steer and read T3 threads on my laptop or Mac mini from either machine. Use to move a thread to the Mac, get a Windows check from the laptop, manage threads on both, or answer a message from the other machine.
statechart
Check a TLA+ model and draw it as a Mermaid statechart, with the shortest path to each broken rule. Use for /statechart, to read a TLC result, or to show a bug as a path through states.
sol-loop
Review a change with GPT Sol in a loop until we both agree. Use when I say "sol loop".