surgical-patch — Claude Code skill: what it does, how to install
The skill constrains AI coding agents to the narrowest layer responsible for a bug. It prevents unwanted refactoring and demands focused regression checks.
npx skills add JuliusBrussee/caveman --skill surgical-patch -a claude-codeWhat surgical-patch does
This skill directs the agent to reproduce failures before touching any files. It traces symptoms down to the exact mechanism at fault. Unrelated code remains untouched. The agent modifies only the narrowest layer that owns the bug.
The instructions explicitly rule out cosmetic cleanups and renames outside the immediate fix. The agent writes a targeted regression proof and runs the nearest affected gate. Once the proof passes, work stops immediately. If you want broad module restructuring, skip this skill.
What it helps with
- reproduce failures before editing code
- isolate bug fixes to the narrowest layer
- prevent accidental refactoring and renaming
- add focused regression tests for specific defects
Example prompts for the agent
- Use surgical-patch to fix the null session error in auth middleware
- Fix the token expiration bug without touching surrounding handlers
How to install surgical-patch
1Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill surgical-patch -a claude-code2Manually: put the files in place
~/.claude/skills/surgical-patch/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/surgical-patch/
1Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill surgical-patch -a codex2Manually: put the files in place
.agents/skills/surgical-patch/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill surgical-patch -a cursor2Manually: put the files in place
.cursor/skills/surgical-patch/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install JuliusBrussee/caveman surgical-patch2Manually: put the files in place
.github/skills/surgical-patch/SKILL.md1Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill surgical-patch -a gemini-cli2Platform CLI
gemini skills install https://github.com/JuliusBrussee/caveman --path skills/surgical-patchManually: put the files in place
.devin/skills/surgical-patch/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill surgical-patch -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set22
The whole set →Similar
Questions about surgical-patch
How to install surgical-patch in Claude Code?
Run npx skills add JuliusBrussee/caveman --skill surgical-patch -a claude-code in your terminal. This downloads the skill into your local agent configuration.
What does surgical-patch do?
It enforces strict discipline on bug fixes. The model must isolate the failure mechanism, keep unrelated code intact, and verify the fix with a targeted test.
Does surgical-patch allow general code cleanup?
No, the instructions explicitly forbid renaming and abstraction outside the immediate patch. The agent must stop as soon as the regression check passes.
Source text
SKILL.md · Apache-2.0
--- name: surgical-patch description: Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests matter. --- # 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.
© JuliusBrussee · Apache-2.0 · JuliusBrussee/caveman