Universal Task Replanner
Worker that re-syncs existing tasks to the latest requirements for any task type.
Purpose & Scope
- Load full existing task descriptions from Linear
- Compare them with orchestrator-provided IDEAL plan (implementation/refactoring/test)
- Decide operations (KEEP/UPDATE/OBSOLETE/CREATE) and execute
- Drop NFR items; only functional scope remains
- Update Linear issues and kanban_board.md accordingly
Task Storage Mode
| Aspect |
Linear Mode |
File Mode |
| Load existing |
get_issue(task_id) per task |
Read("docs/tasks/epics/.../tasks/T{NNN}-*.md") per task |
| Update task |
update_issue(id, description) |
Edit task file content |
| Cancel task |
update_issue(id, state: "Canceled") |
Edit status to Canceled |
| Create new |
create_issue(parentId, state: "Backlog") |
Write new T{NNN}-{slug}.md |
File Mode replan:
- Load existing task files via Glob
- Compare with IDEAL plan
- Edit/Write/Update files as needed
- Update
kanban_board.md to reflect changes
Invocation (who/when)
- ln-300-task-coordinator: REPLAN mode when implementation tasks already exist.
- Orchestrators (other groups): Replan refactoring or test tasks as needed.
- Not user-invoked directly.
Inputs
- Common:
taskType, teamId, Story data (id/title/description with AC, Technical Notes, Context), existingTaskIds.
- Implementation: idealPlan (1-6 tasks), guideLinks.
- Refactoring: codeQualityIssues, refactoringPlan, affectedComponents.
- Test: manualTestResults, testPlan (E2E 2-5, Integration 0-8, Unit 0-15, Priority ≤15), infra/doc/cleanup items.
Template Loading
Templates: task_template_implementation.md, refactoring_task_template.md, test_task_template.md
Template Selection by taskType:
implementation → task_template_implementation.md
refactoring → refactoring_task_template.md
test → test_task_template.md
Loading Logic (for each template):
- Check if
docs/templates/{template}.md exists in target project
- IF NOT EXISTS:
a. Create
docs/templates/ directory if missing
b. Copy shared/templates/{template}.md → docs/templates/{template}.md
c. Replace placeholders in the LOCAL copy:
{{TEAM_ID}} → from docs/tasks/kanban_board.md
{{DOCS_PATH}} → "docs" (standard)
- Use LOCAL copy (
docs/templates/{template}.md) for all operations
Rationale: Templates are copied to target project on first use, ensuring:
- Project independence (no dependency on skills repository)
- Customization possible (project can modify local templates)
- Placeholder replacement happens once at copy time
Workflow (concise)
- Load templates per taskType (see Template Loading) and fetch full existing task descriptions.
- Normalize both sides (IDEAL vs existing sections) and run replan algorithm to classify KEEP/UPDATE/OBSOLETE/CREATE.
- Present summary (counts, titles, key diffs). Confirmation required if running interactively.
- Execute operations in Linear: update descriptions, cancel obsolete, create missing with state="Backlog", preserve parentId for updates.
- Update kanban_board.md: remove canceled, add new tasks under Story in Backlog.
- Return operations summary with URLs and warnings.
Type Rules (must hold after update)
| taskType |
Hard rule |
What to enforce |
| implementation |
No new test creation |
Updated/created tasks must not introduce test creation text |
| refactoring |
Regression strategy required |
Issues + severity, 3-phase plan, regression strategy, preserve functionality |
| test |
Risk-based limits |
Priority ≤15 scenarios; E2E 2-5, Integration 0-8, Unit 0-15, Total 10-28; no framework/library/DB tests |
Critical Notes
- MANDATORY: Always pass
state: "Backlog" when creating new tasks (CREATE operation). Linear defaults to team's default status (often "Postponed") if not specified.
- Foundation-First ordering from IDEAL plan is preserved; do not reorder.
- Language preservation: keep existing task language (EN/RU).
- No code snippets; keep to approach/steps/AC/components.
- If Story reality differs (component exists, column exists), propose Story correction to orchestrator.
Definition of Done
- Existing tasks loaded and parsed with correct template.
- IDEAL plan vs existing compared; operations classified.
- Type validation passed for all updated/created tasks.
- Operations executed in Linear (updates, cancels, creations) with parentId intact.
- kanban_board.md updated (Backlog) with correct Epic/Story/indentation.
- Summary returned (KEEP/UPDATE/OBSOLETE/CREATE counts, URLs, warnings).
Reference Files
- Templates (centralized):
shared/templates/task_template_implementation.md, shared/templates/refactoring_task_template.md, shared/templates/test_task_template.md
- Local copies:
docs/templates/*.md (in target project)
- Replan algorithm:
references/replan_algorithm.md
- Kanban format:
docs/tasks/kanban_board.md
Version: 3.0.0
Last Updated: 2025-12-23
1---2name: ln-302-task-replanner3description: Updates ALL task types (implementation/refactoring/test). Compares IDEAL plan vs existing tasks, categorizes KEEP/UPDATE/OBSOLETE/CREATE, applies changes in Linear and kanban.4---5
6# Universal Task Replanner
7
8Worker that re-syncs existing tasks to the latest requirements for any task type.
9
10## Purpose & Scope
11- Load full existing task descriptions from Linear
12- Compare them with orchestrator-provided IDEAL plan (implementation/refactoring/test)
13- Decide operations (KEEP/UPDATE/OBSOLETE/CREATE) and execute
14- Drop NFR items; only functional scope remains
15- Update Linear issues and kanban_board.md accordingly
16
17## Task Storage Mode
18
19| Aspect | Linear Mode | File Mode |
20|--------|-------------|-----------|
21| **Load existing** | `get_issue(task_id)` per task | `Read("docs/tasks/epics/.../tasks/T{NNN}-*.md")` per task |
22| **Update task** | `update_issue(id, description)` | `Edit` task file content |
23| **Cancel task** | `update_issue(id, state: "Canceled")` | `Edit` status to Canceled |
24| **Create new** | `create_issue(parentId, state: "Backlog")` | `Write` new `T{NNN}-{slug}.md` |
25
26**File Mode replan:**
271. Load existing task files via Glob
282. Compare with IDEAL plan
293. Edit/Write/Update files as needed
304. Update `kanban_board.md` to reflect changes
31
32## Invocation (who/when)
33- **ln-300-task-coordinator:** REPLAN mode when implementation tasks already exist.
34- **Orchestrators (other groups):** Replan refactoring or test tasks as needed.
35- Not user-invoked directly.
36
37## Inputs
38- Common: `taskType`, teamId, Story data (id/title/description with AC, Technical Notes, Context), existingTaskIds.
39- Implementation: idealPlan (1-6 tasks), guideLinks.
40- Refactoring: codeQualityIssues, refactoringPlan, affectedComponents.
41- Test: manualTestResults, testPlan (E2E 2-5, Integration 0-8, Unit 0-15, Priority ≤15), infra/doc/cleanup items.
42
43## Template Loading
44
45**Templates:** `task_template_implementation.md`, `refactoring_task_template.md`, `test_task_template.md`
46
47**Template Selection by taskType:**
48- `implementation` → `task_template_implementation.md`
49- `refactoring` → `refactoring_task_template.md`
50- `test` → `test_task_template.md`
51
52**Loading Logic (for each template):**
531. Check if `docs/templates/{template}.md` exists in target project
542. IF NOT EXISTS:
55 a. Create `docs/templates/` directory if missing
56 b. Copy `shared/templates/{template}.md` → `docs/templates/{template}.md`
57 c. Replace placeholders in the LOCAL copy:
58 - `{{TEAM_ID}}` → from `docs/tasks/kanban_board.md`
59 - `{{DOCS_PATH}}` → "docs" (standard)
603. Use LOCAL copy (`docs/templates/{template}.md`) for all operations
61
62**Rationale:** Templates are copied to target project on first use, ensuring:
63- Project independence (no dependency on skills repository)
64- Customization possible (project can modify local templates)
65- Placeholder replacement happens once at copy time
66
67## Workflow (concise)
681) Load templates per taskType (see Template Loading) and fetch full existing task descriptions.
692) Normalize both sides (IDEAL vs existing sections) and run replan algorithm to classify KEEP/UPDATE/OBSOLETE/CREATE.
703) Present summary (counts, titles, key diffs). Confirmation required if running interactively.
714) Execute operations in Linear: update descriptions, cancel obsolete, **create missing with state="Backlog"**, preserve parentId for updates.
725) Update kanban_board.md: remove canceled, add new tasks under Story in Backlog.
736) Return operations summary with URLs and warnings.
74
75## Type Rules (must hold after update)
76| taskType | Hard rule | What to enforce |
77|----------|-----------|-----------------|
78| implementation | No new test creation | Updated/created tasks must not introduce test creation text |
79| refactoring | Regression strategy required | Issues + severity, 3-phase plan, regression strategy, preserve functionality |
80| test | Risk-based limits | Priority ≤15 scenarios; E2E 2-5, Integration 0-8, Unit 0-15, Total 10-28; no framework/library/DB tests |
81
82## Critical Notes
83- **MANDATORY:** Always pass `state: "Backlog"` when creating new tasks (CREATE operation). Linear defaults to team's default status (often "Postponed") if not specified.
84- Foundation-First ordering from IDEAL plan is preserved; do not reorder.
85- Language preservation: keep existing task language (EN/RU).
86- No code snippets; keep to approach/steps/AC/components.
87- If Story reality differs (component exists, column exists), propose Story correction to orchestrator.
88
89## Definition of Done
90- Existing tasks loaded and parsed with correct template.
91- IDEAL plan vs existing compared; operations classified.
92- Type validation passed for all updated/created tasks.
93- Operations executed in Linear (updates, cancels, creations) with parentId intact.
94- kanban_board.md updated (Backlog) with correct Epic/Story/indentation.
95- Summary returned (KEEP/UPDATE/OBSOLETE/CREATE counts, URLs, warnings).
96
97## Reference Files
98- Templates (centralized): `shared/templates/task_template_implementation.md`, `shared/templates/refactoring_task_template.md`, `shared/templates/test_task_template.md`
99- Local copies: `docs/templates/*.md` (in target project)
100- Replan algorithm: `references/replan_algorithm.md`
101- Kanban format: `docs/tasks/kanban_board.md`
102
103---
104**Version:** 3.0.0
105**Last Updated:** 2025-12-23