Principle Laziness Protocol

作者 cursorccb5507cec15无许可证10K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Apply when refactoring, evaluating diff size, or tempted to add abstractions, layers, or signal threading. Bias toward deletion and the smallest change that solves the problem.

AI 生成的概览

指导重构时优先删除、缩小改动并保持扁平调用层级,而非新增抽象。

功能
该技能提供一套用于重构和代码审查的编码准则:优先删除而非新增、保持调用层级扁平、把重复决策集中到单一事实来源,并尽量缩小改动范围。它还建议质疑那些要求把新信号贯穿类型、模式或管线的任务,并清除细小的透传和重复选择。它产出的是指导原则和判断标准,而不是文件或代码产物。
适用场景
适用于重构代码、评估改动是否过大,或某项变更似乎需要引入新抽象、新层级或信号贯穿时。它旨在推动采用能解决问题的最小改动。
运行要求
无需任何工具、软件包、运行时、凭据或网络访问;它仅为说明性指令,不附带脚本。

Laziness Protocol

Aim for the most result with the least code and complexity.

  • Prefer deletion. When asked to refactor or improve, look for removals before additions.
  • Maintain a flat call hierarchy. Avoid deep call chains. A rich interface that hides substantial work is not a deep call chain. If answering a question requires tracing through more than 3 files or layers, flatten it.
  • Consolidate decisions. Do not repeat the same choice in several places. Put it behind one source of truth and pass the result as a simple flag.
  • Minimize the diff. Make the smallest change that solves the problem. Fewer lines beat "elegant" boilerplate.
  • Question the threading. If a task asks you to pass a new signal through types, schemas, pipelines, or similar layers, stop and look for a more direct path.
  • Sweat the small leaks. Remove tiny pass-throughs, representation leaks, and duplicated choices before they spread. Small leaks compound into permanent coordination costs.

The test: If a human developer would find the code exhausting to maintain, it is a bad solution.

来源与署名

来源:cursor/plugins位于pstack/skills/principle-laziness-protocol提交ccb5507

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架