Skip to content
Back to skills

Patch Edit

ASecurity

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

  • 110,788 stars
  • 0 votes
  • 0 copies
  • 12 views
  • Added June 6, 2026
ai-agentsrustshell

Works with

  • terminal

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 6, 2026

npx -y skills add nexu-io/open-design --skill patch-edit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Patch Edit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Patch Edit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nexu-io-patch-edit/badge)](https://www.skillsdirectory.com/skills/nexu-io-patch-edit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: patch-edit
description: Apply one rewrite-plan step at a time as small reviewable file edits, never rewriting whole files when a localised change suffices.
od:
  scenario: code-migration
  mode: edit
---

# 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.

Files in this skill

  • SKILL.md1.7 KB
  • open-design.json827 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.