Pular para o conteúdo
Skillpedia
Código em geral15 mil · #10981

principle-minimize-reader-load

O que ela faz

Dá ao assistente uma regra para manter o código fácil de ler para as pessoas. É para equipes cujo código é difícil de rastrear por causa de wrappers, indireções ou estado compartilhado.

Quando usar

  • ✓Quando o código é difícil de rastrear da pergunta até a resposta.
  • ✓Quando um wrapper tem apenas um chamador ou um adaptador não tem um segundo uso.
  • ✓Quando um estado global ou mutável torna o comportamento difícil de prever.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-minimize-reader-load/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Este módulo tem cinco camadas de wrappers que fazem a mesma coisa. Simplifique-o para que um novo desenvolvedor consiga acompanhar.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O assistente conta as camadas entre uma pergunta e sua resposta, e o estado oculto que o leitor precisa acompanhar. Ele colapsa wrappers que custam mais do que economizam, prefere funções puras e restringe o estado ao menor escopo útil.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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.

Perguntas frequentes

O objetivo é ter menos linhas de código?

Não. A skill diz que o esforço de quem lê importa mais do que o número de linhas ou escores de complexidade.

Quando uma camada deve ser removida?

Quando ela aumenta o esforço de leitura sem benefício real, como um wrapper com um único chamador.

E o estado?

Prefira funções puras e valores locais a campos, estado de módulo e variáveis globais.

Detalhes

Descrição original do autor

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

Popularidade

Estrelas no GitHub
15 mil
Posição no ranking
#10981
Licença
—
Atualizada em
31/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas