write.md

 1Create new files or completely rewrite existing files.
 2
 3<when_to_use>
 4Use Write when:
 5- Creating new files
 6- Complete file rewrite (>50% changes)
 7- Generating new code from scratch
 8- Replacing entire file contents
 9
10Do NOT use Write when:
11- Making targeted edits → use `edit`
12- Multiple surgical changes → use `multiedit`
13- File exists and only needs small changes → use `edit`
14</when_to_use>
15
16<parameters>
17- file_path: Path to write (required)
18- content: Complete file content (required)
19</parameters>
20
21<behavior>
22- Creates parent directories automatically
23- Overwrites existing files
24- Checks if file modified since last read (safety check)
25- Skips write if content unchanged
26</behavior>
27
28<guidelines>
29- Use `view` first to check if file exists
30- Use `ls` to verify target directory
31- Use absolute paths when possible
32- Match existing code style in the project
33</guidelines>
34
35<examples>
36Good: Creating a new test file
37```
38file_path: "/project/src/utils_test.go"
39content: "package utils\n\nimport \"testing\"\n\nfunc TestHelper(t *testing.T) {\n    // test code\n}"
40```
41
42Bad: Using write for a small change to existing file → Use `edit` instead
43</examples>