---
id: gh-surgical-patch
name: "surgical-patch"
url: https://skills.yangsir.net/skill/gh-surgical-patch
author: juliusbrussee
domain: ai-code-generation-quality
tags: ["bug-fixing", "regression-testing", "minimal-change", "code-quality"]
install_count: 100000
rating: 4.80 (120 reviews)
github: https://github.com/juliusbrussee/caveman/tree/main/skills/surgical-patch
---

# surgical-patch

> 该技能专注于以最窄责任层修复代码缺陷和微小行为变更，保留无关行为与用户改动，避免不必要的清理、重命名或重构。适用于需要回归证明与任务相关测试的场景，帮助开发者快速定位问题根因，最小化变更集，通过聚焦测试验证修复，显著降低回归风险，提升修复效率与代码稳定性。

**Stats**: 100,000 installs · 4.8/5 (120 reviews)

## Before / After 对比

### 缺陷修复效率与回归风险

**Before**:

在没有此技能时，开发者遇到缺陷往往在代码中盲目定位，修改范围容易扩大，引发周边模块回归，且缺乏针对性的回归证明，修复时间较长。

**After**:

该 Skill 沿缺陷症状追踪至最窄责任层，改动聚焦且保留用户既有改动，通过聚焦回归测试快速验证，修复时间明显缩短，周边行为保持稳定。

| Metric | Before | After | Change |
|---|---|---|---|
| 修复时长 | 240分钟 | 90分钟 | -62.5% |

## Readme

# 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.


---
*Source: https://skills.yangsir.net/skill/gh-surgical-patch*
*Markdown mirror: https://skills.yangsir.net/api/skill/gh-surgical-patch/markdown*