From 9d525579715ac7a4005ebbb8cb72b89a5083a165 Mon Sep 17 00:00:00 2001 From: Goran Peretin Date: Fri, 21 Jun 2024 10:15:32 +0000 Subject: [PATCH] Tell code reviewer not to suggest changes in other files. --- core/prompts/code-reviewer/review_changes.prompt | 2 +- core/prompts/developer/breakdown.prompt | 3 ++- core/prompts/partials/relative_paths.prompt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/prompts/code-reviewer/review_changes.prompt b/core/prompts/code-reviewer/review_changes.prompt index 82802a050..9b665593e 100644 --- a/core/prompts/code-reviewer/review_changes.prompt +++ b/core/prompts/code-reviewer/review_changes.prompt @@ -18,7 +18,7 @@ As you can see, there {% if hunks|length == 1 %}is only one hunk in this diff, a When reviewing the code changes, apply these principles to decide on each hunk: - Apply: Approve and integrate the hunk into our core codebase if it accurately delivers the intended functionality or enhancement, aligning with our project objectives. This action confirms the change is beneficial and meets our quality standards. - Ignore: Use this option sparingly, only when you're certain the entire hunk is incorrect or will introduce errors (logical, syntax, etc.) that could negatively impact the project. Ignoring means the hunk will be completely removed. This should be reserved for cases where the inclusion of the code is definitively more harmful than its absence. Emphasize careful consideration before choosing 'Ignore.' It's crucial for situations where the hunk's removal is the only option to prevent significant issues. Otherwise, 'Rework' might be the better choice to ensure the code's integrity and functionality. -- Rework: Suggest this option if the concept behind the change is valid and necessary but is implemented in a way that introduces problems. This indicates a need for a revision of the hunk to refine its integration without fully discarding the underlying idea. +- Rework: Suggest this option if the concept behind the change is valid and necessary but is implemented in a way that introduces problems. This indicates a need for a revision of the hunk to refine its integration without fully discarding the underlying idea. DO NOT suggest making changes to files other than the one you're reviewing. When deciding what should be done with the hunk you are currently reviewing, pick an option that most reviewers of your skill would choose. Your decisions have to be consistent. diff --git a/core/prompts/developer/breakdown.prompt b/core/prompts/developer/breakdown.prompt index 80a41260f..f11511961 100644 --- a/core/prompts/developer/breakdown.prompt +++ b/core/prompts/developer/breakdown.prompt @@ -21,11 +21,12 @@ Now, tell me all the code that needs to be written to implement ONLY this task a {% include "partials/doc_snippets.prompt" %} -**IMPORTANT** {%- if state.epics|length == 1 %} +**IMPORTANT** Remember, I created an empty folder where I will start writing files that you tell me and that are needed for this app. {% endif %} {% include "partials/relative_paths.prompt" %} + DO NOT specify commands to create any folders or files, they will be created automatically - just specify the relative path to each file that needs to be written. {% include "partials/file_naming.prompt" %} diff --git a/core/prompts/partials/relative_paths.prompt b/core/prompts/partials/relative_paths.prompt index 9f580d7a6..669b010d8 100644 --- a/core/prompts/partials/relative_paths.prompt +++ b/core/prompts/partials/relative_paths.prompt @@ -1,4 +1,4 @@ **IMPORTANT**: Pay attention to file paths: if the command or argument is a file or folder from the project, use paths relative to the project root. For example: - use `dirname/filename.py` instead of `/path/to/project/dirname/filename.py` - - use `filename.js` instead of `./filename.js` \ No newline at end of file + - use `filename.js` instead of `./filename.js`