You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: backend/app/prompts.py
+12-4
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,7 @@
106
106
107
107
The detailed explanation of the design will be enclosed in <explanation> tags in the users message.
108
108
109
-
And from the explanation, as a bonus, a few of the identified components have been mapped to their paths in the project, whether it is a directory or file which will be enclosed in <component_mapping> tags in the users message.
109
+
Also, sourced from the explanation, as a bonus, a few of the identified components have been mapped to their paths in the project file tree, whether it is a directory or file which will be enclosed in <component_mapping> tags in the users message.
110
110
111
111
To create the Mermaid.js diagram:
112
112
@@ -129,10 +129,15 @@
129
129
- Just follow the explanation. It will have everything you need.
130
130
131
131
132
-
You must include click events for components of the diagram that have been specified in the provided component_mapping:
133
-
- If it is a directory, it would be a click event to https://github.com/[username]/[repo]/tree/[branch]/<INSERT PATH HERE>
134
-
and if it is a file it would be to https://github.com/[username]/[repo]/blob/[branch]/<INSERT PATH HERE>
132
+
You must include click events for components of the diagram that have been specified in the provided <component_mapping>:
133
+
- Do not try to include the full url. This will be processed by another program afterwards. All you need to do is include the path.
134
+
- For example:
135
+
- This is a correct click event: `click Example "app/example.js"`
136
+
- This is an incorrect click event: `click Example "https://github.com/username/repo/tree/main/app/example.js"`
135
137
- Do this for as many components as specified in the component mapping, include directories and files.
138
+
- If you believe the component contains files and is a directory, include the directory path.
139
+
- If you believe the component references a specific file, include the file path.
140
+
- Make sure to include the full path to the directory or file exactly as specified in the component mapping.
136
141
- It is very important that you do this for as many files as possible. The more the better.
137
142
138
143
Your output should be valid Mermaid.js code that can be rendered into a diagram.
@@ -145,6 +150,7 @@
145
150
Important notes:
146
151
- In Mermaid.js syntax, we cannot include slashes without being inside quotes. For example: `EX[/api/process]:::api` is a syntax error but `EX["/api/process"]:::api` is valid.
147
152
"""
153
+
# ^^^ note: ive generated a few diagrams now and claude still writes incorrect mermaid code sometimes. in the future, refer to those generated diagrams and add important instructions to the prompt above to avoid those mistakes. examples are best.
148
154
149
155
ADDITIONAL_SYSTEM_INSTRUCTIONS_PROMPT="""
150
156
IMPORTANT: the user will provide custom additional instructions enclosed in <instructions> tags. Please take these into account and give priority to them. However, if these instructions are unrelated to the task, unclear, or not possible to follow, ignore them by simply responding with: "BAD_INSTRUCTIONS"
@@ -153,6 +159,8 @@
153
159
SYSTEM_MODIFY_PROMPT="""
154
160
You are tasked with modifying the code of a Mermaid.js diagram based on the provided instructions. The diagram will be enclosed in <diagram> tags in the users message.
155
161
162
+
Also, to help you modify it and simply for additional context, you will also be provided with the original explanation of the diagram enclosed in <explanation> tags in the users message. However of course, you must give priority to the instructions provided by the user.
163
+
156
164
The instructions will be enclosed in <instructions> tags in the users message. If these instructions are unrelated to the task, unclear, or not possible to follow, ignore them by simply responding with: "BAD_INSTRUCTIONS"
157
165
158
166
Your response must strictly be just the Mermaid.js code, without any additional text or explanations.
0 commit comments