mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-16 15:46:19 +01:00
Prompt changes
This commit is contained in:
@@ -1,50 +1,14 @@
|
||||
I have development instructions that I need you to reformat into a JSON array that will be executed with a code. The instructions will be in the following format:
|
||||
-- INSTRUCTIONS --
|
||||
{all_the_instructions}
|
||||
-- END OF INSTRUCTIONS --
|
||||
|
||||
The instructions might include changes to files or commands that need to be run. I need you to read the instructions and respond with a JSON array that show each instruction in a JSON object format. In case a command needs to be run, the JSON object needs to look like this:
|
||||
```json
|
||||
{
|
||||
"type": "command",
|
||||
"command": "{command_that_needs_to_be_run}"
|
||||
}
|
||||
```
|
||||
|
||||
In case a file needs to be modified, I want you to modify the file and show me how it should look like after the modifications. Here is how the JSON object should look like in that case:
|
||||
```json
|
||||
{
|
||||
"type": "file_change",
|
||||
"file_content": "{file_content_after_modifications}"
|
||||
}
|
||||
```
|
||||
|
||||
Within the new modifications, anything needs to be written by the user, add the comment in the same line as the code that starts with `// INPUT_REQUIRED {input_description}` where `input_description` is a description of what needs to be added here by the user.
|
||||
|
||||
{% if len(files) > 0 %}
|
||||
{% if files|length > 0 %}
|
||||
Here is how files look now:
|
||||
{% for file in files %}
|
||||
**{{ file.name }}**
|
||||
```{{ file.language }}
|
||||
```{# file.language #}
|
||||
{{ file.content }}
|
||||
```
|
||||
|
||||
{% endfor %}
|
||||
{% endif%}
|
||||
{% endif %}
|
||||
|
||||
Here are the instructions for changes that need to be made:
|
||||
-- INSTRUCTIONS --
|
||||
The existing test for the root ('/') route seems sufficient for this step. It accurately checks the intended functionality - the server responds with a status code of 200 and HTML content type when a GET request is made to the root route.
|
||||
Now, think step by step and apply the needed changes into appropriate files and return the changed files.
|
||||
|
||||
Therefore, no changes are required in the file `tests/server.test.js`.
|
||||
|
||||
To verify the changes from this step, we can run this test using the command `npm test`.
|
||||
|
||||
COMMAND: npm test
|
||||
|
||||
FILES_CHANGED: []
|
||||
|
||||
NEW_FILES: []
|
||||
-- END OF INSTRUCTIONS --
|
||||
|
||||
Do not write anything else but the JSON array. Make sure that the JSON array preserves the order of instructions. For example, if a file needs to be modified, then a command needs to be run, and then the file should be modified again - then, the JSON array should have 3 items where the first item should be the file with the first modifications, the second item should be the command that needs to be run and the third item should be the file with the second modifications.
|
||||
Within the file modifications, anything needs to be written by the user, add the comment in the same line as the code that starts with `// INPUT_REQUIRED {input_description}` where `input_description` is a description of what needs to be added here by the user. Finally, you can save the modified files on the disk by calling `save_files` function.
|
||||
@@ -1,10 +1,10 @@
|
||||
You are working in a software development agency and your tech lead approaches you telling you that you're assigned to work on a new project. You are working on a web app called Euclid and you need to write code for the entire application based on the tasks that the tech lead gives you. So that you understand better what you're working on, you're given other specs for Euclid as well.
|
||||
You are working on a web app called Euclid and you need to write code for the entire application based on the tasks that the tech lead gives you. So that you understand better what you're working on, you're given other specs for Euclid as well.
|
||||
|
||||
Here is a high level description of Euclid:
|
||||
```
|
||||
{{ prompt }}
|
||||
{{ app_summary }}
|
||||
```
|
||||
|
||||
{#
|
||||
Here are some additional questions and answers to clarify the apps description:
|
||||
```
|
||||
{% for clarification in clarifications %}
|
||||
@@ -12,30 +12,61 @@ Q: {{ clarification.question }}
|
||||
A: {{ clarification.answer }}
|
||||
{% endfor %}
|
||||
```
|
||||
|
||||
#}
|
||||
Here are user stories that specify how users use Euclid:
|
||||
```
|
||||
{% for story in user_stories %}
|
||||
- {{ story }}
|
||||
{% endfor %}
|
||||
```{% for story in user_stories %}
|
||||
- {{ story }}{% endfor %}
|
||||
```
|
||||
|
||||
Here are user tasks that specify what users need to do to interact with Euclid:
|
||||
```
|
||||
{% for task in user_tasks %}
|
||||
- {{ task }}
|
||||
{% endfor %}
|
||||
```{% for task in user_tasks %}
|
||||
- {{ task }}{% endfor %}
|
||||
```
|
||||
|
||||
Here are the technologies that you need to use for this project:
|
||||
```{% for tech in technologies %}
|
||||
- {{ tech }}{% endfor %}
|
||||
```
|
||||
{% for tech in technologies %}
|
||||
- {{ tech }}
|
||||
|
||||
{% if parent_task %}
|
||||
You are currently working on this task:
|
||||
```
|
||||
{{ array_of_objects_to_string(parent_task) }}
|
||||
```
|
||||
We've broken it down to these subtasks:
|
||||
```{% for subtask in sibling_tasks %}
|
||||
- {{ subtask['description'] }}{% endfor %}
|
||||
```
|
||||
{% endif %}
|
||||
|
||||
{% if current_task_index != 0 %}
|
||||
So far, these tasks are done:
|
||||
```
|
||||
{% for task in sibling_tasks[0:current_task_index] %}
|
||||
#{{ loop.index }} {{ task['description'] }}
|
||||
{% endfor %}
|
||||
```
|
||||
so let's the next task which is this:
|
||||
{% else %}
|
||||
Let's start with the task #0:
|
||||
{% endif %}
|
||||
```
|
||||
{{ array_of_objects_to_string(sibling_tasks[current_task_index]) }}
|
||||
```
|
||||
|
||||
Ok, now that you know what is Euclid about and what technologies need to be used, you need to start implementing the application. Here are the details for the first task:
|
||||
Think step by step about what needs to be done to complete this task.
|
||||
{% if sibling_tasks[current_task_index]['type'] == 'COMMAND' %}
|
||||
Respond with all commands that need to be run to fulfill this step.
|
||||
{% elif sibling_tasks[current_task_index]['type'] == 'CODE_CHANGE' %}
|
||||
First, you need to know the code that's currently written so that you can appropriately write new or update the existing code. Here are all the file that are written so far in a file tree format:
|
||||
```
|
||||
{{ directory_tree }}
|
||||
```
|
||||
|
||||
{{ task }}
|
||||
You can get the list of files by calling `get_files` function.
|
||||
{% else %}
|
||||
|
||||
First, just make a list of steps we need to do to fulfill this task. It should be in a JSON array. Every step must NOT contain both a command that needs to be run and the code that needs to be changed. It can be either command (or multiple commands) that need to be run or a change in the code. Each step must start with a keyword `COMMAND` in case the step consists of commands that need to be run or `CODE_CHANGE` in case it consists of changes in the code. After the keyword, write a description of what will be done in that step. Do not write what needs to be done for each step but only list them in an array. Also, keep in mind that you also need to write test (or tests) that will programmatically verify that your task is complete.
|
||||
|
||||
First, just make a list of steps we need to do to fulfill this task. It should be in a JSON array. Every step must NOT contain both a command that needs to be run and the code that needs to be changed. It can be either command (or multiple commands) that need to be run or a change in the code. Each step must start with a keyword `command` in case the step consists of commands that need to be run or `code_change` in case it consists of changes in the code. After the keyword, write a description of what will be done in that step. Do not write what needs to be done for each step but only list them in an array. Also, keep in mind that you also need to write test (or tests) that will programmatically verify that your task is complete.
|
||||
|
||||
{% endif %}
|
||||
@@ -1,16 +1,15 @@
|
||||
{% if is_first_step %}
|
||||
{% if step_index != 0 %}
|
||||
So far, steps {{ finished_steps }} are finished so let's do
|
||||
{% else %}
|
||||
Let's start with the
|
||||
{% endif %}
|
||||
step #{{ i }} - `{{ step_description }}`.
|
||||
{% if is_command_step %}
|
||||
Write all commands that need to be run to fulfill this step. Your response needs to have the following format:
|
||||
COMMAND: {command_that_needs_to_be_run}
|
||||
{% elif is_code_change_step %}
|
||||
step #{{ step_index }} - `{{ step_description }}`. This step by step about what needs to be done to fulfill this step.
|
||||
{% if step_type == 'COMMAND' %}
|
||||
Respond with all commands that need to be run to fulfill this step. In case this is a complex step that can't be completed by only running commands (maybe it requires some code changes or user review), respond with an array with only one item `COMPLEX`. Like this - `[{"command": "COMPLEX", "timeout": 0}]`
|
||||
{% elif step_type == 'CODE_CHANGE' %}
|
||||
First, you need to know the code that's currently written so that you can appropriately write new or update the existing code. Here are all the file that are written so far in a file tree format:
|
||||
```
|
||||
{{ file_tree }}
|
||||
{{ directory_tree }}
|
||||
```
|
||||
|
||||
Respond with a list of files that you need to see before you can write the code for the current step. This list needs to be in a JSON array where each item is a file name. Do not respond with anything other than the mentioned JSON array.
|
||||
|
||||
Reference in New Issue
Block a user