本文へ移動
cccskills
無料GitHub で公開

apply-patch

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md1.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Apply Patch

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.

Procedure

  1. 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
    
  2. Validate before applying: git apply --check changes.patch

  3. Apply: git apply changes.patch (use -p0 if paths are not a/...b/...).

  4. 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.

When to prefer this

  • Editing 3+ files for one logical change (atomic, all-or-nothing).
  • Repetitive or whitespace-sensitive edits where edit_file exact-match struggles.
  • Re-applying a patch produced elsewhere (e.g. from a PR or git diff).

Always run the verify-changes skill afterwards.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Expert Java developer skill for AgentScope Java framework - a reactive, message-driven multi-agent system built on Project Reactor. Use when working with reactive programming, LLM integration, agent orchestration, multi-agent systems, or when the user mentions AgentScope, ReActAgent, Mono/Flux, Project Reactor, or Java agent development. Specializes in non-blocking code, tool integration, hooks, pipelines, and production-ready agent applications.

日本語の概要は準備中です。原文の説明を表示しています。

agentscope-ai/agentscope-java5,9462026年10月12日 更新

Visualise the result of an analysis as a chart (line, bar, area, scatter, etc.). Use when the user asks to "plot...", "chart...", "show me the trend of...", "visualise...", or when a numerical result has more than ~10 rows and would be easier to read as a picture. Produces an image file plus the script that generated it.

日本語の概要は準備中です。原文の説明を表示しています。

agentscope-ai/agentscope-java5,9462026年10月12日 更新

Search a codebase efficiently with ripgrep regular expressions, file globs, and git history search. Use to locate symbols, usages, and definitions instead of reading whole files.

日本語の概要は準備中です。原文の説明を表示しています。

agentscope-ai/agentscope-java5,9462026年10月12日 更新

Statistical data analysis skill — use when the user asks to analyze numbers, compute statistics, or summarize datasets.

日本語の概要は準備中です。原文の説明を表示しています。

agentscope-ai/agentscope-java5,9462026年10月12日 更新

Starter skill template. Replace the body with your own playbook before relying on it; this stub exists only to teach the workspace layout.

日本語の概要は準備中です。原文の説明を表示しています。

agentscope-ai/agentscope-java5,9462026年10月12日 更新

Use git as a safety net - create a checkpoint commit before risky or large changes and roll back cleanly if a change makes things worse. Use before multi-file refactors.

日本語の概要は準備中です。原文の説明を表示しています。

agentscope-ai/agentscope-java5,9462026年10月12日 更新

agentscope-ai のスキルをすべて見る

このスキルの問題を報告する