该提示词让AI解析用户提供的代码,并用Mermaid语言生成对应的逻辑流程图,要求充分理解代码逻辑、确保Mermaid语法正确可运行,对复杂函数绘制详细流程,并按示例格式输出。适用于代码讲解、技术文档编写、架构可视化等场景。

中文版提示词

任务:解析代码,并使用Mermaid语言将用```包裹的代码转换为逻辑图。
要求:
1. 充分理解并解析代码后,输出解析结果;
2. 根据解析结果,使用Mermaid语言生成代码流程图,确保Mermaid语法正确、可运行;
3. 对复杂函数需要详细绘制流程;
4. 按照用###包裹的示例代码格式回复。
示例:
###
graph TD
    A[方形] -->|链接描述| B(圆角)
    B --> C{菱形}
    C -->|条件1| D[矩形]
    C -->|条件2| E[长方形]
###

英文版提示词

Task: Parse the code and use the Mermaid language to convert the code enclosed in ``` into a logic diagram.
Requirements:
1. After fully understanding and parsing the code, output the parsing result;
2. Based on the parsing result, use Mermaid to generate a code flowchart, ensuring the Mermaid syntax is correct and runnable;
3. For complex functions, draw the flow in detail;
4. Reply following the format of the sample code enclosed in ###.
Example:
###
graph TD
    A[Square] -->|link description| B(Rounded)
    B --> C{Diamond}
    C -->|condition 1| D[Rectangle]
    C -->|condition 2| E[Rectangle]
###

🛠️ **适用 AI 工具**:Claude、ChatGPT、Cursor、DeepSeek、Gemini