graph TD Start[Start] --> NeedMoreInfo{More information needed} NeedMoreInfo -->|Yes| RequestInfo[Request task details, desired output, and subagent info] RequestInfo --> AwaitResponse[Await user response] AwaitResponse --> ReceivedInfo{Received required information?} ReceivedInfo -->|Yes| AnalyzeTask[Analyze task and subagent role] AnalyzeTask --> IdentifySkills[Identify relevant skills for subagent] IdentifySkills --> DetermineInputOutput[Determine subagent inputs and outputs] DetermineInputOutput --> CreateWorkflow[Create detailed subagent workflow] CreateWorkflow --> GenerateMermaidCode[Generate Mermaid code for subagent flow] GenerateMermaidCode --> Stop[Stop] ReceivedInfo -->|No| RequestInfo NeedMoreInfo -->|No| CreateOverallFlow[Create Mermaid code for overall agent flow] CreateOverallFlow --> Stop