agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/apply-patch/SKILL.md
Apply multi-file or tricky edits atomically with git apply instead of many fragile edit_file calls. Use when changing several files at once or when edit_file fails to match.
npx skillsauth add agentscope-ai/agentscope-java apply-patchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
documentation
四层技能合成、技能市场、自学习闭环
documentation
Four-layer skill composition, skill marketplaces, the self-learning loop
tools
# 技能(Skill) 一个 skill 就是一份写好的能力包:一个目录里放一份 `SKILL.md`(说明用途、给 agent 看的指令),可以再带一些参考文档、脚本或样例。写好后丢给 agent,它会在合适的时候自己用。 harness 让你从两个地方装 skill: - **接 skill 市场**:Git 仓库、Nacos、MySQL、classpath、或者自己写的后端 - **放在工作区**:项目里 `workspace/skills/` 下的就所有人共用;放在 `<userId>/skills/` 下的只有那个用户看得到 两类来源同时生效,不需要二选一。 > 关于 skill 自身的结构、`SKILL.md` 写法、资源加载、tool 绑定、代码执行这些通用概念,见 [Agent Skill](../task/agent-skill.md)。本文只讲 harness 这一层的用法。 --- ## 一个例子 把团队的 skill 仓库接进来,agent 立刻就能用: ```java HarnessAgent agent = HarnessAgent.bui
data-ai
Answer a quantitative business question by writing a SQL query against the data warehouse, validating it, and presenting the result. Use when the user asks "how many...", "what's the trend of...", "compare X vs Y over...", "what's our top N...", or anything that resolves to a query against tabular data. Produces a small result table plus the underlying query.