Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:37:27 +08:00
commit 37774aa937
131 changed files with 31137 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
---
name: ln-310-story-decomposer
description: Orchestrates task operations. Analyzes Story, builds optimal plan (1-6 tasks), delegates to ln-311-task-creator (CREATE/ADD) or ln-312-task-replanner (REPLAN). Auto-discovers team ID.
---
# Linear Task Planner (Orchestrator)
Coordinates creation or replanning of implementation tasks for a Story. Builds the ideal plan first, then routes to workers.
## Purpose & Scope
- Auto-discover Team ID, load Story context (AC, Technical Notes, Context)
- Build optimal implementation task plan (1-6 tasks) in Foundation-First order
- Detect mode and delegate: CREATE/ADD -> ln-311-task-creator, REPLAN -> ln-312-task-replanner
- Strip any Non-Functional Requirements; only functional scope becomes tasks
- Never creates/updates Linear or kanban directly (workers do)
## When to Use
- Need tasks for a Story with clear AC/Technical Notes
- Story requirements changed and existing tasks must be updated
- Not for tests (ln-350-story-test-planner handles test tasks)
## Workflow (concise)
- **Phase 1 Discovery:** Auto-discover Team ID (docs/tasks/kanban_board.md); parse Story ID from request.
- **Phase 2 Decompose (always):** Load Story (AC, Technical Notes, Context), assess complexity, build IDEAL plan (1-6 tasks), apply Foundation-First execution order, extract guide links.
- **Phase 3 Check & Detect Mode:** Query Linear for existing tasks (metadata only). Detect mode by count + user keywords (add/replan).
- **Phase 4 Delegate:** Call the right worker with Story data, IDEAL plan/append request, guide links, existing task IDs if any; autoApprove=true.
- **Phase 5 Verify:** Ensure worker returns URLs/summary and updated kanban_board.md; report result.
## Mode Matrix
| Condition | Mode | Delegate | Payload |
|-----------|------|----------|---------|
| Count = 0 | CREATE | ln-311-task-creator | taskType=implementation, Story data, IDEAL plan, guideLinks |
| Count > 0 AND "add"/"append" | ADD | ln-311-task-creator | taskType=implementation, appendMode=true, newTaskDescription, guideLinks |
| Count > 0 AND replan keywords | REPLAN | ln-312-task-replanner | taskType=implementation, Story data, IDEAL plan, guideLinks, existingTaskIds |
| Count > 0 AND ambiguous | ASK | Clarify with user | — |
## Critical Rules
- Decompose-first: always build IDEAL plan before looking at existing tasks.
- Foundation-First execution order: DB -> Repository -> Service -> API -> Frontend.
- Task limits: 1-6 tasks, 3-5h each; cap total at 6 tasks.
- Linear creation must be sequential: create one task, confirm success, then create the next (no bulk) to catch errors early.
- No test creation anywhere in implementation tasks.
- No code snippets in descriptions; workers own task documents and Linear/kanban updates.
- Language preservation: keep Story language (EN/RU) in any generated content by workers.
## Definition of Done (orchestrator)
- Team ID discovered; Story ID parsed.
- Story loaded; IDEAL plan built (1-6 tasks) with Foundation-First order and guide links.
- Existing tasks counted; mode selected (CREATE/ADD/REPLAN or ask).
- Worker invoked with correct payload and autoApprove=true.
- Worker summary received (Linear URLs/operations) and kanban update confirmed.
- Next steps returned (ln-320-story-validator then ln-330-story-executor).
## Reference Files
- Templates owned by ln-311-task-creator: `../ln-311-task-creator/references/task_template_implementation.md`
- Replan algorithm details: `../ln-312-task-replanner/references/replan_algorithm.md`
- Auto-discovery notes: `CLAUDE.md`, `docs/tasks/kanban_board.md`
---
Version: 8.0.0 (Condensed orchestrator flow and mode matrix)
Last Updated: 2025-11-26

View File

@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>x-task-manager - State Diagram</title>
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
<link rel="stylesheet" href="../shared/css/diagram.css">
</head>
<body>
<div class="container">
<header>
<h1>🔧 x-task-manager</h1>
<p class="subtitle">Task Manager - Orchestrator v6.1.0</p>
</header>
<div class="info-box">
<h3>📋 Overview</h3>
<ul>
<li><strong>Purpose:</strong> Orchestrator for task operations (create/replan) with automatic decomposition</li>
<li><strong>Pattern:</strong> Orchestrator v6.1.0 - Delegates to workers (ln-311-task-creator, ln-312-task-replanner) via Skill tool</li>
<li><strong>Decompose-First:</strong> Build IDEAL plan ALWAYS (1-6 tasks), then check existing and delegate to workers</li>
<li><strong>Modes:</strong> CREATE (no tasks → ln-311-task-creator) or REPLAN (has tasks → ln-312-task-replanner)</li>
<li><strong>Ordering:</strong> Foundation-First execution order (Database → Repository → Service → API)</li>
<li><strong>Next Step:</strong> ln-320-story-validator ONLY (обязательная верификация перед выполнением)</li>
</ul>
</div>
<div class="diagram-container">
<div class="mermaid">
%% x-task-manager: Task Manager (Orchestrator v6.1.0)
%% Universal task operations (create/replan) with automatic decomposition
%% Decompose-First Pattern: Build IDEAL plan → Check existing → Delegate to workers
graph TD
Start([Start: x-task-manager<br/>ORCHESTRATOR]) --> Phase1[Phase 1: Discovery<br/>Auto-discover Team ID<br/>Parse Story ID from request]
Phase1 --> Phase2[Phase 2: Analyze & Decompose ALWAYS<br/>Load Story from Linear<br/>Build IDEAL task plan 1-6<br/>Extract guide links<br/>Foundation-First ordering]
Phase2 --> Phase3{Phase 3: Check<br/>Existing Tasks?<br/>Query Linear}
Phase3 -->|Count = 0| CreateMode[CREATE MODE<br/>No existing tasks]
Phase3 -->|Count ≥ 1| ReplanMode[REPLAN MODE<br/>Has existing tasks]
CreateMode --> Phase4a[Phase 4a: Delegate to ln-311-task-creator<br/>Skill tool with:<br/>taskType: "implementation"<br/>+ IDEAL plan + guide links]
Phase4a --> WorkerCreate[ln-311-task-creator WORKER:<br/>• Generate 7-section docs<br/>• Validate NO tests<br/>• Show preview<br/>• User confirms<br/>• Create in Linear<br/>• Update kanban_board.md]
WorkerCreate --> Phase5[Phase 5: Post-Execution<br/>Receive Summary from worker<br/>Return to user]
ReplanMode --> Phase4b[Phase 4b: Delegate to ln-312-task-replanner<br/>Skill tool with:<br/>taskType: "implementation"<br/>+ IDEAL plan + existing IDs]
Phase4b --> WorkerReplan[ln-312-task-replanner WORKER:<br/>• Load existing tasks<br/>• Compare IDEAL vs existing<br/>• Show operations + diffs<br/>• User confirms<br/>• Execute operations<br/>• Update kanban_board.md]
WorkerReplan --> Phase5
Phase5 --> End([End: Return to user<br/>Summary + Linear URLs<br/><br/>Next Step ONLY:<br/>→ ln-320-story-validator])
%% Styling
classDef orchestrator fill:#e1f5fe,stroke:#0277bd,stroke-width:3px
classDef discovery fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef processing fill:#fff9c4,stroke:#f57c00,stroke-width:2px
classDef decision fill:#ffe0b2,stroke:#e64a19,stroke-width:2px
classDef delegation fill:#e1bee7,stroke:#7b1fa2,stroke-width:2px
classDef worker fill:#c8e6c9,stroke:#388e3c,stroke-width:2px
classDef success fill:#a5d6a7,stroke:#2e7d32,stroke-width:2px
class Start orchestrator
class Phase1 discovery
class Phase2,CreateMode,ReplanMode processing
class Phase3 decision
class Phase4a,Phase4b delegation
class WorkerCreate,WorkerReplan worker
class Phase5Create,Phase5Replan,End success
</div>
</div>
<footer>
<p>x-task-manager v6.1.0 | Orchestrator Pattern | Mermaid.js</p>
</footer>
</div>
<script>
mermaid.initialize({ startOnLoad: true, theme: 'default', flowchart: { useMaxWidth: true, htmlLabels: true, curve: 'basis' } });
</script>
</body>
</html>