improve: text_editor tool system prompt instructions
linuztx committed
Feb 27, 2026 at 17:54 UTC
8fd278cc743eb59a8a8945b53e58c1162fe75ffc
1 file changed
+26
-28
plugins/text_editor/prompts/agent.system.tool.text_editor.md
+26
-28
@@ -1,19 +1,18 @@
1
### text_editor
2
-native file read write patch with line numbers
3
-no code execution creating viewing editing text files
4
-terminal (grep find sed) search advanced replacements
2
+file read write patch with numbered lines
3
+not code execution rejects binary
4
+terminal (grep find sed) advance search/replace
5
6
#### text_editor:read
7
-read file numbered lines
8
-args path line_from (inclusive) line_to (inclusive) both optional
9
-defaults first {{default_line_count}} lines if no range
7
+read file with numbered lines
8
+args path line_from line_to (inclusive optional)
9
+no range → first {{default_line_count}} lines
10
+long lines cropped output may trim by token limit
11
+read surrounding context before patching
12
usage:
13
~~~json
14
{
13
- "thoughts": [
14
- "..."
15
- ],
16
- "headline": "...",
15
+ ...
16
"tool_name": "text_editor:read",
17
"tool_args": {
18
"path": "/path/file.py",
@@ -24,15 +23,13 @@ usage:
23
~~~
24
25
#### text_editor:write
27
-create overwrite entire file
26
+create/overwrite file auto-creates dirs
27
args path content
28
+\n for newlines end with \n
29
usage:
30
~~~json
31
{
32
- "thoughts": [
33
- "..."
34
- ],
35
- "headline": "...",
32
+ ...
33
"tool_name": "text_editor:write",
34
"tool_args": {
35
"path": "/path/file.py",
@@ -42,22 +39,23 @@ usage:
39
~~~
40
41
#### text_editor:patch
45
-apply line edits existing file
46
-args path edits (array of {from, to, content})
47
-from and to are inclusive line numbers
48
-{from:2, to:2, content:"x\n"} replace line 2
49
-{from:1, to:3, content:"x\n"} replace lines 1-3
50
-{from:2, to:2} delete line 2 (no content = delete)
51
-{from:2, content:"x\n"} insert before line 2 (omit to = insert)
52
-always original line numbers from read output dont adjust shifts
53
-edits must not overlap
42
+line edits on existing file
43
+args path edits [{from to content}]
44
+from to inclusive \n in content
45
+{from:2 to:2 content:"x\n"} replace line
46
+{from:1 to:3 content:"x\n"} replace range
47
+{from:2 to:2} delete (no content)
48
+{from:2 content:"x\n"} insert before (omit to)
49
+use original line numbers from read. dont adjust for shifts
50
+no overlapping edits
51
+ensure valid syntax in content (all braces brackets tags closed)
52
+only replace exact lines needed dont include surrounding unchanged lines
53
+re-read after patch before next patch
54
+large changes write over multiple patches
55
usage:
56
~~~json
57
{
57
- "thoughts": [
58
- "..."
59
- ],
60
- "headline": "...",
58
+ ...
59
"tool_name": "text_editor:patch",
60
"tool_args": {
61
"path": "/path/file.py",