Edit

SkillFiles & storage

The edit skill replaces one exact, unique string in an existing file with new text, changing only that spot instead of rewriting the whole file. It is meant for targeted single-occurrence edits to files from the Python kernel, and it can also be called from a shell cell. The edit fails if the target string is missing or appears more than once.

Then ask your AI: use the Edit skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Have an existing file whose text you want to change at one spot.

What your AI can do with it

  • Replace one exact string in an existing file with new text
  • Call edit directly from the Python kernel with path, old_str and new_str
  • Run the same edit from a shell cell with --path, --old-str and --new-str
  • Return a short confirmation after a successful replacement
  • Raise an error when old_str is missing or matches more than once

Getting started

  1. Have an existing file whose text you want to change at one spot.
  2. Pick an old_str snippet that appears exactly once in that file.
  3. From the Python kernel, call await edit(path="pkg/file.py", old_str=old, new_str=new).
  4. If the text contains triple double quotes, use triple single-quoted variables or build old and new from inspected file slices.
  5. Alternatively, run the edit from a shell cell with !edit --path pkg/file.py --old-str "..." --new-str "...".

What this skill tells your AI

The instructions your AI receives, as published by primeintellect-ai/prime-agent in skills/edit/SKILL.md and read by Ahel’s review.

Make a targeted edit to an existing file by replacing one exact, unique occurrence of a string. old_str must appear exactly once in the file.

Call directly from the kernel:

await edit(path="pkg/file.py", old_str=old, new_str=new)

Use exact old/new strings. If the text contains triple double quotes, use triple single-quoted variables (old = '''...''') or build old/new from inspected file slices. Returns a short confirmation; raises if old_str is missing or matches more than once (widen the snippet to make it unique).

Or from a shell cell:

!edit --path pkg/file.py --old-str "..." --new-str "..."

Signals

GitHub stars
22k
Forks
2k
Last commit
Oct 2026

Questions

What happens if the target string is missing or appears more than once?
The edit raises an error. When old_str matches more than once, widen the snippet so it is unique, then try again.
Can I call it from a shell cell?
Yes. Run !edit --path pkg/file.py --old-str "..." --new-str "..." from a shell cell.
How do I handle text that contains triple double quotes?
Use triple single-quoted variables such as old = '''...''' or build old and new from inspected file slices.
Advanced
Item type
skill
Key
edit-primeintellect-ai
Source
github.com/primeintellect-ai/prime-agent