Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | -42% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-01 | ✓→✗ | ▼ Worse | 7% | 0% |
| case-03 | ✓→✓ | = Same ✓ | -29% | 0% |
| case-04 | ✓→✓ | = Same ✓ | -6% | 0% |
精确字符串替换式编辑文件。
| 参数 | 类型 | 必填 | 说明 | |-----|------|-----|------| | path | string | 是 | 文件路径 | | old_string | string | 是 | 要替换的原文本(须精确匹配) | | new_string | string | 是 | 替换后的新文本 | | replace_all | boolean | 否 | 是否替换所有匹配项(默认 false) |
修改函数名:
json{ "path": "src/main.py", "old_string": "def old_name():", "new_string": "def new_name():" }
批量替换变量名:
json{ "path": "src/config.py", "old_string": "old_var", "new_string": "new_var", "replace_all": true }
read-file: 先读取文件确认内容write-file: 创建新文件或完全覆盖grep: 搜索要编辑的内容位置Other measured skills in the registry, with their headline benchmark lift.