Workflow Diagram
graph TD
Start([Input: epicData, idealPlan, standardsResearch, existingCount]) --> Phase1[Phase 1: Load Existing Stories]
Phase1 --> LoadLoop[Progressive Loading:
For EACH Story ONE BY ONE
get_issue with full description]
LoadLoop --> Phase2[Phase 2: Compare IDEAL vs Existing]
Phase2 --> CompareAll[Match IDEAL to Existing
Fuzzy match: title, persona, capability]
CompareAll --> Categorize[Categorize Operations:
KEEP, UPDATE, OBSOLETE, CREATE]
Categorize --> CheckEdge{Edge cases?}
CheckEdge -->|Split/Merge| DetectComplex[⚠️ Story Split 1→2+
⚠️ Story Merge 2+→1]
CheckEdge -->|Status conflicts| CheckStatus[⚠️ In Progress/Review
❌ Done]
CheckEdge -->|No| Phase3[Phase 3: Show Replan Summary]
DetectComplex --> Phase3
CheckStatus --> Phase3
Phase3 --> ShowSummary[Display:
IDEAL Plan changes
Operations breakdown
Diffs AC/Standards Research
Warnings status/splits/merges]
ShowSummary --> Phase4[Phase 4: User Confirmation]
Phase4 --> CheckApprove{autoApprove?}
CheckApprove -->|true| Phase5
CheckApprove -->|false| WaitConfirm[Wait for 'confirm']
WaitConfirm --> Phase5[Phase 5: Execute Operations]
Phase5 --> ExecKeep[KEEP: Skip N Stories unchanged]
Phase5 --> ExecUpdate[UPDATE: update_issue
new description Backlog/Todo only]
Phase5 --> ExecObsolete[OBSOLETE: update_issue
state=Canceled + comment Backlog/Todo]
Phase5 --> ExecCreate[CREATE: Generate doc
create_issue project=Epic labels=user-story]
ExecKeep --> UpdateKanban[Update kanban_board.md:
Add NEW Stories ONLY
Epic Grouping Algorithm
Update Epic Story Counters]
ExecUpdate --> UpdateKanban
ExecObsolete --> UpdateKanban
ExecCreate --> UpdateKanban
UpdateKanban --> Summary[Display Summary:
Operations executed
URLs Warnings
Next Steps]
Summary --> End([Done])
style Start fill:#4A90E2,stroke:#2E5C8A,color:#fff
style End fill:#26A69A,stroke:#1B5E20,color:#fff
style Phase1 fill:#7E57C2,stroke:#4A148C,color:#fff
style Phase2 fill:#7E57C2,stroke:#4A148C,color:#fff
style Phase3 fill:#7E57C2,stroke:#4A148C,color:#fff
style Phase4 fill:#7E57C2,stroke:#4A148C,color:#fff
style Phase5 fill:#26A69A,stroke:#1B5E20,color:#fff
style CheckEdge fill:#FF9800,stroke:#E65100,color:#fff
style CheckApprove fill:#FF9800,stroke:#E65100,color:#fff
style DetectComplex fill:#F44336,stroke:#B71C1C,color:#fff
style CheckStatus fill:#F44336,stroke:#B71C1C,color:#fff