Apply a Git-style diff hunk to a file. Feed a diff hunk (plus new line, minus remove). Use when the user wants to apply a patch or diff.
Git-style patch applicator. You feed it a diff hunk — lines with + (add) or - (remove), optionally context lines (space-prefixed). The skill applies the hunk to the file.
Call run_skill with skill: "apply-patch". Set command or arguments.action to apply (or apply-patch).
Example hunk:
const x = 1;
- const old = true;
+ const updated = false;
Use when the user says things like:
The skill finds where the hunk applies (by matching context), then applies add/remove. Fails if the context does not match the file.
apply_patch_apply
description: Apply a Git-style diff hunk to a file. path and hunk required.
parameters:
path: string
hunk: string