本文へスキップ
Skillpedia
一般的なプログラミング101k · #987

patch-edit

できること

このツールは、プログラムのコードに小さな変更を一つずつ加えるのに役立ちます。一度にすべてを変えるのではなく、小さな修正や改善を一度に一つ適用するため、人が変更内容をレビューして理解しやすくなります。

使う場面

  • ✓コードの小さなバグを修正するとき
  • ✓小さく、テストできる新機能を追加するとき
  • ✓他の部分に影響を与えずに、コードの特定の部分を改善するとき

スキルのリンク

https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/patch-edit/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/patch-edit/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“「utils.js」ファイルに、リファクタリング計画の次のステップを適用してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

ツールは複数のステップからなる計画を受け取り、各ステップを個別に適用します。各ステップの後には何を行ったかを記録するので、進捗を確認し、次の変更を承認できます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Patch edit

Spec §20.3 / §21.3.2: code-migration / tune-collab cannot ship a trustworthy diff when the agent rewrites whole files in one pass — the reviewer can't audit the change. This atom enforces "one step per turn, smallest possible localised edit".

Inputs

  • plan/steps.json from rewrite-plan.
  • The current value of iterations (the daemon's per-stage counter).
  • code/index.json for the file's known imports + neighbours.

Output

The atom mutates files inside the project cwd via the file-edit tool. After every iteration, it writes a per-step receipt:

project-cwd/
└── plan/
    ├── steps.json (status updated: 'pending' → 'completed' | 'skipped')
    └── receipts/
        └── step-<id>.json    # { files: ['...'], diffSummary, rationale, completedAt }

Convergence

The atom completes when every step in plan/steps.json is in a terminal state (completed / skipped) OR iterations >= OD_MAX_DEVLOOP_ITERATIONS. Use:

{
  "id": "patch-edit-loop",
  "atoms": ["patch-edit"],
  "repeat": true,
  "until": "plan.steps.terminal === plan.steps.total || iterations >= 8"
}

Anti-patterns the prompt fragment forbids

  • Rewriting an entire file when the rewrite-plan step is localised.
  • Touching a file outside the step's files[].
  • Touching a shell-tier file when the step's risk is not 'high' or the user hasn't confirmed.
  • Skipping a step without a receipt + a rationale string.

Status

Implemented by the daemon runner in apps/daemon/src/plugins/atoms/patch-edit.ts. It validates step ownership and risk, applies unified diffs with atomic writes, and records receipts and progress.

よくある質問

なぜファイル全体を一度に変更しないのですか?

ファイル全体を一度に変えると、レビューが難しくなり、エラーを見つけにくくなります。少しずつ変更するほうが、安全で監査もしやすくなります。

ステップを適用した後はどうなりますか?

ツールは、変更されたファイルとその理由を含め、行った変更の詳しい記録を保存します。これにより変更の履歴が作られます。

ステップを飛ばすことはできますか?

はい、ただしステップを飛ばした理由を記録する必要があります。これにより、すべての判断が記録されます。

詳細

作者による元の説明

Apply one rewrite-plan step at a time as small reviewable file edits, never rewriting whole files when a localised change suffices.

repo: nexu-io/open-design

人気

GitHubのスター
101k
ランキング
#987
ライセンス
Apache-2.0
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル