跳到正文
Skillpedia
通用编程117k · #759

surgical-patch

它能做什么

这个技能指导 AI 修复一个 bug 或进行小范围改动,同时不触碰无关的代码。适合希望获得可靠、专注修复的开发者。

适用场景

  • ✓当某项功能坏了,你需要能用的最小修复的时候。
  • ✓当你希望修复 bug 时,不对其他代码进行重命名或重组的时候。
  • ✓当你需要添加回归测试,来证明 bug 不会再次出现的时候。

技能链接

https://github.com/JuliusBrussee/caveman/blob/main/skills/surgical-patch/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“上次更新后登录按钮不能用了,你能找出原因,并只修复那一部分吗?”

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

工作原理

AI 首先尝试复现问题,然后把它追溯到负责的代码。它只修改该层,并运行有针对性的测试来确认修复有效。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Surgical patch

Reproduce failure first when economical; otherwise capture strongest available evidence.

  • Trace symptom to responsible mechanism.
  • Change narrowest layer that owns incorrect behavior.
  • Preserve unrelated behavior and user changes.
  • Avoid cleanup, renaming, and abstraction outside fix.
  • Add only regression proof relevant to task.

Run focused proof plus nearest affected gate. Stop when failure is fixed and regression proof passes.

常见问题

AI 会重写我代码的其他部分吗?

不会。该技能要求它避免与修复无关的清理、重命名和抽象。

如果无法复现 bug 怎么办?

该技能会要求 AI 改为收集现有的最有力证据。

它怎么知道修复有效?

它运行有针对性的测试以及最相近的相关检查,确认问题已消失,且没有其他地方被破坏。

详情

作者的原始描述

Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests matter.

repo: JuliusBrussee/caveman

热度

GitHub 星标
117k
排名
#759
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能