edit
Replace an exact, unique string in an existing file. Use for targeted single-occurrence edits to files from the IPython kernel instead of rewriting the whole file.
- License 许可
- MIT
- 最近更新
- 2026-08-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- edit
- description
- Replace an exact, unique string in an existing file. Use for targeted single-occurrence edits to files from the IPython kernel instead of rewriting the whole file.
02 资源文件 3
- 其他.gitignore34 B
- 其他pyproject.toml262 B
- 脚本src/edit/__init__.py2.4 KB
03 SKILL.md 正文
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(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 "..."
04 同仓库更多 Skills
valid-skill
A valid skill for testing purposes.
unknown-field
A skill with an unknown frontmatter field.
nested-child
Nested skill should be ignored.
root-skill-preferred
Root skill should win.
python-skill
A Python-backed skill for testing.
python-package-missing
A Python skill missing its import package.