Langsung ke konten
Skillpedia
Pemrograman umum15k · #10981

principle-minimize-reader-load

Fungsinya

Memberi asisten aturan untuk menjaga kode tetap mudah dibaca orang. Cocok untuk tim yang kodenya sulit ditelusuri karena pembungkus, tidak langsung, atau state bersama.

Kapan dipakai

  • ✓Saat kode sulit ditelusuri dari pertanyaan ke jawaban.
  • ✓Saat sebuah pembungkus hanya memiliki satu pemanggil atau sebuah adapter tidak punya penggunaan kedua.
  • ✓Saat state global atau yang bisa diubah membuat perilaku sulit diprediksi.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-minimize-reader-load/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Modul ini punya lima lapis pembungkus yang melakukan hal yang sama. Sederhanakan agar pengembang baru bisa mengikutinya.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Asisten menghitung lapisan di antara sebuah pertanyaan dan jawabannya, serta state tersembunyi yang harus dilacak pembaca. Ia meruntuhkan pembungkus yang biayanya lebih besar daripada manfaatnya, lebih memilih fungsi murni, dan mempersempit state ke cakupan terkecil yang berguna.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.

Pertanyaan umum

Apakah jumlah baris menjadi tujuan?

Tidak. Skill ini menyatakan bahwa usaha pembaca lebih penting daripada jumlah baris atau skor kompleksitas.

Kapan sebuah lapisan harus dihapus?

Ketika ia menambah usaha pembaca tanpa manfaat nyata, seperti pembungkus dengan satu pemanggil.

Bagaimana dengan state?

Utamakan fungsi murni dan nilai lokal dibanding field, state modul, atau global.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
15k
Peringkat
#10981
Lisensi
—
Diperbarui
31/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa