graph TD
Start([Start: Verify Story]) --> Phase1[Phase 1: Discovery & Loading
Team ID + project docs
Load Story FULL + Tasks metadata
Validate task breakdown 3-8 tasks]
Phase1 --> Phase2[Phase 2: Critical Solution Review
Standards Hierarchy PRIORITY 1-4]
subgraph Standards [Standards Compliance & Solution Review]
S1[Check industry standards FIRST
OAuth 2.0 REST OpenAPI RFCs
PRIORITY 1]
S1 --> S2[Challenge approach
Best way in 2025?
Research best practices]
S2 --> S3{Documentation
gaps detected?}
S3 -->|None| S9[Continue to Phase 3]
S3 -->|Pattern
trigger| S6[Auto-create Guide
ln-321-guide-creator
HOW to implement]
S3 -->|Package+version
trigger| S7[Auto-create Manual
ln-323-manual-creator
HOW to use library]
S3 -->|Decision
trigger| S8[Auto-create ADR
ln-322-adr-creator
WHY we decided]
S6 --> S10[Save doc paths
for Phase 3 #13]
S7 --> S10
S8 --> S10
S9 --> Phase3
S10 --> Phase3
end
Phase2 --> S1
Phase3[Phase 3: Comprehensive Auto-Fix
16 Verification Criteria #1-#16]
subgraph FixGroups [Auto-Fix Groups A → B → C → D]
GA[Group A: Structural Fixes
#1 Story Structure 8 sections
#2 Tasks Structure 7 sections sequential
#3 Story Statement As a/I want/So that
#4 Acceptance Criteria Given/When/Then]
GA --> GB[Group B: Solution Optimization
#5 Industry Standards RFC compliance
#6 Solution 2025 best practices
#7 Library & Version current stable
#13 Documentation Links insertion]
GB --> GC[Group C: Workflow Optimization
#9 Test Strategy Risk-Based
#10 Test Task Cleanup remove premature
#11 Documentation Integration
#12 Foundation-First Execution]
GC --> GD[Group D: Scope & Quality
#13 Story Size 3-8 tasks x-task-manager
#14 YAGNI Violations
#15 KISS Violations
#16 Code Quality config management]
end
Phase3 --> GA
GD --> Phase4
Phase4[Phase 4: Approve & Notify
Story + ALL Tasks → Todo
kanban_board.md ✅ APPROVED
Approval comment + optional warning
Summary table display]
Phase4 --> End([End: Story ALWAYS Approved])
classDef discovery fill:#E3F2FD,stroke:#1976D2,stroke-width:2px
classDef processing fill:#FFF9C4,stroke:#F57C00,stroke-width:2px
classDef action fill:#C8E6C9,stroke:#388E3C,stroke-width:2px
class Phase1 discovery
class Phase2,S1,S2,S3,Phase3,GA,GB,GC,GD processing
class Phase4 action