|
| 1 | +import time |
| 2 | + |
1 | 3 | from metagpt.const import REACT_TEMPLATE_PATH, VUE_TEMPLATE_PATH |
2 | 4 | from metagpt.prompts.di.role_zero import ROLE_INSTRUCTION |
3 | 5 |
|
|
34 | 36 | 11.1 Do not use Editor.insert_content_at_line or Editor.edit_file_by_replace more than once per command list. |
35 | 37 | 12. If you choose Editor.insert_content_at_line, you must ensure that there is no duplication between the inserted content and the original code. If there is overlap between the new code and the original code, use Editor.edit_file_by_replace instead. |
36 | 38 | 13. If you choose Editor.edit_file_by_replace, the original code that needs to be replaced must start at the beginning of the line and end at the end of the line |
37 | | -14. When not specified, you should write files in a folder named "{{project_name}}". The project name is the name of the project which meets the user's requirements. |
| 39 | +14. When not specified, you should write files in a folder named "{{project_name}}_{timestamp}". The project name is the name of the project which meets the user's requirements. |
38 | 40 | 15. When provided system design or project schedule, you MUST read them first before making a plan, then adhere to them in your implementation, especially in the programming language, package, or framework. You MUST implement all code files prescribed in the system design or project schedule. |
39 | 41 | 16. When planning, initially list the files for coding, then outline all coding tasks based on the file organization in your first response. |
40 | 42 | 17. If you plan to read a file, do not include other plans in the same response. |
|
47 | 49 | 24. The priority to select technology stacks: Describe in Sytem Design and Project Schedule > Vite, React, MUI and Tailwind CSS > native HTML |
48 | 50 | 24.1. The React template is in the "{react_template_path}" and Vue template is in the "{vue_template_path}". |
49 | 51 | 25. If use Vite, Vue/React, MUI, and Tailwind CSS as the programming language or no programming language is specified in document or user requirement, follow these steps: |
50 | | -25.1. Create the project folder if no exists. Use cmd " mkdir -p {{project_name}} " |
51 | | -25.2. Copy a Vue/React template to your project folder, move into it and list the file in it. Use cmd "cp -r {{template_folder}}/* {{workspace}}/{{project_name}}/ && cd {{workspace}}/{{project_name}} && pwd && tree ". This must be a single response without other commands. |
| 52 | +25.1. Create the project folder if no exists. Use cmd " mkdir -p {{project_name}}_{timestamp} " |
| 53 | +25.2. Copy a Vue/React template to your project folder, move into it and list the file in it. Use cmd "cp -r {{template_folder}}/* {{workspace}}/{{project_name}}_{timestamp}/ && cd {{workspace}}/{{project_name}}_{timestamp} && pwd && tree ". This must be a single response without other commands. |
52 | 54 | 25.3. User Editor.read to read the content of files in the src and read the index.html in the project root before making a plan. |
53 | | -25.4. List the files that you need to rewrite and create when making a plan. Indicate clearly what file to rewrite or create in each task. "index.html" and all files in the src folder always must be rewritten. Use Tailwind CSS for styling. Notice that you are in {{project_name}}. |
| 55 | +25.4. List the files that you need to rewrite and create when making a plan. Indicate clearly what file to rewrite or create in each task. "index.html" and all files in the src folder always must be rewritten. Use Tailwind CSS for styling. Notice that you are in {{project_name}}_{timestamp}. |
54 | 56 | 25.5. After finish the project. use "pnpm install && pnpm run build" to build the project and then deploy the project to the public using the dist folder which contains the built project. |
55 | 57 | 26. Engineer2.write_new_code is used to write or rewrite the code, which will modify the whole file. Editor.edit_file_by_replace is used to edit a small part of the file. |
56 | 58 | 27. Deploye the project to the public after you install and build the project, there will be a folder named "dist" in the current directory after the build. |
|
59 | 61 | """.format( |
60 | 62 | vue_template_path=VUE_TEMPLATE_PATH.resolve().absolute(), |
61 | 63 | react_template_path=REACT_TEMPLATE_PATH.resolve().absolute(), |
| 64 | + timestamp=int(time.time()), |
62 | 65 | ) |
63 | 66 | CURRENT_STATE = """ |
64 | 67 | The current editor state is: |
|
0 commit comments