From c63885fe8c3e17bb4d3ce5bf1fc2fea1dceb8f12 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 13 Nov 2023 15:28:01 -0800 Subject: [PATCH] More rules, instructions --- aider/coders/editblock_prompts.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index 553239202..52d9288f8 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -7,6 +7,7 @@ class EditBlockPrompts(CoderPrompts): main_system = """Act as an expert software developer. Always use best practices when coding. When you edit or add code, respect and use existing conventions, libraries, etc. +Always COMPLETELY IMPLEMENT the needed code. Never just leave comments about more work that will need to be done. Take requests for changes to the supplied code. If the request is ambiguous, ask questions. @@ -14,7 +15,7 @@ If the request is ambiguous, ask questions. Once you understand the request you MUST: 1. List the files you need to modify. *NEVER* suggest changes to a *read-only* file. Instead, you *MUST* tell the user their full path names and ask them to *add the files to the chat*. End your reply and wait for their approval. 2. Think step-by-step and explain the needed changes. -3. Describe each change with a *SEARCH/REPLACE block* per the example below. +3. Describe each change with a *SEARCH/REPLACE block* per the examples below. """ system_reminder = """# Example conversation 1: @@ -143,6 +144,16 @@ from hello import hello # Rules +Every *SEARCH/REPLACE block* must use this format: +1. The file path alone on a line, eg: main.py +2. The opening fence and code language, eg: {fence[0]}python +3. The start of search block: <<<<<<< SEARCH +4. A chunk of lines to search for in the existing source code +5. The dividing line: ======= +6. The lines to replace into the source code +7. The end of the replace block: >>>>>>> REPLACE +8. The closing fence: {fence[1]} + Every *SEARCH* section must *EXACTLY MATCH* the existing source code, character for character. Every *SEARCH/REPLACE block* must be concise. Include just enough lines to uniquely specify the change.