93 lines
1.9 KiB
Handlebars
93 lines
1.9 KiB
Handlebars
You MUST respond with a series of edits to a file, using the following format:
|
|
|
|
```
|
|
<edits>
|
|
|
|
<old_text line=10>
|
|
OLD TEXT 1 HERE
|
|
</old_text>
|
|
<new_text>
|
|
NEW TEXT 1 HERE
|
|
</new_text>
|
|
|
|
<old_text line=456>
|
|
OLD TEXT 2 HERE
|
|
</old_text>
|
|
<new_text>
|
|
NEW TEXT 2 HERE
|
|
</new_text>
|
|
|
|
<old_text line=42>
|
|
OLD TEXT 3 HERE
|
|
</old_text>
|
|
<new_text>
|
|
NEW TEXT 3 HERE
|
|
</new_text>
|
|
|
|
</edits>
|
|
```
|
|
|
|
# File Editing Instructions
|
|
|
|
- Use `<old_text>` and `<new_text>` tags to replace content
|
|
- `<old_text>` must exactly match existing file content, including indentation
|
|
- `<old_text>` must come from the actual file, not an outline
|
|
- `<old_text>` cannot be empty
|
|
- `line` should be a starting line number for the text to be replaced
|
|
- Be minimal with replacements:
|
|
- For unique lines, include only those lines
|
|
- For non-unique lines, include enough context to identify them
|
|
- Do not escape quotes, newlines, or other characters within tags
|
|
- For multiple occurrences, repeat the same tag pair for each instance
|
|
- Edits are sequential - each assumes previous edits are already applied
|
|
- Only edit the specified file
|
|
- Always close all tags properly
|
|
|
|
|
|
{{!-- The following example adds almost 10% pass rate for Gemini 2.5.
|
|
Claude and gpt-4.1 don't really need it. --}}
|
|
<example>
|
|
<edits>
|
|
|
|
<old_text line=3>
|
|
struct User {
|
|
name: String,
|
|
email: String,
|
|
}
|
|
</old_text>
|
|
<new_text>
|
|
struct User {
|
|
name: String,
|
|
email: String,
|
|
active: bool,
|
|
}
|
|
</new_text>
|
|
|
|
<old_text line=25>
|
|
let user = User {
|
|
name: String::from("John"),
|
|
email: String::from("john@example.com"),
|
|
};
|
|
</old_text>
|
|
<new_text>
|
|
let user = User {
|
|
name: String::from("John"),
|
|
email: String::from("john@example.com"),
|
|
active: true,
|
|
};
|
|
</new_text>
|
|
|
|
</edits>
|
|
</example>
|
|
|
|
|
|
<file_to_edit>
|
|
{{path}}
|
|
</file_to_edit>
|
|
|
|
<edit_description>
|
|
{{edit_description}}
|
|
</edit_description>
|
|
|
|
Tool calls have been disabled. You MUST start your response with <edits>.
|