Generate mermaid files after completing the system design.

This commit is contained in:
黄伟韬 2024-10-21 14:25:08 +08:00
parent 2a53e30eba
commit 4067127525
2 changed files with 5 additions and 4 deletions

View file

@ -60,9 +60,9 @@ ARCHITECT_INSTRUCTION = """
You are an architect. Your task is to design a software system that meets the requirements.
Note:
1. If Product Requirement Document is provided, read the document and use it as the requirement.
2. If no programming language is specified, use Vite, React, MUI and Tailwind CSS as the programming language.
3. When use Vite, React, MUI and Tailwind CSS, view the default project structure before start to design. Execute "mkdir -p {{project_name}} && tree /path/of/the/template". This must be a single response WITHOUT other commands. React template is in {react_template_path} and Vue template is in {vue_template_path}.
1. If Product Requirement Document is provided, read the document and use it as the requirement. If the Programming Language in PRD is Vite, React, MUI and Tailwind CSS, use the template.
2. Default programming language is Vite, React, MUI and Tailwind CSS. React template is in {react_template_path} and Vue template is in {vue_template_path}.
3. Execute "mkdir -p {{project_name}} && tree /path/of/the/template" to clear template structure if you want to use template. This must be a single response WITHOUT other commands.
4. The system design must adhere to the following rules:
4.1 Chapter in the system design should include:
Implementation approach: Analyze the difficult points of the requirements, select the appropriate open-source framework.
@ -73,6 +73,7 @@ Anything UNCLEAR: Mention unclear project aspects, then try to clarify it.
4.2 System Design Format example:
{system_design_example}
5. Use Editor.write to write the system design in markdown format. The file path must be "{{project}}/docs/system_design.md". Use command_name "end" when the system design is finished.
6. If no memtion, always use Editor.write to write "Program call flow" in a new file name "{{project}}/docs/system_design-sequence-diagram.mermaid" and write "Data structures and interfaces" in a new file "{{project}}/docs/system_design-sequence-diagram.mermaid-class-diagram"
""".format(
system_design_example=SYSTEM_DESIGN_EXAMPLE,
vue_template_path=VUE_TEMPLATE_PATH.absolute(),

View file

@ -537,7 +537,7 @@ class RoleZero(Role):
command_output = await self._end()
elif cmd["command_name"] == "RoleZero.ask_human":
human_response = await self.ask_human(**cmd["args"])
if human_response.strip().lower() in ["<stop>", "stop"]:
if human_response[len("Human response:") :].strip().lower() in ["<stop>", "stop"]:
human_response += "The user has asked me to stop because I have encountered a problem."
self.rc.memory.add(UserMessage(content=human_response, cause_by=RunCommand))
end_output = "\nCommand end executed:"