mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-26 15:49:42 +02:00
add write_new_code for code writing. Remove Editor.write & ValidateAndRewriteCode from Engineer2
This commit is contained in:
parent
e907863bcb
commit
381fc0d4ba
3 changed files with 74 additions and 61 deletions
|
|
@ -849,7 +849,6 @@ Here's the plan:
|
|||
1. **Task 1**: Create `index.html` - This file will contain the HTML structure necessary for the game's UI.
|
||||
2. **Task 2**: Create `style.css` - This file will define the CSS styles to make the game visually appealing and responsive.
|
||||
3. **Task 3**: Create `script.js` - This file will contain the JavaScript code for the game logic and UI interactions.
|
||||
4. **Code Review Tasks**: Review each file to ensure they meet the project requirements and adhere to the system design.
|
||||
|
||||
Let's start by appending the first task to the plan.
|
||||
|
||||
|
|
@ -881,33 +880,6 @@ Let's start by appending the first task to the plan.
|
|||
"instruction": "Create the script.js file containing the JavaScript logic for the 2048 game.",
|
||||
"assignee": "Alex"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_name": "Plan.append_task",
|
||||
"args": {
|
||||
"task_id": "4",
|
||||
"dependent_task_ids": ["1"],
|
||||
"instruction": "Use ValidateAndRewriteCode to review the code in index.html to ensure it meets the design specifications.",
|
||||
"assignee": "Alex"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_name": "Plan.append_task",
|
||||
"args": {
|
||||
"task_id": "5",
|
||||
"dependent_task_ids": ["2"],
|
||||
"instruction": "Use ValidateAndRewriteCode to review the code in style.css to ensure it meets the design specifications.",
|
||||
"assignee": "Alex"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_name": "Plan.append_task",
|
||||
"args": {
|
||||
"task_id": "6",
|
||||
"dependent_task_ids": ["3"],
|
||||
"instruction": "Use ValidateAndRewriteCode to review the code in script.js to ensure it meets the design specifications. ",
|
||||
"assignee": "Alex"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
|
@ -918,32 +890,9 @@ Explanation: Take on one task, such as writing a file. Upon completion, finish c
|
|||
```json
|
||||
[
|
||||
{
|
||||
"command_name": "Editor.write",
|
||||
"command_name": "Engineer2.write_new_code",
|
||||
"args": {
|
||||
"path": "/Users/gary/Files/temp/workspace/snake_game/src/index.html",
|
||||
"content": "the code ..."
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_name": "Plan.finish_current_task",
|
||||
"args": {{}}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## example 4
|
||||
I will now review the code in `script.js`.
|
||||
Explanation: to review the code, call ValidateAndRewriteCode.run.
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"command_name": "ValidateAndRewriteCode.run",
|
||||
"args": {
|
||||
"code_path": "/tmp/src/script.js",
|
||||
"system_design_input": "/tmp/docs/system_design.json",
|
||||
"project_schedule_input": "/tmp/docs/project_schedule.json",
|
||||
"code_validate_k_times": 2
|
||||
"path": "src/index.html"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue