Skip to content

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

prompting for gitignore and file paths

Dane Schneider14384521af5b
diff --git a/app/server/model/prompts/implement.go b/app/server/model/prompts/implement.go
index e193a815..8ca86bbf 100644
--- a/app/server/model/prompts/implement.go
+++ b/app/server/model/prompts/implement.go
@@ -293,6 +293,10 @@ Before marking the task as done, you MUST complete *every* step of the task. Do
You ABSOLUTELY MUST NOT mark the task as done by outputting text in the format "**[task name]** has been completed" and outputting <PlandexFinish/> until *every single step* of the task has been implemented with code blocks. DO NOT output this text or output <PlandexFinish/> after the first code block in the response *unless* that is the final step of the task. Otherwise, you must *continue* working on the remaining steps of the task with additional code blocks.
If you are not able to finish *ALL* steps of the task in this response, you still MUST NOT mark the task as done by outputting text in the format "**[task name]** has been completed" and outputting <PlandexFinish/>. Instead, state what you have finished, but ALSO state that steps are still remaining to be done and stop there—the remaining steps will be continued in the next response.
+
+If you are updating an existing .gitignore file: DO NOT UNDER ANY CIRCUMSTANCES remove ANY entries. You can only add to it. Be extremely careful in how you edit .gitignore files to be 100% sure you are not remove any files. Only use the 'add' or 'append' action types for action explanations and code blocks when updating pre-existing .gitignore files. This way you can be 100% sure you are not removing any files. The only exception is if the user has specifically asked you to remove an entry, or if removing an entry is necessary to complete the task.
+
+If you are adding entries to a .gitignore file, ONLY add *essential* entries. Do NOT add entries that are not directly related to the task at hand. Do not "future proof" the .gitignore file by adding entries that are not necessary for the current task. Only add entries that are *essential* to the current task.
`
// Before beginning on the current task, summarize what needs to be done to complete the current task. Condense if possible, but do not leave out any necessary steps. Note any files that will be created or updated by each step—surround file paths with backticks like this: "` + "`path/to/some_file.txt`" + `". You MUST include this summary at the beginning of your response.
diff --git a/app/server/model/prompts/planning.go b/app/server/model/prompts/planning.go
index 77d55892..6a2bfbc1 100644
--- a/app/server/model/prompts/planning.go
+++ b/app/server/model/prompts/planning.go
@@ -186,6 +186,8 @@ If a plan is in progress and the user asks you a question, don't respond by cont
prompt += SharedPlanningImplementationPrompt
prompt += `
+If you're in an existing project and you are creating new files, use your judgment on whether to generate new files in an existing directory or in a new directory. Keep directories well organized and follow existing patterns in the codebase. ALWAYS use *complete* *relative* paths for new files.
+
IMPORTANT: During this planning phase, you must NOT implement any code or create any code blocks. Your only task is to break down the work into subtasks. Code implementation will happen in a separate phase after planning is complete. The planning phase is ONLY for breaking the work into subtasks.
Do not attempt to write any code or show any implementation details at this stage.
diff --git a/app/server/model/prompts/user_prompt.go b/app/server/model/prompts/user_prompt.go
index 3104ca0b..b610b95b 100644
--- a/app/server/model/prompts/user_prompt.go
+++ b/app/server/model/prompts/user_prompt.go
@@ -76,6 +76,8 @@ After you have broken a task up in to multiple subtasks and output a '### Tasks'
Output a <PlandexFinish/> tag after the '### Tasks' section. NEVER output a '### Tasks' section without also outputting a <PlandexFinish/> tag.
+Use your judgment on the paths of new files you create. Keep directories well organized and if you're working in an existing project, follow existing patterns in the codebase. ALWAYS use *complete* *relative* paths for new files.
+
IMPORTANT: During this planning phase, you must NOT implement any code or create any code blocks. Your ONLY JOB is to break down the work into subtasks. Code implementation will happen in a separate phase after planning is complete. The planning phase is ONLY for breaking the work into subtasks.
Do not attempt to write any code or show any implementation details at this stage.