AI & Agentslow risk
patch-edit
Apply one rewrite-plan step at a time as small reviewable file edits, never rewriting whole files when a localised change suffices.
nexu-io/open-design·plugins/_official/atoms/patch-edit/SKILL.md
61/ 100推薦值
匯入這個 Skill
選擇你的 coding agent,複製專案級或個人級安裝指令。
匯入目前專案.agents/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a codex -y匯入個人環境~/.agents/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a codex -g -y匯入目前專案.claude/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a claude-code -y匯入個人環境~/.claude/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a claude-code -g -y匯入目前專案.agents/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a github-copilot -y匯入個人環境~/.copilot/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a github-copilot -g -y匯入目前專案.agents/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a cursor -y匯入個人環境~/.cursor/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a cursor -g -y匯入目前專案.agents/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a gemini-cli -y匯入個人環境~/.gemini/skills/patch-edit
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/patch-edit -a gemini-cli -g -yNative Gemini CLI
gemini skills install https://github.com/nexu-io/open-design.git --scope workspace --path plugins/_official/atoms/patch-edit⚠ 安裝指令使用開源 skills CLI。執行前請檢查來源、腳本與權限。
Skill 指令
在 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:
```text
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:
```jsonc
{
"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
Reserved id, prompt-only fragment in v1.