Reducing Entropy

作者 softaworks3027f20f3181无许可证2.5K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库7个月前更新

Manual-only skill for minimizing total codebase size. Only activate when explicitly requested by user. Measures success by final code amount, not effort. Bias toward deletion.

AI 生成的概览

引导智能体以删除为优先,通过衡量最终代码量来最小化代码库总规模。

功能
提供一套仅手动启用的决策框架,用于缩减代码库总规模,核心是三个问题:最小可行结果是什么、变更是否减少总代码量、以及可以删除什么。它列出若干警示信号,例如维持现状的偏见和增加灵活性,并说明该方法不适用的情形。它还要求智能体在继续之前,从其参考目录中至少加载一种理念。
适用场景
当用户明确要求缩减代码库规模或进行以删除为导向的重构时使用。它不应自动启用,也不适用于已经足够精简的代码库、约定很强的框架,或法规与合规要求规定的结构。
运行要求
无需脚本或工具,仅为说明性指令。智能体需要能够读取随附的参考 Markdown 文件,包括 references 目录和 adding-reference-mindsets.md。

Reducing Entropy

More code begets more code. Entropy accumulates. This skill biases toward the smallest possible codebase.

Core question: "What does the codebase look like after?"

Before You Begin

Load at least one mindset from references/

  1. List the files in the reference directory
  2. Read frontmatter descriptions to pick which applies
  3. Load at least one
  4. State which you loaded and its core principle

Do not proceed until you've done this.

The Goal

The goal is less total code in the final codebase - not less code to write right now.

  • Writing 50 lines that delete 200 lines = net win
  • Keeping 14 functions to avoid writing 2 = net loss
  • "No churn" is not a goal. Less code is the goal.

Measure the end state, not the effort.

Three Questions

1. What's the smallest codebase that solves this?

Not "what's the smallest change" - what's the smallest result.

  • Could this be 2 functions instead of 14?
  • Could this be 0 functions (delete the feature)?
  • What would we delete if we did this?

2. Does the proposed change result in less total code?

Count lines before and after. If after > before, reject it.

  • "Better organized" but more code = more entropy
  • "More flexible" but more code = more entropy
  • "Cleaner separation" but more code = more entropy

3. What can we delete?

Every change is an opportunity to delete. Ask:

  • What does this make obsolete?
  • What was only needed because of what we're replacing?
  • What's the maximum we could remove?

Red Flags

  • "Keep what exists" - Status quo bias. The question is total code, not churn.
  • "This adds flexibility" - Flexibility for what? YAGNI.
  • "Better separation of concerns" - More files/functions = more code. Separation isn't free.
  • "Type safety" - Worth how many lines? Sometimes runtime checks in less code wins.
  • "Easier to understand" - 14 things are not easier than 2 things.

When This Doesn't Apply

  • The codebase is already minimal for what it does
  • You're in a framework with strong conventions (don't fight it)
  • Regulatory/compliance requirements mandate certain structures

Reference Mindsets

See references/ for philosophical grounding.

To add new mindsets, see adding-reference-mindsets.md.


Bias toward deletion. Measure the end state.

来源与署名

来源:softaworks/agent-toolkit位于skills/reducing-entropy提交3027f20

许可证: 无许可证

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

举报或申请下架