From a2cd8ff89318ee9150c75e93dc14e5f35d1beefe Mon Sep 17 00:00:00 2001 From: Senko Rasic Date: Fri, 2 Feb 2024 22:13:49 -0800 Subject: [PATCH] Be more insistent on keeping the files small. --- pilot/prompts/components/file_size_limit.prompt | 2 ++ pilot/prompts/dev_ops/debug.prompt | 3 +-- pilot/prompts/development/iteration.prompt | 3 +-- pilot/prompts/development/task/breakdown.prompt | 2 ++ pilot/prompts/development/task/update_task.prompt | 3 +-- pilot/prompts/system_messages/full_stack_developer.prompt | 6 +++++- 6 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 pilot/prompts/components/file_size_limit.prompt diff --git a/pilot/prompts/components/file_size_limit.prompt b/pilot/prompts/components/file_size_limit.prompt new file mode 100644 index 00000000..176cdcfc --- /dev/null +++ b/pilot/prompts/components/file_size_limit.prompt @@ -0,0 +1,2 @@ +**IMPORTANT** +When you think about in which file should the new code go to, always try to make files as small as possible and put code in more smaller files rather than in one big file. Whenever a file becomes too large (more than 100 lines of code) split it into smaller files. diff --git a/pilot/prompts/dev_ops/debug.prompt b/pilot/prompts/dev_ops/debug.prompt index 7fc69802..89d1889f 100644 --- a/pilot/prompts/dev_ops/debug.prompt +++ b/pilot/prompts/dev_ops/debug.prompt @@ -19,7 +19,6 @@ Each step can be either: Also, make sure that at least the last step has `check_if_fixed` set to TRUE. -**IMPORTANT** -When you think about in which file should the new code go to, always try to make files as small as possible and put code in more smaller files rather than in one big file. Whenever a file becomes too large (more than 50 lines of code) split it into smaller files. +{{ file_size_limit }} {# After this, you need to decide what to do next. You can rerun the command `{{ command }}` to check if the problem is fixed or run another command with `run_command` or change more code with `implement_code_changes`. #} diff --git a/pilot/prompts/development/iteration.prompt b/pilot/prompts/development/iteration.prompt index 9df53566..9b760d24 100644 --- a/pilot/prompts/development/iteration.prompt +++ b/pilot/prompts/development/iteration.prompt @@ -62,8 +62,7 @@ Tell me all the new code that needs to be written or modified to implement curre **IMPORTANT** When there is an error in the code, the best way to debug the issue is to understand the values of different variables so usually, developers put logs around the code and print out the values variables important to fix this issue. If, and only if, your colleague's report is a bug report and not an improvement request, think about variables that you would like to know the value of in the code that would help you fix this issue and then add logs around the code that will help you resolve this issue. Whenever you add a log that is meant to debug an issue, on the each line on which you add a log, you **MUST** append a code comment `gpt_pilot_debugging_log` (for example, `// gpt_pilot_debugging_log` or `# gpt_pilot_debugging_log`) so that the developer can remove all these logs after this issue is fixed. -**IMPORTANT** -When you think about in which file should the new code go to, always try to make files as small as possible and put code in more smaller files rather than in one big file. Whenever a file becomes too large (more than 50 lines of code) split it into smaller files. +{{ file_size_limit }} You do not need to make any automated tests work. diff --git a/pilot/prompts/development/task/breakdown.prompt b/pilot/prompts/development/task/breakdown.prompt index 445bae25..944b1952 100644 --- a/pilot/prompts/development/task/breakdown.prompt +++ b/pilot/prompts/development/task/breakdown.prompt @@ -30,4 +30,6 @@ DO NOT specify commands to create any folders or files, they will be created aut {{ human_intervention_explanation }} +{{ file_size_limit }} + Never use the port 5000 to run the app, it's reserved. diff --git a/pilot/prompts/development/task/update_task.prompt b/pilot/prompts/development/task/update_task.prompt index b70b4a3a..dc3e8e67 100644 --- a/pilot/prompts/development/task/update_task.prompt +++ b/pilot/prompts/development/task/update_task.prompt @@ -33,8 +33,7 @@ code_change_description: `{{ step.code_change_description }}`{% endif %} {% endif %} Now, think step by step and create a new list of task steps to complete this task based on the output we got from running `{{ current_step.command.command }}`. It will either be the same as it is now or any of the Next Task Steps may or may not be needed anymore. -**IMPORTANT** -When you think about in which file should the new code go to, always try to make files as small as possible and put code in more smaller files rather than in one big file. Whenever a file becomes too large (more than 50 lines of code) split it into smaller files. +{{ file_size_limit }} {# {% if len(next_steps) > 0 -%} diff --git a/pilot/prompts/system_messages/full_stack_developer.prompt b/pilot/prompts/system_messages/full_stack_developer.prompt index 3082b423..3d2b5ff2 100644 --- a/pilot/prompts/system_messages/full_stack_developer.prompt +++ b/pilot/prompts/system_messages/full_stack_developer.prompt @@ -1 +1,5 @@ -You are a full stack software developer who works in a software development agency. You write very modular and clean code. Your job is to implement tasks that your tech lead assigns you. Each task has a description of what needs to be implemented, a programmatic goal that will determine if a task can be marked as done and user-review goal that will determine if a task is done or not but from a user perspective since it will be reviewed by a human. \ No newline at end of file +You are an expert full stack software developer who works in a software development agency. + +You write modular, well-organized code split across files that are not too big (max 100 lines of code per file), so that the codebase is maintainable. Your code is clean, readable, production-level quality, and has proper error handling and logging. + +Your job is to implement tasks that your tech lead assigns you. Each task has a description of what needs to be implemented, a programmatic goal that will determine if a task can be marked as done and user-review goal that will determine if a task is done or not but from a user perspective since it will be reviewed by a human.