Skip to content
cccskills
FreePublished on GitHub

edit-file

Edit file by exact string replacement. Finds old_string and replaces with new_string. Safer and more token-efficient than write_file for modifying existing files. Auto-handles Windows CRLF line endings.

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md1.4 KB
  • agents/openai.yaml277 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Edit File

精确字符串替换式编辑文件。

Parameters

参数类型必填说明
pathstring是文件路径
old_stringstring是要替换的原文本(须精确匹配)
new_stringstring是替换后的新文本
replace_allboolean否是否替换所有匹配项(默认 false)

Examples

修改函数名:

{
  "path": "src/main.py",
  "old_string": "def old_name():",
  "new_string": "def new_name():"
}

批量替换变量名:

{
  "path": "src/config.py",
  "old_string": "old_var",
  "new_string": "new_var",
  "replace_all": true
}

Notes

  • 修改前请先用 read_file 确认文件内容
  • old_string 必须精确匹配(包括缩进和空格)
  • 如果 old_string 匹配多处且未设 replace_all,会报错
  • 自动兼容 Windows CRLF 和 Unix LF 换行符
  • 优先使用此工具而非 write_file 来编辑现有文件

Related Skills

  • read-file: 先读取文件确认内容
  • write-file: 创建新文件或完全覆盖
  • grep: 搜索要编辑的内容位置

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Record important information to long-term memory for learning user preferences, successful patterns, and error lessons. When you need to remember user preferences, save successful patterns, or record lessons from errors.

The English summary is being prepared. Showing the original description.

openakita/openakita2KUpdated Sep 24, 2026

Click page elements by CSS selector or text content. When you need to click buttons, links, or select options. PREREQUISITE - must use browser_navigate to open target page first.

The English summary is being prepared. Showing the original description.

openakita/openakita2KUpdated Sep 24, 2026

Extract page content and element text from current webpage. When you need to read page information, get element values, scrape data, or verify page content.

The English summary is being prepared. Showing the original description.

openakita/openakita2KUpdated Sep 24, 2026

List all open browser tabs with their index, URL and title. When you need to check what pages are open, manage multiple tabs, or find a specific tab to switch to.

The English summary is being prepared. Showing the original description.

openakita/openakita2KUpdated Sep 24, 2026

Navigate browser to specified URL to open a webpage. When you need to open webpages or start web automation. PREREQUISITE - must call before browser_click/type operations. Auto-starts browser if not running.

The English summary is being prepared. Showing the original description.

openakita/openakita2KUpdated Sep 24, 2026

Open new browser tab and navigate to URL (keeps current page open). When you need to open additional page without closing current, or multi-task across pages. PREREQUISITE - must confirm browser is running first.

The English summary is being prepared. Showing the original description.

openakita/openakita2KUpdated Sep 24, 2026

See all skills by openakita

Report a problem with this skill