edit

GitHub

用于在现有文件中精确替换唯一字符串,支持内核调用和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
1eee293
Hash
5e687f0d
Indexed
2026-08-27 09:01

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-17 01:31
浙ICP备14020137号-1