--- name: ln-220-story-coordinator description: CREATE/REPLAN Stories for Epic (5-10 Stories). Delegates ln-221-standards-researcher for standards research. Decompose-First Pattern. Auto-discovers team/Epic. --- # Story Coordinator Universal Story management coordinator that delegates CREATE/REPLAN operations to specialized workers after building IDEAL Story plan. ## When to Use This Skill Use when: - Decompose Epic to User Stories (5-10 Stories covering Epic scope) - Update existing Stories when Epic requirements change - Rebalance Story scopes within Epic - Add new Stories to existing Epic structure ## Core Pattern: Decompose-First **Key principle:** Build IDEAL Story plan FIRST, THEN check existing Stories to determine mode: - **No existing Stories** → CREATE MODE (delegate to ln-222-story-creator) - **Has existing Stories** → REPLAN MODE (delegate to ln-223-story-replanner) **Rationale:** Ensures consistent Story decomposition based on current Epic requirements, independent of existing Story structure (may be outdated). ## Story Numbering Convention **Rule:** Stories start from Story 1 (US001), NO Story 0 reserved. **Rationale:** - Epic 0 = Infrastructure **Epic** (group of 5-10 Stories like any other Epic) - Stories within Epic 0 numbered normally: US001, US002, ... US010 - No reserved Story 0 (unlike Epics, Stories don't need infrastructure placeholder) **Numbering within Epic:** - Epic 0: Infrastructure → US001-US010 (logging, monitoring, CI/CD Stories) - Epic 1: User Management → US011-US020 (registration, login, profile Stories) - Epic 2: Product Catalog → US021-US030 (product list, search, details Stories) **Next Story Number:** Incremented sequentially across ALL Epics (read from kanban_board.md Epic Story Counters table) ## How It Works ### Phase 1: Context Assembly **Objective:** Gather context for Story planning (Epic details, planning questions, frontend context, fallback docs, user input) **Step 1: Discovery (Automated)** Auto-discovers from `docs/tasks/kanban_board.md`: 1. **Team ID:** Reads Linear Configuration table 2. **Epic:** Parses Epic number from request → Validates in Linear → Loads Epic description - **User format:** "Epic N" (Linear Project number, e.g., "Epic 7: OAuth Authentication") - **Query:** `get_project(query="Epic N")` → Fetch full Epic document - **Extract:** Goal, Scope In/Out, Success Criteria, Technical Notes (Standards Research if Epic created by ln-210 v7.0.0+) - **Note:** Epic N = Linear Project number (global), NOT initiative-internal index (Epic 0-N) 3. **Next Story Number:** Reads Epic Story Counters table → Gets next sequential number **Step 2: Extract Planning Information (Automated)** Parses Epic structure for Story planning questions: | Question | Extraction Source | |----------|-------------------| | **Q1 - User/Persona** | Epic Goal ("Enable [persona]...") + Scope In (user roles) | | **Q2 - What they want** | Epic Scope In (capabilities) + functional requirements | | **Q3 - Why it matters** | Epic Success Criteria (metrics) + Goal (business value) | | **Q4 - Which Epic** | Already from Step 1 | | **Q5 - Main AC** | Derive from Epic Scope In features → testable scenarios | | **Q6 - Application type** | Epic Technical Notes (UI/API mentioned) → Default: API | **Step 3: Frontend Research (Optional)** **Trigger:** If Q2 (capabilities) OR Q5 (AC) missing after Step 2 **Process:** 1. Scan HTML files: `Glob` `**/*.html`, `src/**/*.html` 2. Extract: - Forms → AC scenarios (e.g., `
` → "Given valid credentials, When submit, Then login success") - Buttons/Actions → capabilities (e.g., `