edit

GitHub

用于在现有文件中精准替换唯一字符串,支持Python内核调用和Shell命令。适用于目标明确且仅发生一次的代码修改,避免重写整个文件,通过精确匹配确保编辑安全与高效。

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

Trigger Scenarios

需要修改单个特定代码片段 执行精准的字符串替换操作

Install

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

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

  • 7cbffa7 Current 2026-10-18 17:10

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/edit/SKILL.md
packages/coding-agent/skills/goal/SKILL.md
packages/coding-agent/skills/linear/SKILL.md
packages/coding-agent/skills/mcp/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
skills/agent-message/SKILL.md
skills/agent-observe/SKILL.md
skills/attach-image/SKILL.md
skills/compact/SKILL.md
skills/goal/SKILL.md
skills/mcp/SKILL.md
skills/prime-intellect/SKILL.md
skills/refine/SKILL.md
skills/rlm-heartbeat/SKILL.md
skills/skill-creator/SKILL.md
skills/websearch/SKILL.md
packages/coding-agent/examples/extensions/dynamic-resources/SKILL.md

Metadata

Files
0
Version
7cbffa7
Hash
5e687f0d
Indexed
2026-10-18 17:10

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-19 13:24
浙ICP备14020137号-1