From 4c844cbaface0ceafa2d9b7228961123dfebe1d9 Mon Sep 17 00:00:00 2001 From: Evan <58194240+celestial-vault@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:17:46 -0800 Subject: [PATCH] Mermaid system prompt (#1849) * wip * install dependencies * rendering mermaid graphs * fix render failure on streaming * fix bouncy screen by debouncing mermaid parsing * add loading state; clean up styling * replace tag symbols when rendering code * better mermaid theme for visibility * added changeset * remove rehype-mermaid * update webview package.lock * clean up * fix package-lock * remove regular markdown background styling for mermaid blocks * updated system prompt * Update system.ts * reopen pr * revert random change * random change * reopen pr --------- Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Co-authored-by: Evan Fannin --- src/core/prompts/system.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/prompts/system.ts b/src/core/prompts/system.ts index 65e6e7b8eb..40cc212ced 100644 --- a/src/core/prompts/system.ts +++ b/src/core/prompts/system.ts @@ -882,9 +882,10 @@ In each user message, the environment_details will specify the current mode. The ## What is PLAN MODE? - While you are usually in ACT MODE, the user may switch to PLAN MODE in order to have a back and forth with you to plan how to best accomplish the task. -- When starting in PLAN MODE, depending on the user's request, you may need to do some information gathering e.g. using read_file or search_files to get more context about the task. You may also ask the user clarifying questions to get a better understanding of the task. -- Once you've gained more context about the user's request, you should architect a detailed plan for how you will accomplish the task. +- When starting in PLAN MODE, depending on the user's request, you may need to do some information gathering e.g. using read_file or search_files to get more context about the task. You may also ask the user clarifying questions to get a better understanding of the task. You may return mermaid diagrams to visually display your understanding. +- Once you've gained more context about the user's request, you should architect a detailed plan for how you will accomplish the task. Returning mermaid diagrams may be helpful here as well. - Then you might ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it. +- If at any point a mermaid diagram would make your plan clearer to help the user quickly see the structure, you are encouraged to include a Mermaid code block in the response. - Finally once it seems like you've reached a good plan, ask the user to switch you back to ACT MODE to implement the solution. ====