本文へスキップ
Skillpedia
一般的なプログラミング15k · #10981

principle-minimize-reader-load

できること

このスキルは、コードを人が読みやすく保つための規則を、アシスタントに与えます。ラッパー、間接参照、共有状態のせいで、追跡しにくくなっているチーム向けです。

使う場面

  • ✓質問から答えまでを、コードでたどりにくいとき。
  • ✓ラッパーに呼び出し元が1つしかない、またはアダプターに2つ目の用途がないとき。
  • ✓グローバルや可変の状態のせいで、動作が予測しにくいとき。

スキルのリンク

https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-minimize-reader-load/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-minimize-reader-load/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“このモジュールには、同じことをする5層のラッパーがあります。新しい開発者がたどれるように単純にしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

アシスタントは、質問から答えまでの層の数と、読み手が追う必要のある隠れた状態を数えます。得るものより費用の大きいラッパーをまとめ、純粋な関数を優先し、状態を最も小さい有用な範囲に絞ります。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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.

よくある質問

行数が目標ですか?

いいえ。スキルは、コードの行数や複雑さのスコアよりも、読み手の負担が大切だと述べています。

いつ層を取り除くべきですか?

呼び出し元が1つしかないラッパーなど、実質的な利点がないのに読み手の負担を増やす場合です。

状態についてはどうですか?

フィールド、モジュールの状態、グローバルよりも、純粋な関数やローカルの値を優先します。

詳細

作者による元の説明

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.

repo: cursor/plugins

人気

GitHubのスター
15k
ランキング
#10981
ライセンス
—
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル