Install any skill in seconds. Free to start, no credit card required.
Get Started Free →agentscope-ai/apply-patch
Apply multi-file or tricky edits atomically with git apply instead of many fragile edit_file calls.
Passed 7 of 14 test cases with the skill, and 6 of 14 without it.
and 4 more in the full report
4 fixed7 passed either way8 still failing3 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
When performing a multi-file edit using patches, what is the order of operations between validation, application, diff creation, and post-application verification?
| Checked | Without skill | With skill |
|---|---|---|
| Creates the diff file before validating with git apply --check. | Passed | Passed |
| Applies the patch with git apply before calling verify-changes. | Missed | Passed |
The instructions your model reads when the skill loads.
The built-in edit_file does an exact string match on a single file and has no fuzzy
tolerance. For multi-file changes, or when edit_file keeps failing to find the string,
construct a unified diff and apply it atomically with git.
Write the unified diff to a file in the sandbox (use write_file or a heredoc via execute):
diff --git a/path/to/file b/path/to/file
--- a/path/to/file
+++ b/path/to/file
@@ -10,7 +10,7 @@ context line
-old line
+new line
Validate before applying: git apply --check changes.patch
Apply: git apply changes.patch (use -p0 if paths are not a/...b/...).
If git apply rejects the hunk, the surrounding context is stale — read_file the exact
lines again, regenerate the diff with correct context, and retry.
edit_file exact-match struggles.git diff).Always run the verify-changes skill afterwards.
test cases passed, vs 6 / 14 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.