home / skills / levnikolaevich / claude-code-skills / ln-302-task-replanner

ln-302-task-replanner skill

/ln-302-task-replanner

This skill replays and aligns all task types against an IDEAL plan, updating, creating, or canceling tasks in Linear and kanban.

npx playbooks add skill levnikolaevich/claude-code-skills --skill ln-302-task-replanner

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
4.7 KB
---
name: ln-302-task-replanner
description: Updates ALL task types (implementation/refactoring/test). Compares IDEAL plan vs existing tasks, categorizes KEEP/UPDATE/OBSOLETE/CREATE, applies changes in Linear and kanban.
---

> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

# 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

**MANDATORY READ:** Load `shared/references/storage_mode_detection.md` for Linear vs File mode operations.

## 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-8 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

**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)

## 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.

## 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
- **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

Overview

This skill re-syncs all task types (implementation, refactoring, test) by reconciling an orchestrator-provided IDEAL plan with existing tasks. It classifies each task as KEEP, UPDATE, OBSOLETE, or CREATE and applies changes to Linear and the kanban_board.md file. The worker enforces type-specific rules and always creates new tasks in Backlog state.

How this skill works

The worker loads task templates and the full existing task descriptions from Linear or file storage, normalizes IDEAL and existing task sections, and runs a replan algorithm to classify operations. It then applies updates: update descriptions (preserving parentId and language), cancel obsolete tasks, create missing tasks with state="Backlog", and update kanban_board.md accordingly. A concise summary of operations, URLs, and warnings is returned.

When to use it

  • When implementation tasks exist but the orchestrator issues a REPLAN from ln-300-task-coordinator.
  • When refactoring plans or test plans change and tasks must be resynchronized to new requirements.
  • During release prep to ensure task suites match the current IDEAL plan and risk constraints.
  • When onboarding an updated Story that requires preserving Foundation-First ordering without reordering.
  • When teams need automated upkeep of Linear issues and local kanban_board.md consistency.

Best practices

  • Always ensure storage mode detection is correct (Linear vs File) before running the worker.
  • Load and validate the appropriate task template for the taskType (implementation/refactoring/test).
  • Do not introduce test creation text in implementation task updates or creations.
  • Preserve language and parentId on updates, and enforce state="Backlog" for all CREATE operations.
  • Run interactively for confirmable diffs; otherwise validate type-rule constraints programmatically.

Example use cases

  • Replan implementation tasks when an IDEAL plan expands to eight subtasks and existing tasks are outdated.
  • Convert a set of deprecated refactoring tasks into an updated 3-phase refactor with regression strategy enforced.
  • Apply risk-based test plan limits: enforce E2E 2-5, Integration 0-8, Unit 0-15 while creating missing test tasks.
  • Cancel obsolete tasks after scope reduction and add new implementation tasks under the Story in Backlog.
  • Sync kanban_board.md after Linear changes so Story and Backlog entries remain consistent across repo and board.

FAQ

Can the worker create tasks in a state other than Backlog?

No. All CREATED tasks must be created with state: "Backlog" to avoid team default status drift.

Will the worker reorder tasks from the IDEAL plan?

No. The Foundation-First ordering from the IDEAL plan is preserved; the worker never reorders IDEAL tasks.

Does the worker add code snippets to task descriptions?

No. Tasks must avoid code snippets; descriptions should focus on approach, steps, acceptance criteria, and components.