ln-312-task-replanner

Universal Replanner - Worker v1.0.0

Overview

Operation Categories

🟢 KEEP

Goals match, no changes needed → Task unchanged

🟡 UPDATE

Goals match, but AC/approach changed → Modify description with type-specific validation

🔴 OBSOLETE

No match in IDEAL (feature removed) → Cancel task in Linear + add comment

🔵 CREATE

In IDEAL but no existing match → New task needed with type-specific validation

graph TD Start([Invoked by orchestrator
taskType parameter]) --> SelectTemplate{Select Template
by taskType} SelectTemplate -->|implementation| T1[task_template_implementation.md
7 sections] SelectTemplate -->|refactoring| T2[refactoring_task_template.md
7 sections] SelectTemplate -->|test| T3[test_task_template.md
11 sections] T1 --> Phase1 T2 --> Phase1 T3 --> Phase1 Phase1[Phase 1: Load Existing Tasks
Full descriptions from Linear
Parse sections by template] Phase1 --> Phase2[Phase 2: Compare IDEAL vs Existing
Match by goal
Categorize operations] Phase2 --> Categorize{Determine operations} Categorize -->|Goals match
No changes| KEEP[KEEP:
Task unchanged] Categorize -->|Goals match
AC/approach changed| UPDATE[UPDATE:
Modify description] Categorize -->|No match in IDEAL
Feature removed| OBSOLETE[OBSOLETE:
Cancel task] Categorize -->|In IDEAL
No existing match| CREATE[CREATE:
New task needed] KEEP --> Phase3[Phase 3: Show Operations Summary
+ Diffs for UPDATE
+ Warnings for edge cases] UPDATE --> Phase3 OBSOLETE --> Phase3 CREATE --> Phase3 Phase3 --> Phase4{Phase 4: User Confirmation} Phase4 -->|"confirm"| Phase5[Phase 5: Execute Operations] Phase4 -->|Other input| Abort([Abort: Return to orchestrator]) Phase5 --> Step1[Step 1: UPDATE tasks
Type-specific validation] Step1 --> Step2[Step 2: OBSOLETE tasks
Cancel in Linear
Add comments] Step2 --> Step3[Step 3: CREATE tasks
Generate + create
Type-specific validation] Step3 --> Step4[Step 4: Update kanban_board.md
Remove canceled
Add new tasks] Step4 --> Success([SUCCESS
Return operations summary
+ URLs + warnings]) style Start fill:#e1f5fe style Success fill:#c8e6c9 style Abort fill:#fff9c4 style SelectTemplate fill:#e1bee7 style T1 fill:#c8e6c9 style T2 fill:#fff3e0 style T3 fill:#ffcdd2 style KEEP fill:#c8e6c9 style UPDATE fill:#fff3e0 style OBSOLETE fill:#ffcdd2 style CREATE fill:#e1bee7 style Categorize fill:#fff3e0 style Phase4 fill:#fff3e0