edit

GitHub

用于在现有文件中精准替换唯一字符串的编辑技能。通过精确匹配旧文本并替换为新文本,实现单处修改,避免重写整个文件。适用于从Python内核或Shell调用,确保修改的原子性和准确性。

packages/coding-agent/skills/edit/SKILL.md PrimeIntellect-ai/prime-agent

Trigger Scenarios

需要修改文件中特定且唯一的代码片段 执行单点文本替换而非全文件重写

Install

npx skills add PrimeIntellect-ai/prime-agent --skill edit -g -y
More Options

Non-standard path

npx skills add https://github.com/PrimeIntellect-ai/prime-agent/tree/main/packages/coding-agent/skills/edit -g -y

Use without installing

npx skills use PrimeIntellect-ai/prime-agent@edit

指定 Agent (Claude Code)

npx skills add PrimeIntellect-ai/prime-agent --skill edit -a claude-code -g -y

安装 repo 全部 skill

npx skills add PrimeIntellect-ai/prime-agent --all -g -y

预览 repo 内 skill

npx skills add PrimeIntellect-ai/prime-agent --list

SKILL.md

Frontmatter
{
    "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(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 "..."

Version History

  • bc0fa76 Current 2026-08-27 09:01

Same Skill Collection

packages/coding-agent/skills/agent-message/SKILL.md
packages/coding-agent/skills/agent-observe/SKILL.md
packages/coding-agent/skills/attach-image/SKILL.md
packages/coding-agent/skills/compact/SKILL.md
packages/coding-agent/skills/goal/SKILL.md
packages/coding-agent/skills/linear/SKILL.md
packages/coding-agent/skills/notion/SKILL.md
packages/coding-agent/skills/prime-intellect/SKILL.md
packages/coding-agent/skills/refine/SKILL.md
packages/coding-agent/skills/rlm-heartbeat/SKILL.md
packages/coding-agent/skills/skill-creator/SKILL.md
packages/coding-agent/skills/websearch/SKILL.md
packages/coding-agent/examples/extensions/dynamic-resources/SKILL.md

Metadata

Files
0
Version
bc0fa76
Hash
5e687f0d
Indexed
2026-08-27 09:01

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-28 02:59
浙ICP备14020137号-1 $Map of visitor$