ln-302-task-replanner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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
  • 从Linear加载所有现有任务的完整描述
  • 将其与编排器提供的理想方案(实现/重构/测试)进行对比
  • 确定操作类型(保留/更新/废弃/创建)并执行
  • 移除非功能需求(NFR)项,仅保留功能范围
  • 相应更新Linear中的问题和kanban_board.md文件

Task Storage Mode

任务存储模式

MANDATORY READ: Load
shared/references/storage_mode_detection.md
for Linear vs File mode operations.
必读: 加载
shared/references/storage_mode_detection.md
以了解Linear与文件模式的操作方式。

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.
  • ln-300-task-coordinator: 当实现任务已存在时,使用REPLAN模式调用。
  • 编排器(其他组): 根据需要重规划重构或测试任务。
  • 不直接由用户调用。

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.
  • 通用参数:
    taskType
    、teamId、Story数据(包含验收标准AC、技术说明、上下文的id/标题/描述)、existingTaskIds。
  • 实现任务参数:idealPlan(1-6个任务)、guideLinks。
  • 重构任务参数:codeQualityIssues、refactoringPlan、affectedComponents。
  • 测试任务参数:manualTestResults、testPlan(E2E测试2-5个、集成测试0-8个、单元测试0-15个、优先级≤15)、基础设施/文档/清理项。

Template Loading

模板加载

MANDATORY READ: Load
shared/references/template_loading_pattern.md
for template copy workflow.
Template Selection by taskType:
  • implementation
    task_template_implementation.md
  • refactoring
    refactoring_task_template.md
  • test
    test_task_template.md
Local copies:
docs/templates/*.md
(in target project)
必读: 加载
shared/references/template_loading_pattern.md
以了解模板复制流程。
按taskType选择模板:
  • implementation
    task_template_implementation.md
  • refactoring
    refactoring_task_template.md
  • test
    test_task_template.md
本地副本:
docs/templates/*.md
(位于目标项目中)

Workflow (concise)

工作流程(精简版)

  1. Load templates per taskType (see Template Loading) and fetch full existing task descriptions.
  2. Normalize both sides (IDEAL vs existing sections) and run replan algorithm to classify KEEP/UPDATE/OBSOLETE/CREATE.
  3. Present summary (counts, titles, key diffs). Confirmation required if running interactively.
  4. Execute operations in Linear: update descriptions, cancel obsolete, create missing with state="Backlog", preserve parentId for updates.
  5. Update kanban_board.md: remove canceled, add new tasks under Story in Backlog.
  6. Return operations summary with URLs and warnings.
  1. 根据taskType加载对应模板(参见模板加载部分),并获取所有现有任务的完整描述。
  2. 标准化双方内容(理想方案与现有任务的各个部分),运行重规划算法将任务分类为保留/更新/废弃/创建。
  3. 展示汇总信息(数量、标题、关键差异)。如果以交互方式运行,需要确认操作。
  4. 在Linear中执行操作:更新描述、废弃过时任务、创建缺失任务并设置state="Backlog",更新任务时保留parentId。
  5. 更新kanban_board.md:移除已取消的任务,在Backlog的对应Story下添加新任务。
  6. 返回包含URL和警告信息的操作汇总。

Type Rules (must hold after update)

任务类型规则(更新后必须遵守)

taskTypeHard ruleWhat to enforce
implementationNo new test creationUpdated/created tasks must not introduce test creation text
refactoringRegression strategy requiredIssues + severity, 3-phase plan, regression strategy, preserve functionality
testRisk-based limitsPriority ≤15 scenarios; E2E 2-5, Integration 0-8, Unit 0-15, Total 10-28; no framework/library/DB tests
任务类型硬性规则强制执行内容
implementation不得创建新测试更新/创建的任务中不得包含创建测试的内容
refactoring必须包含回归策略问题+严重程度、三阶段计划、回归策略、保留现有功能
test基于风险的限制优先级≤15的场景;E2E测试2-5个、集成测试0-8个、单元测试0-15个,总计10-28个;不得包含框架/库/数据库测试

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.
  • 强制要求: 创建新任务(CREATE操作)时必须传入
    state: "Backlog"
    。如果未指定,Linear会默认使用团队的默认状态(通常为"Postponed")。
  • 保留理想方案中的“基础优先”排序,不得重新排序。
  • 语言保留:保留现有任务的语言(英文/俄文)。
  • 不得包含代码片段;仅保留方法/步骤/验收标准AC/组件相关内容。
  • 如果Story实际情况与描述不符(如组件已存在、列已存在),向编排器提出Story修正建议。

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).
  • 已使用正确模板加载并解析现有任务。
  • 已对比理想方案与现有任务,并完成操作分类。
  • 所有更新/创建的任务均通过类型验证。
  • 已在Linear中执行操作(更新、取消、创建),且parentId保持完整。
  • 已更新kanban_board.md(Backlog部分),Epic/Story/缩进格式正确。
  • 已返回汇总信息(保留/更新/废弃/创建的数量、URL、警告)。

Reference Files

参考文件

  • Kanban update algorithm:
    shared/references/kanban_update_algorithm.md
  • Template loading:
    shared/references/template_loading_pattern.md
  • Linear creation workflow:
    shared/references/linear_creation_workflow.md
  • Replan algorithm (universal):
    shared/references/replan_algorithm.md
  • Task-specific replan algorithm:
    references/replan_algorithm.md
    (5 scenarios, comparison logic)
  • Storage mode detection:
    shared/references/storage_mode_detection.md
  • 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)
  • Kanban format:
    docs/tasks/kanban_board.md

Version: 3.0.0 Last Updated: 2025-12-23
  • 看板更新算法:
    shared/references/kanban_update_algorithm.md
  • 模板加载:
    shared/references/template_loading_pattern.md
  • Linear创建流程:
    shared/references/linear_creation_workflow.md
  • 通用重规划算法:
    shared/references/replan_algorithm.md
  • 任务专属重规划算法:
    references/replan_algorithm.md
    (5种场景、对比逻辑)
  • 存储模式检测:
    shared/references/storage_mode_detection.md
  • 集中式模板:
    shared/templates/task_template_implementation.md
    ,
    shared/templates/refactoring_task_template.md
    ,
    shared/templates/test_task_template.md
  • 本地副本:
    docs/templates/*.md
    (位于目标项目中)
  • 看板格式:
    docs/tasks/kanban_board.md

Version: 3.0.0 Last Updated: 2025-12-23