Patch edit

From nexu-io/open-design · View interactive version

Patch edit is an AI agent skill from the GitHub repository nexu-io/open-design. Apply one rewrite-plan step at a time as small reviewable file edits, never rewriting whole files when a localised change suffices.

How to use this skill

Skill file

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

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

'high' or the user hasn't confirmed.

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.