通用编程41k · #6554
simplify
它能做什么
这个技能引导智能体整理已经能正常工作的代码,使其更易读、更易维护。适合希望降低复杂度且不引入新缺陷的开发者。
适用场景
- ✓当代码能运行但难以阅读,你想将其整理干净的时候。
- ✓当行为已经弄清楚,你想降低复杂度的时候。
- ✓当你想要小而可审查的清理步骤,并保持测试通过的时候。
技能链接
https://github.com/codewhale-hq/Codewhale/blob/main/crates/skills/assets/skills/simplify/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
请用这个技能帮我:https://github.com/codewhale-hq/Codewhale/blob/main/crates/skills/assets/skills/simplify/SKILL.md
阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
npx skills add codewhale-hq/Codewhale --skill simplify
下载 SKILL.md,放进智能体的技能文件夹。
curl -L https://raw.githubusercontent.com/codewhale-hq/Codewhale/main/crates/skills/assets/skills/simplify/SKILL.md -o SKILL.md
可以这样问 AI
“我的代码能运行但很乱。请在不改变其功能的前提下帮我简化它?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体先用测试确认当前行为,然后一次只做一个小改动。它会保留每项安全检查,并在每一步之后重新运行验证。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Simplify
When to use
Use after behavior is understood and the user wants clarity or less complexity.
Non-goals
- Do not mix cleanup with speculative refactors that change behavior.
- Do not “simplify” by deleting necessary safety checks.
Workflow
- Confirm current behavior with tests or reproduction.
- Reduce complexity in small, reviewable steps.
- Keep behavior-preserving verification green.
常见问题
这会改变代码的行为吗?
这个技能旨在保持行为不变,并要求智能体始终让验证通过。
它会为了缩短代码而删除安全检查吗?
不会。技能明确说明,不得删除必要的安全检查。
应该把缺陷修复混入清理工作中吗?
不应该。技能说明,应将清理与正确性修复分开进行。
详情
作者的原始描述
Improve clarity and reduce needless complexity after behavior is understood; preserve behavior and keep cleanup separate from correctness fixes.
repo: codewhale-hq/Codewhale
热度
- GitHub 星标
- 41k
- 排名
- #6554
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …