AGENT SKILL

principle-minimize-reader-load

Use when shaping or reviewing code that is hard to follow, deciding whether new indirection or state is worth it, or writing output for people. Reduce the indirections and hidden mutable state a reader has to track.

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 1.6k
Forks
491

01 前言 Front Matter

name
principle-minimize-reader-load
description
Use when shaping or reviewing code that is hard to follow, deciding whether new indirection or state is worth it, or writing output for people. Reduce the indirections and hidden mutable state a reader has to track.
disable-model-invocation
true

03 SKILL.md 正文

Minimize reader load

Measure maintainability by how hard a reader must work to understand the code. Two separate axes set that effort: the number of hops between a question and its answer, and the amount of hidden or changeable state the reader has to keep in mind.

When it applies

Reviewing or shaping hard-to-follow code, deciding whether new indirection or new state is justified, and writing anything people will read, including verdicts and reports. It is a lens you always hold, not a procedure with preconditions.

What to do

  1. Treat line counts, cyclomatic complexity, and architectural tidiness as proxies. Reader effort is the target.
  2. Guard both axes. They vary independently. A flat file full of globals can be as hard to read as a deep stack of adapters.
  3. Delete layers whose cost exceeds their benefit: wrappers with one caller, interfaces with one implementation, and indirection added for a future that never came. Inline them.
  4. Require each layer to change the abstraction. A layer that forwards the same methods with the same arguments is pass-through, so collapse it.
  5. Prefer interfaces that hide meaningful decisions. A broad interface that conceals little forces readers to learn its surface and its internals as well.
  6. Narrow the scope of state. From most to least preferred: pure functions that return values instead of mutating, then local variables, then object fields, then module-level state, and globals last. Compute values instead of keeping copies synchronized.
  7. State each invariant one time, where data enters, and let consumers rely on it.
  8. Any new indirection or state must remove at least as much reader load somewhere else as it introduces.
  9. Apply the half-minute test: a newcomer should be able to say where a value comes from and what can change it in about thirty seconds.

Reader load is a security property. A permission check that a reviewer has to trace through four decorators and a mutable global request context is a check that reviewers stop verifying. An authorization decision a reader can find and confirm in one function is one they will actually audit.

The failure it prevents

Deep wrapper stacks, hidden global state, and invariants restated in every consumer.

Done when

The half-minute test passes.

principle-guard-the-context-window is the agent analog of this principle.

Related: principle-guard-the-context-window, principle-laziness-protocol, principle-boundary-discipline.

04 同仓库更多 Skills

hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-review-with-annotations

Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-find-and-synthesize-context

Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-create-or-update-docs

Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-create-or-manage-records

Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-create-or-manage-interactive-html

Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

worktable-collaborate-threads

Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.

★ 1.6k