surgical-patch Skill for Claude: Fix Bugs at the Narrowest Layer
surgical-patch makes your coding assistant fix a bug in the smallest responsible place and prove the fix.
- Installs
- 111.6K
- on skills.sh
- Stars
- 116.7K
- on GitHub
- Files
- 1
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
surgical-patch tells the assistant to reproduce the failure first when that is cheap, or otherwise collect the strongest evidence it can. It traces the symptom to the mechanism that owns the wrong behavior and changes only that layer. It leaves unrelated behavior and your own changes alone, and skips cleanup, renaming and new abstractions outside the fix.
It loads for bug fixes and small behavior changes where regression proof matters. It runs focused proof plus the nearest affected gate, and stops once the failure is fixed and the regression proof passes. It bundles no scripts.
Good for
- Developers fixing a bug without a wider rewrite
- Reviewers who want small, focused diffs
- Teams that require a regression test with each fix
Install surgical-patch
Claude Code
- 1
Copy this prompt.
Install the surgical-patch skill in Claude Code. Run this command: npx skills add https://github.com/juliusbrussee/caveman --skill surgical-patch Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests matter.
Key facts
- Installs on skills.sh
- 111,593 (as of 2026-11-02)
- License
- Apache-2.0
- Last repo commit
- 2026-11-01
- Files in the skill folder
- 2 files: SKILL.md and agents/openai.yaml
- skills.sh audits
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: pass
What it includes
Reproduce the failure, or collect the best evidence
Reproduces the failure first when that is economical; otherwise captures the strongest available evidence.
Runs code ·
Reproduce firstTrace the symptom to the responsible mechanism
Traces the symptom to the mechanism responsible for it.
Read ·
Find the ownerChange only the layer that owns the wrong behavior
Changes the narrowest layer that owns the incorrect behavior.
Write ·
Narrowest layerKeep unrelated behavior and your own edits
Preserves unrelated behavior and user changes.
Leave the restNo cleanup, renaming or abstraction outside the fix
Avoids cleanup, renaming and abstraction outside the fix.
No extrasAdd relevant regression proof, run focused checks, stop
Adds only regression proof relevant to the task, runs focused proof plus the nearest affected gate, and stops when the failure is fixed and the proof passes.
Runs code ·
Prove and stop
From the official docs
Permissions
Low risk
The skill has the assistant edit your code and run your tests, so the risk is a wrong edit, not a data leak.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It edits code and runs tests
It changes the layer that owns the bug and runs your checks. Work on a branch and review the diff before you merge.
Questions
What does the surgical-patch skill do?
It makes the assistant fix a bug in the smallest responsible place. It reproduces the failure, changes only the layer that owns it, adds relevant regression proof, and stops.
How do I install surgical-patch in Claude Code, the Claude app or Codex?
Use the install box at the top of the page and pick your client. The SKILL.md bundles no scripts and lists no other requirements. The folder also includes an agents/openai.yaml file. The README says your agent picks these work patterns up when a task fits, so you do not need to call it by name.
Does surgical-patch need an API key or an account?
No. The SKILL.md asks for no key, login or tool. It is plain instructions for the assistant, and it bundles no scripts.
Is surgical-patch safe to use?
It is a short instruction file and bundles no scripts. What it changes is how the assistant behaves when it edits your project, so review the diff and keep your usual git and test setup. The permissions section below lists what to watch.
How is surgical-patch different from safe-refactor?
surgical-patch changes behavior on purpose, in one place, to fix a bug. safe-refactor changes structure while keeping behavior identical. Use surgical-patch for a fix and safe-refactor for a restructuring.
Information
updated Nov 2, 2026
- Repository
- juliusbrussee/caveman
- Folder
skills/surgical-patch
Sources
Docs, issue trackers and discussions this page is built from.
Show all 4Hide
- surgical-patch SKILL.md · github.com
- caveman README · github.com
- surgical-patch openai.yaml · github.com
- safe-refactor SKILL.md · github.com