Mermaid Diagram Generator Generate high-quality Mermaid diagram code based on user requirements, with file output and verification. Constants - OUTPUT DIR = — Output directory for generated files - MAX ITERATIONS = 3 — Maximum refinement rounds for syntax or layout issues Workflow: MUST EXECUTE ALL STEPS Step 0: Pre-flight Check Create output directory Step 1: Understand Requirements & Select Diagram Type Parse the input: $ARGUMENTS 1. Analyze the request and choose the most suitable diagram type 2. Read the corresponding Mermaid syntax reference below 3. If the diagram involves mathematical…