caveman--surgical-patch

Fix bugs at the narrowest responsible layer with regression proof.

Updated Dec 3, 2025
One-click install
npx skills add https://github.com/hhenrichsen/dots --skill caveman-surgical-patch-hhenrichsen
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: caveman--surgical-patch
Source: https://github.com/hhenrichsen/dots/tree/main/dot_skills/caveman/surgical-patch
Command: npx skills add https://github.com/hhenrichsen/dots --skill caveman-surgical-patch-hhenrichsen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bug fixes often balloon into unrelated refactors, renames, and cleanups that introduce new regressions and make reviews painful. This Skill enforces a disciplined patching workflow that changes only the layer responsible for the incorrect behavior and proves the fix with focused tests. ## Core Features & Use Cases - Root-Cause Tracing: Reproduce the failure when economical, then trace the symptom to the mechanism that owns the incorrect behavior. - Minimal Change Discipline: Modify only the narrowest responsible layer while preserving unrelated behavior and existing user changes. - Regression Proof: Add only task-relevant regression tests, then run the focused proof plus the nearest affected gate before stopping. - Use Case: A validation function rejects valid input after a recent change. Use this Skill to reproduce the failure, patch only the validation logic, and add a single regression test proving the fix without touching surrounding code. ## Quick Start Use $surgical-patch to fix this bug with a narrow verified change.

Frequently Asked Questions about caveman--surgical-patch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a bug without breaking surrounding code?▼

Trace the symptom to the mechanism that owns the incorrect behavior, then change only that narrowest responsible layer. Preserve unrelated behavior and user changes, and avoid cleanup, renaming, or abstraction outside the fix.

How to write regression tests for a bug fix?▼

Add only regression proof relevant to the task, reproducing the original failure before the fix when economical. Run the focused proof plus the nearest affected gate, and stop once the failure is fixed and the proof passes.

What if I cannot reproduce the bug before fixing it?▼

When reproduction is not economical, capture the strongest available evidence of the failure instead. Then trace the symptom to the responsible mechanism and proceed with the narrow fix and regression proof.

When should I not use a surgical patch approach?▼

Avoid it when the incorrect behavior stems from a flawed design spanning multiple layers, since narrow fixes cannot address structural problems. It is also unsuited for intentional refactors or feature work requiring broad changes.

Why do bug fixes sometimes cause new regressions?▼

Regressions often come from unrelated cleanup, renaming, or abstraction bundled into the fix. Limiting changes to the narrowest responsible layer and running the nearest affected gate reduces that risk.