34 lines
2.6 KiB
Plaintext
34 lines
2.6 KiB
Plaintext
{
|
|
"description": "Edit or update an existing file by replacing a specific text block. Use for targeted changes to existing Markdown, documentation, architecture docs, source code, tests, configuration, and notes. Typical requests include update the docs, revise the architecture documentation, add a feature or section to existing documentation, add content to the relevant docs, correct a paragraph, change wording, modify a configuration entry, or apply a focused fix. Preserves all unrelated content. Does not create a new file or intentionally rewrite the entire file; use file_write for those cases.",
|
|
"keywords": ["update existing documentation", "edit existing documentation", "revise architecture documentation", "update architecture docs", "change architecture docs", "add feature to existing documentation", "add feature to existing architecture docs", "add feature to relevant architecture documentation", "add section to existing documentation", "add content to relevant docs", "document a new feature in existing docs", "document an implementation change in existing docs", "modify an existing Markdown file", "replace a paragraph in documentation", "correct a documentation section", "preserve existing file content", "targeted documentation edit", "in-place documentation change", "focused Markdown update", "source code targeted edit", "configuration targeted edit"],
|
|
"outputFormat": "diff",
|
|
"prompt": "## file_edit\n\nReplace text in a file. Has fuzzy matching (whitespace/indent flexible).\n\n**Args**: `path`, `old_string`, `new_string` (required); `replace_all` (optional boolean)\n\n```\nfile_edit(path=\"<ABSOLUTE_PATH_FROM_PWD>\", old_string=\"old text\", new_string=\"new text\")\nfile_edit(path=\"<ABSOLUTE_PATH_FROM_PWD>\", old_string=\"old text\", new_string=\"new text\", replace_all=true)\n```\n\n**Constraints**: Absolute paths only. Errors if `old_string` matches multiple locations \u2014 add surrounding context to disambiguate, or use `replace_all=true`.",
|
|
"args": {
|
|
"type": "object",
|
|
"required": [
|
|
"path",
|
|
"old_string",
|
|
"new_string"
|
|
],
|
|
"properties": {
|
|
"path": {
|
|
"type": "string",
|
|
"description": "Absolute path to the file to edit"
|
|
},
|
|
"old_string": {
|
|
"type": "string",
|
|
"description": "Text to find (fuzzy whitespace matching)"
|
|
},
|
|
"new_string": {
|
|
"type": "string",
|
|
"description": "Replacement text"
|
|
},
|
|
"replace_all": {
|
|
"type": "boolean",
|
|
"description": "Replace all occurrences (default: false)"
|
|
}
|
|
}
|
|
},
|
|
"scope": "write"
|
|
}
|