360 Secure SkillHub
360 安全技能中心

principle-minimize-reader-load

该 Skill 提供一套代码审阅与重构原则,用于减少读者理解代码时的追踪层数和隐藏状态;建议内联单调用包装器、缩小状态范围,并以读者能否快速回答变量来源和变更点作为检验。

分类:开发
cursor
热度 48.31
最近更新 2026-11-17 11:40:35

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add cursor/plugins/principle-minimize-reader-load
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
principle-minimize-reader-load
description
Apply when reviewing or shaping code that's hard to trace. Count layers between question and answer, and hidden state in the reader's head; collapse one-caller wrappers and shrink mutable scope.
disable-model-invocation
true

Minimize Reader Load

Reader load is the work a reader must do to understand code. It has two independent axes: layers to trace between the question and the answer, and hidden or mutable state to hold in their head. Guard both.

  • Collapse layers that only forward: wrappers with one caller, adapters with no second implementation, pass-through methods. Inline them.
  • Shrink state scope: returns over mutations, locals over fields, fields over module state, module state over globals. Derive instead of sync.
  • Name an invariant once at the boundary, not in every consumer.

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.