Skip to content
Skillpedia
General coding101k · #527

patch-edit

Helps your agent make small changes to the code one at a time. This makes it easier to review and ensure everything works well.

What it does

This tool helps make small changes to programming code one at a time. Instead of changing everything at once, it applies one small fix or improvement at a time, making it easier for people to review and understand the changes.

When to use it

  • ✓When you need to fix a small bug in code.
  • ✓When adding a small, testable new feature.
  • ✓To improve a specific part of the code without affecting the rest.

Example of what to ask your AI

“I want to apply the next step of the refactoring plan to the 'utils.js' file.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

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

Ready-to-paste message

Use this skill to help me: https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/patch-edit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool takes a plan with multiple steps and applies each step individually. After each step, it records what was done, allowing you to see the progress and approve the next changes.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add nexu-io/open-design --skill patch-edit

Or download just the file:

curl -L https://raw.githubusercontent.com/nexu-io/open-design/main/plugins/_official/atoms/patch-edit/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from 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.

FAQ

Why not change the whole file at once?

Changing entire files at once makes them hard to review and identify errors. Making small changes at a time makes the process safer and easier to audit.

What happens after a step is applied?

The tool saves a detailed record of the change made, including which files were altered and why. This creates a history of modifications.

Can I skip a step?

Yes, but you need to record the reason why the step was skipped. This ensures all decisions are documented.

Details

Original description by the author

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

Popularity

GitHub stars
101k
Ranking position
#527
License
Apache-2.0
Updated
10/16/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills