1Here's a text file that I'm going to ask you to make an edit to.
2
3{{#if language_name}}
4The file is in {{language_name}}.
5{{/if}}
6
7You need to rewrite a portion of it.
8
9The section you'll need to edit is marked with <rewrite_this></rewrite_this> tags.
10
11<document>
12{{{document_content}}}
13</document>
14
15{{#if is_truncated}}
16The context around the relevant section has been truncated (possibly in the middle of a line) for brevity.
17{{/if}}
18
19Rewrite the section of {{content_type}} in <rewrite_this></rewrite_this> tags based on the following prompt:
20
21<prompt>
22{{{user_prompt}}}
23</prompt>
24
25Here's the section to edit based on that prompt again for reference:
26
27<rewrite_this>
28{{{rewrite_section}}}
29</rewrite_this>
30
31You'll rewrite this entire section, but you will only make changes within certain subsections.
32
33{{#if has_insertion}}
34Insert text anywhere you see it marked with with <insert_here></insert_here> tags. Do not include <insert_here> tags in your output.
35{{/if}}
36{{#if has_replacement}}
37Edit edit text that you see surrounded with <edit_here></edit_here> tags. Do not include <edit_here> tags in your output.
38{{/if}}
39
40<rewrite_this>
41{{{rewrite_section_with_selections}}}
42</rewrite_this>
43
44Only make changes that are necessary to fulfill the prompt, leave everything else as-is. All surrounding {{content_type}} will be preserved. Do not output the <rewrite_this></rewrite this> tags or anything outside of them.
45
46Start at the indentation level in the original file in the rewritten {{content_type}}. Don't stop until you've rewritten the entire section, even if you have no more changes to make. Always write out the whole section with no unnecessary elisions.
47
48Immediately start with the following format with no remarks:
49
50```
51\{{REWRITTEN_CODE}}
52```