Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

Improve build prompts with clearer instructions and formatting

Dane Schneiderc1ad5a9f5385
diff --git a/app/server/model/prompts/build_validation_replacements.go b/app/server/model/prompts/build_validation_replacements.go
index aeb0cc8d..71f66030 100644
--- a/app/server/model/prompts/build_validation_replacements.go
+++ b/app/server/model/prompts/build_validation_replacements.go
@@ -207,6 +207,10 @@ IMPORTANT RULES:
3. In replacements, every line in the <Old> element MUST exactly match a line in the original file and MUST begin with the line number with a 'pdx-' prefix (NOT with a 'pdx-new-' prefix).
4. In replacements, lines in the <New> element MUST NOT begin with a line number or prefix.
5. Always include reasoning in a '## Evaluate Diff' section prior to outputting the <PlandexCorrect/> or <PlandexIncorrect/> tags.
+
+--
+
+DO NOT FORGET TO INCLUDE THE ***'pdx-' PREFIXED*** LINE NUMBERS IN THE <Old> ELEMENT.
`
return s, headNumTokens
@@ -217,17 +221,17 @@ func getBuildPromptHead(filePath string, preBuildStateWithLineNums shared.LineNu
return fmt.Sprintf(
`Path: %s
-Original file (with line nums):
+Original file (with line nums prefixed with 'pdx-'):
>>>
%s
<<<
-Proposed changes explanation (with line nums):
+Proposed changes explanation:
>>>
%s
<<<
-Proposed changes:
+Proposed changes (with line nums prefixed with 'pdx-new-'):
>>>
%s
<<<
diff --git a/app/server/model/prompts/build_whole_file.go b/app/server/model/prompts/build_whole_file.go
index ff31e839..0b1283f2 100644
--- a/app/server/model/prompts/build_whole_file.go
+++ b/app/server/model/prompts/build_whole_file.go
@@ -47,4 +47,6 @@ Do NOT include line numbers in the <PlandexWholeFile> element. Do NOT include re
Do NOT include any additional text after the <PlandexWholeFile> element. The output must end after </PlandexWholeFile>. DO NOT use the string <PlandexWholeFile> anywhere else in the output. ONLY use it to start the <PlandexWholeFile> element.
Do NOT UNDER ANY CIRCUMSTANCES *remove or change* any code that is not part of the changes in the *proposed updates*. ALL OTHER code from the *original file* must be reproduced *exactly* as it is in the *original file*. Do NOT remove comments, logging statements, commented out code, or anything else that is not part of the changes in the *proposed updates*. Your job is *only* to *apply* the changes in the *proposed updates* to the *original file*, not to make additional changes of *any kind*.
+
+The ABSOLUTE MOST IMPORTANT THING is to leave all existing code that is not DIRECTLY part of the changes in the *proposed updates* *exactly* as it is in the *original file*. Do NOT remove any code that is not part of the changes in the *proposed updates*. Do NOT include any reference comments in the output; replace them with the appropriate code from the *original file*. Be ABSOLUTELY CERTAIN you have not left anything out which belongs in the final result.
`