|
| 1 | +```mermaid |
| 2 | +graph TB |
| 3 | + Start([User Input]) --> Router{Route by Pattern} |
| 4 | + |
| 5 | + %% Entry Pattern Routing |
| 6 | + Router -->|"Create release notes for X.Y.Z"| MainWorkflow[Main Workflow] |
| 7 | + Router -->|"Discord release notes for X.Y.Z"| DiscordWorkflow[Discord Workflow] |
| 8 | + Router -->|"Just version: 3.23.14"| VersionOnly[Version-Only Workflow] |
| 9 | + Router -->|"latest"| LatestWorkflow[Latest Version Detection] |
| 10 | + |
| 11 | + %% Main Workflow |
| 12 | + MainWorkflow --> Init[Initialize & Todo List] |
| 13 | + Init --> DataCollection{Data Collection} |
| 14 | + DataCollection -->|Previous version| FindPrevious[list_files: Find previous version] |
| 15 | + DataCollection -->|User provided PRs| DateValidation[Validate Date YYYY-MM-DD] |
| 16 | + DataCollection -->|Fetch from GitHub| FetchPRs[gh cli: Get PRs in date range] |
| 17 | + |
| 18 | + FindPrevious --> FetchPRs |
| 19 | + DateValidation --> ProcessPRs |
| 20 | + FetchPRs --> ProcessPRs |
| 21 | + |
| 22 | + %% PR Processing |
| 23 | + ProcessPRs[PR Processing] --> CreateTemp[Parent: Create temp_pr_analysis.md] |
| 24 | + CreateTemp --> SubtaskLoop{For Each PR} |
| 25 | + SubtaskLoop --> CreateSubtask[new_task: Investigate PR] |
| 26 | + CreateSubtask --> SubtaskWork[Subtask: gh pr view + gh issue view] |
| 27 | + SubtaskWork --> AppendFindings[Subtask: insert_content line 0] |
| 28 | + AppendFindings --> SubtaskLoop |
| 29 | + SubtaskLoop -->|Done| Compilation |
| 30 | + |
| 31 | + %% Compilation & Documentation |
| 32 | + Compilation[Compile Release Notes] --> ReadTemp[Read temp_pr_analysis.md] |
| 33 | + ReadTemp --> Categorize[Categorize: Bug Fixes, Features, etc.] |
| 34 | + Categorize --> CreateFiles[Create Documentation] |
| 35 | + CreateFiles --> ReleaseFile[write_to_file: vX.Y.Z.mdx] |
| 36 | + CreateFiles --> UpdateIndex[apply_diff: index.md] |
| 37 | + CreateFiles --> UpdateSidebar[apply_diff: sidebars.ts] |
| 38 | + CreateFiles --> UpdateCombined[apply_diff: vX.Y.mdx for patches] |
| 39 | + |
| 40 | + ReleaseFile --> Review |
| 41 | + UpdateIndex --> Review |
| 42 | + UpdateSidebar --> Review |
| 43 | + UpdateCombined --> Review |
| 44 | + |
| 45 | + %% Review Phase |
| 46 | + Review[Review Phase] --> CrossRef{Changelog exists?} |
| 47 | + CrossRef -->|Yes| CompareChangelog[Compare with CHANGELOG.md] |
| 48 | + CrossRef -->|No| UserReview |
| 49 | + CompareChangelog --> UserReview[User Review Loop] |
| 50 | + UserReview --> ReviewChoice{User Choice} |
| 51 | + ReviewChoice -->|Make changes| ApplyChanges[Apply requested changes] |
| 52 | + ApplyChanges --> UserReview |
| 53 | + ReviewChoice -->|Create PR| CreatePR[gh pr create] |
| 54 | + ReviewChoice -->|Cancel| End |
| 55 | + |
| 56 | + %% Discord Workflow |
| 57 | + DiscordWorkflow --> ParseVersions[Parse version numbers] |
| 58 | + ParseVersions --> CheckFiles{Files exist?} |
| 59 | + CheckFiles -->|Yes| ApplyTransforms[Discord Transformations] |
| 60 | + CheckFiles -->|No| AskUser[Offer alternatives] |
| 61 | + ApplyTransforms --> RemovePRLinks[Remove PR links] |
| 62 | + RemovePRLinks --> ConvertLinks[Convert to full URLs] |
| 63 | + ConvertLinks --> AddFooter[Add footer link] |
| 64 | + AddFooter --> OutputDiscord[Output text for copying] |
| 65 | + |
| 66 | + %% Version-Only Workflow |
| 67 | + VersionOnly --> ExtractSubtask[new_task: Extract PRs] |
| 68 | + ExtractSubtask --> GetDateRange[Subtask: gh api tag dates] |
| 69 | + GetDateRange --> SearchPRs[Subtask: gh pr list] |
| 70 | + SearchPRs --> WritePRList[Subtask: Write temp_pr_list.md] |
| 71 | + WritePRList --> PresentOptions[Ask user how to proceed] |
| 72 | + PresentOptions --> UserDecision{User Choice} |
| 73 | + UserDecision -->|Full notes| MainWorkflow |
| 74 | + UserDecision -->|Show list| DisplayList[Display PR list] |
| 75 | + UserDecision -->|Select PRs| FilterPRs[Filter selected PRs] |
| 76 | + UserDecision -->|Cancel| End |
| 77 | + DisplayList --> PresentOptions |
| 78 | + FilterPRs --> MainWorkflow |
| 79 | + |
| 80 | + %% Latest Workflow |
| 81 | + LatestWorkflow --> FindLast[list_files: Find last release notes] |
| 82 | + FindLast --> ReadChangelog[read_file: CHANGELOG.md] |
| 83 | + ReadChangelog --> CompareVersions[Find missing versions] |
| 84 | + CompareVersions --> ConfirmVersions[Ask which to process] |
| 85 | + ConfirmVersions --> ProcessSelected{For each version} |
| 86 | + ProcessSelected --> MainWorkflow |
| 87 | + ProcessSelected -->|Next| ProcessSelected |
| 88 | + ProcessSelected -->|Done| End |
| 89 | + |
| 90 | + %% End States |
| 91 | + CreatePR --> End([Complete]) |
| 92 | + OutputDiscord --> End |
| 93 | + |
| 94 | + %% File Structure Reference |
| 95 | + subgraph "File Structure" |
| 96 | + F1[1_main_workflow.xml<br/>Core workflow & routing] |
| 97 | + F2[2_formatting_standards.xml<br/>Document formatting rules] |
| 98 | + F3[3_pr_analysis.xml<br/>PR categorization patterns] |
| 99 | + F4[4_special_workflows.xml<br/>Discord, version-only, latest] |
| 100 | + F5[5_tool_usage.xml<br/>GitHub CLI & file operations] |
| 101 | + F6[6_examples.xml<br/>Key workflow examples] |
| 102 | + end |
| 103 | + |
| 104 | + %% Critical Rules |
| 105 | + subgraph "Critical Rules" |
| 106 | + R1[Date: YYYY-MM-DD<br/>MM = month 01-12] |
| 107 | + R2[Parent creates temp files<br/>Subtasks only append] |
| 108 | + R3[Acknowledge PR author<br/>AND issue reporter] |
| 109 | + R4[User benefits focus<br/>Not technical details] |
| 110 | + end |
| 111 | + |
| 112 | + style MainWorkflow fill:#e1f5fe |
| 113 | + style DiscordWorkflow fill:#f3e5f5 |
| 114 | + style VersionOnly fill:#fff3e0 |
| 115 | + style LatestWorkflow fill:#e8f5e9 |
| 116 | + style CreatePR fill:#c8e6c9 |
| 117 | + style OutputDiscord fill:#c8e6c9 |
| 118 | + style End fill:#ffcdd2 |
| 119 | + style R1 fill:#ffebee |
| 120 | + style R2 fill:#ffebee |
| 121 | +``` |
0 commit comments