mcpbeat

Patch Edit

nexu-io/patch-edit

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

694 tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
83386
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/nexu-io/open-design --skill patch-edit

What comes with it

868 bytes besides the instruction
open-design.json

The instruction itself

6 sections, as written by the author

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.

How to use it

Copy the folder

Take nexu-io/patch-edit from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.