principle-subtract-before-you-add
它能做什么
为智能体提供一条在添加新功能之前先简化的规则。适合代码库随时间变得臃肿的团队。
适用场景
- ✓当你即将为代码中混乱或臃肿的部分添加功能的时候。
- ✓当计划进行重构或重写的时候。
- ✓当存在死代码路径、冗余验证器或空引用的时候。
技能链接
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-subtract-before-you-add/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在我们添加新的导出功能之前,请清理该模块中的死代码和不需要的检查。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会先删除死代码、冗余的验证器和空的存根引用,然后在更简单的基础上构建新工作。它按实际使用情况设计,而不是为推测中的边界情况设计。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Subtract Before You Add
When evolving a system, remove complexity first, then build. Default to subtraction.
Make simplification a continual investment. Leave the design slightly simpler and more capable behind the same or smaller surface than you found it.
- Sequence removal before construction
- Cut before you polish (get to the minimum before investing in quality)
- Design for observed usage, not speculative edge cases
- No speculative validators, parsers, or guards beyond what the spec demands
- Simplify prompts (remove redundant instructions, excessive templates)
- When a reference has no novel content, delete it rather than leaving a stub
常见问题
这是否意味着删除一切?
不是。它只删除已死或不需要的内容,并依据观察到的使用情况进行设计,而不是依靠猜测。
应该先追求质量吗?
该技能主张,在投入打磨之前,先削减到最小化。
存根引用怎么办?
当一个引用没有新的内容时,该技能主张删除它,而不是保留存根。
详情
作者的原始描述
Apply when sequencing an addition, refactor, or rewrite. Remove dead code, redundant validators, and stub references first, then build on the simpler base.
repo: cursor/plugins
热度
- GitHub 星标
- 15k
- 排名
- #10989
- 许可证
- —
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
advisor
15k如果你开启该功能,让你的智能体在关键节点咨询一个更强的第二模型,例如在重大决定之前,或在错误上卡住时。
check-agent-compatibility
15k全面检查 AI 编程智能体能否启动、验证和记录某个代码仓库,并返回一个兼容性评分以及主要问题。
cli-for-agents
15k教你的智能体设计或审查命令行工具,使 AI 智能体无需提示即可运行,并提供清晰的帮助文字和示例。
continual-learning
15k通过把回顾过往对话的工作交给专门的记忆更新程序,使你的 AGENTS.md 笔记保持最新。