Skip to content
Back to skills

Edit

ASecurity

Replace an exact, unique string in an existing file. Use for targeted single-occurrence edits to files from the Python kernel instead of rewriting the whole file.

  • 24 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added November 8, 2026
toolspythonshellbashapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 8, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill edit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Edit?

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

Security grade badge for Edit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-edit/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-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: edit
description: Replace an exact, unique string in an existing file. Use for targeted single-occurrence edits to files from the Python kernel instead of rewriting the whole file.
---

# Edit

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.run(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).

If the `edit` CLI is installed in the host environment, invoke it through
host-mediated shell execution:

    result = await bash('edit --path pkg/file.py --old-str "..." --new-str "..."')

Use the Python API for complex strings to avoid shell quoting mistakes. Do
not use IPython `!` shell escapes to bypass host approval or sandbox policy.

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 tools →

Comments

Loading comments…

Newsletter

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