跳到正文
Skillpedia
通用编程33k · #8896

reducing-entropy

它能做什么

这项技能促使你的智能体让代码库尽可能小,以留下的代码总量来衡量改动。适合想削减臃肿代码的开发者,且只在你要求时运行。

适用场景

  • ✓当你明确要求减少项目中的代码量时。
  • ✓当代码库已经变得臃肿,你想找出可以删除的部分时。
  • ✓当某项拟议改动会增加代码,你想检查是否有更小的方案的时候。

技能链接

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/productivity/reducing-entropy/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/productivity/reducing-entropy/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想找出这个模块里可以删除的部分。请使用 reducing-entropy,并让最终代码库尽可能小。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会加载该技能的一种思维方式,询问最小的结果是否可以只有更少的函数甚至没有函数,在每次改动前后统计行数,并优先删除。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.

常见问题

它会自动运行吗?

不会。这项技能只能手动触发,只有在你明确请求时才会启用。

代码越少一定越好吗?

这项技能以最终代码量来衡量成功,因此即使某项改动看起来更整洁,只要增加了行数,也可能被否决。

它的核心问题是什么?

改动之后,代码库会是什么样子?

详情

作者的原始描述

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.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8896
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能