Initial commit
This commit is contained in:
65
skills/ln-312-task-replanner/SKILL.md
Normal file
65
skills/ln-312-task-replanner/SKILL.md
Normal file
@@ -0,0 +1,65 @@
|
||||
---
|
||||
name: ln-312-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.
|
||||
---
|
||||
|
||||
# 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
|
||||
|
||||
## Invocation (who/when)
|
||||
- ln-310-story-decomposer: REPLAN mode when implementation tasks already exist.
|
||||
- ln-340-story-quality-gate: Refactoring task needs updates after new findings.
|
||||
- ln-350-story-test-planner: Test task needs updates after manual testing changes.
|
||||
- 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.
|
||||
|
||||
## Workflow (concise)
|
||||
1) Load templates per taskType from ln-311-task-creator/references 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, preserve parentId/state team.
|
||||
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
|
||||
- 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: `../ln-311-task-creator/references/task_template_implementation.md`, `../ln-311-task-creator/references/refactoring_task_template.md`, `../ln-311-task-creator/references/test_task_template.md`
|
||||
- Replan algorithm: `references/replan_algorithm.md`
|
||||
- Kanban format: `docs/tasks/kanban_board.md`
|
||||
|
||||
---
|
||||
Version: 6.0.0 (Condensed replan flow and validation table)
|
||||
Last Updated: 2025-11-26
|
||||
127
skills/ln-312-task-replanner/diagram.html
Normal file
127
skills/ln-312-task-replanner/diagram.html
Normal file
@@ -0,0 +1,127 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>ln-312-task-replanner - Universal Replanner</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>ln-312-task-replanner</h1>
|
||||
<p class="subtitle">Universal Replanner - Worker v1.0.0</p>
|
||||
</header>
|
||||
<div class="info-box">
|
||||
<h2>Overview</h2>
|
||||
<ul>
|
||||
<li><strong>Purpose:</strong> Universal replanner worker for updating existing tasks when Story requirements change</li>
|
||||
<li><strong>Pattern:</strong> Worker v1.0.0 - Invoked by orchestrator (x-task-manager) via Skill tool with taskType parameter</li>
|
||||
<li><strong>Templates:</strong>
|
||||
<ul>
|
||||
<li><code>implementation</code> → task_template_implementation.md (7 sections)</li>
|
||||
<li><code>refactoring</code> → refactoring_task_template.md (7 sections)</li>
|
||||
<li><code>test</code> → test_task_template.md (11 sections)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Comparison Logic:</strong> Match tasks by goal/purpose, categorize changes</li>
|
||||
<li><strong>Input:</strong> IDEAL plan + existing task IDs from orchestrator</li>
|
||||
<li><strong>Output:</strong> Operations summary + diffs + URLs → return to orchestrator</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-box">
|
||||
<h2>Operation Categories</h2>
|
||||
|
||||
<div class="operation-box">
|
||||
<h3>🟢 KEEP</h3>
|
||||
<p>Goals match, no changes needed → Task unchanged</p>
|
||||
</div>
|
||||
|
||||
<div class="operation-box">
|
||||
<h3>🟡 UPDATE</h3>
|
||||
<p>Goals match, but AC/approach changed → Modify description with type-specific validation</p>
|
||||
</div>
|
||||
|
||||
<div class="operation-box">
|
||||
<h3>🔴 OBSOLETE</h3>
|
||||
<p>No match in IDEAL (feature removed) → Cancel task in Linear + add comment</p>
|
||||
</div>
|
||||
|
||||
<div class="operation-box">
|
||||
<h3>🔵 CREATE</h3>
|
||||
<p>In IDEAL but no existing match → New task needed with type-specific validation</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="diagram-container">
|
||||
<div class="mermaid">
|
||||
graph TD
|
||||
Start([Invoked by orchestrator<br/>taskType parameter]) --> SelectTemplate{Select Template<br/>by taskType}
|
||||
|
||||
SelectTemplate -->|implementation| T1[task_template_implementation.md<br/>7 sections]
|
||||
SelectTemplate -->|refactoring| T2[refactoring_task_template.md<br/>7 sections]
|
||||
SelectTemplate -->|test| T3[test_task_template.md<br/>11 sections]
|
||||
|
||||
T1 --> Phase1
|
||||
T2 --> Phase1
|
||||
T3 --> Phase1
|
||||
|
||||
Phase1[Phase 1: Load Existing Tasks<br/>Full descriptions from Linear<br/>Parse sections by template]
|
||||
|
||||
Phase1 --> Phase2[Phase 2: Compare IDEAL vs Existing<br/>Match by goal<br/>Categorize operations]
|
||||
|
||||
Phase2 --> Categorize{Determine operations}
|
||||
Categorize -->|Goals match<br/>No changes| KEEP[KEEP:<br/>Task unchanged]
|
||||
Categorize -->|Goals match<br/>AC/approach changed| UPDATE[UPDATE:<br/>Modify description]
|
||||
Categorize -->|No match in IDEAL<br/>Feature removed| OBSOLETE[OBSOLETE:<br/>Cancel task]
|
||||
Categorize -->|In IDEAL<br/>No existing match| CREATE[CREATE:<br/>New task needed]
|
||||
|
||||
KEEP --> Phase3[Phase 3: Show Operations Summary<br/>+ Diffs for UPDATE<br/>+ Warnings for edge cases]
|
||||
UPDATE --> Phase3
|
||||
OBSOLETE --> Phase3
|
||||
CREATE --> Phase3
|
||||
|
||||
Phase3 --> Phase4{Phase 4: User Confirmation}
|
||||
Phase4 -->|"confirm"| Phase5[Phase 5: Execute Operations]
|
||||
Phase4 -->|Other input| Abort([Abort: Return to orchestrator])
|
||||
|
||||
Phase5 --> Step1[Step 1: UPDATE tasks<br/>Type-specific validation]
|
||||
Step1 --> Step2[Step 2: OBSOLETE tasks<br/>Cancel in Linear<br/>Add comments]
|
||||
Step2 --> Step3[Step 3: CREATE tasks<br/>Generate + create<br/>Type-specific validation]
|
||||
Step3 --> Step4[Step 4: Update kanban_board.md<br/>Remove canceled<br/>Add new tasks]
|
||||
Step4 --> Success([SUCCESS<br/>Return operations summary<br/>+ URLs + warnings])
|
||||
|
||||
style Start fill:#e1f5fe
|
||||
style Success fill:#c8e6c9
|
||||
style Abort fill:#fff9c4
|
||||
style SelectTemplate fill:#e1bee7
|
||||
style T1 fill:#c8e6c9
|
||||
style T2 fill:#fff3e0
|
||||
style T3 fill:#ffcdd2
|
||||
style KEEP fill:#c8e6c9
|
||||
style UPDATE fill:#fff3e0
|
||||
style OBSOLETE fill:#ffcdd2
|
||||
style CREATE fill:#e1bee7
|
||||
style Categorize fill:#fff3e0
|
||||
style Phase4 fill:#fff3e0
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<p>ln-312-task-replanner v1.0.0 | Universal Replanner Pattern | Mermaid.js</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script>
|
||||
mermaid.initialize({
|
||||
startOnLoad: true,
|
||||
theme: 'default',
|
||||
flowchart: {
|
||||
useMaxWidth: true,
|
||||
htmlLabels: true,
|
||||
curve: 'basis'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
665
skills/ln-312-task-replanner/references/replan_algorithm.md
Normal file
665
skills/ln-312-task-replanner/references/replan_algorithm.md
Normal file
@@ -0,0 +1,665 @@
|
||||
# Task Replan Algorithm
|
||||
|
||||
Detailed comparison logic for x-task-coordinator REPLAN MODE. This algorithm determines which operations (KEEP/UPDATE/OBSOLETE/CREATE) to perform when existing tasks are found for a Story.
|
||||
|
||||
## Overview
|
||||
|
||||
When a Story's requirements change and tasks already exist, x-task-coordinator compares the IDEAL task decomposition (from Phase 2) with existing tasks (from Linear) to determine the minimal set of operations needed.
|
||||
|
||||
**Key Principle**: The IDEAL plan from Phase 2 is the source of truth. Existing tasks are compared against this plan.
|
||||
|
||||
## Inputs
|
||||
|
||||
### Phase 2 Output: IDEAL Task Plan
|
||||
|
||||
Result from Story analysis (runs BEFORE checking existing tasks):
|
||||
|
||||
**Structure**:
|
||||
- Task count: 1-4 (based on Story complexity)
|
||||
- Task titles: Descriptive names (e.g., "Implement token generation endpoint")
|
||||
- Task goals: Derived from Story AC
|
||||
- Foundation-First ordering: Database → Repository → Service → API
|
||||
- Estimate per task: 3-5 hours
|
||||
- Guide links: From Story Technical Notes
|
||||
|
||||
**Example IDEAL Plan**:
|
||||
```
|
||||
IDEAL TASK PLAN (3 tasks, 12h total):
|
||||
1. Implement token generation endpoint
|
||||
- Goal: Handle POST /auth/token with credentials
|
||||
- AC: AC1 (valid credentials), AC2 (invalid credentials)
|
||||
- Estimate: 4h
|
||||
|
||||
2. Add token validation middleware
|
||||
- Goal: Validate JWT tokens in protected routes
|
||||
- AC: AC3 (valid token), AC4 (expired token)
|
||||
- Estimate: 3h
|
||||
|
||||
3. Create token refresh logic
|
||||
- Goal: Implement token refresh mechanism
|
||||
- AC: AC5 (refresh with valid refresh token)
|
||||
- Estimate: 5h
|
||||
|
||||
Foundation-First order: ✓
|
||||
Guide links: [JWT Best Practices](../../docs/guides/jwt-best-practices.md)
|
||||
```
|
||||
|
||||
### Linear Data: Existing Tasks
|
||||
|
||||
From `list_issues(parentId=Story.id)`:
|
||||
|
||||
**Structure**:
|
||||
- Task IDs: Linear issue IDs (e.g., "EP7_01", "EP7_02")
|
||||
- Titles: Task titles
|
||||
- Descriptions: Full 7 sections (Context, Implementation Plan, Technical Approach, AC, Components, Existing Code Impact, DoD)
|
||||
- Status: Todo, In Progress, To Review, Done, Canceled
|
||||
|
||||
**Example Existing Tasks**:
|
||||
```
|
||||
EXISTING TASKS (3 found):
|
||||
1. EP7_01: Implement token generation endpoint
|
||||
Status: Done
|
||||
Created: 2025-11-01
|
||||
AC: AC1, AC2
|
||||
|
||||
2. EP7_02: Validate JWT tokens
|
||||
Status: Todo
|
||||
Created: 2025-11-05
|
||||
AC: AC3 (missing AC4!)
|
||||
|
||||
3. EP7_03: Cache tokens in Redis
|
||||
Status: Todo
|
||||
Created: 2025-11-06
|
||||
AC: AC6 (caching requirement)
|
||||
```
|
||||
|
||||
## Comparison Algorithm
|
||||
|
||||
### Step 1: Match by Goal
|
||||
|
||||
For EACH task in IDEAL plan:
|
||||
|
||||
1. **Extract goal** from IDEAL plan task title and description
|
||||
2. **Search existing tasks** for similar goal:
|
||||
- Fuzzy match on titles (e.g., "token generation" matches "Implement token generation")
|
||||
- Check AC overlap (do they cover same Story AC?)
|
||||
- Look for key terms (e.g., "validation", "refresh", "generation")
|
||||
3. **Result**:
|
||||
- If **match found** → Candidate for KEEP or UPDATE
|
||||
- If **no match** → Mark for CREATE
|
||||
|
||||
For EACH existing task:
|
||||
|
||||
1. **Extract goal** from existing task title and AC
|
||||
2. **Search IDEAL plan** for similar goal
|
||||
3. **Result**:
|
||||
- If **match found** → Candidate for KEEP or UPDATE
|
||||
- If **no match** → Mark for OBSOLETE
|
||||
|
||||
### Step 2: Determine Operations
|
||||
|
||||
For EACH existing task:
|
||||
|
||||
#### KEEP Operation
|
||||
|
||||
**Criteria** (ALL must be true):
|
||||
- ✅ Task exists in IDEAL plan (goal matches)
|
||||
- ✅ AC unchanged (compare Story AC sections referenced in task)
|
||||
- ✅ Implementation approach still valid (guide links, patterns)
|
||||
- ✅ Status: Any except Done or Canceled
|
||||
- ✅ No structural changes needed (Affected Components same)
|
||||
|
||||
**Action**: None (task is already correct)
|
||||
|
||||
**Example**:
|
||||
```
|
||||
EP7_01: Implement token generation endpoint
|
||||
- IDEAL plan has: "Token generation endpoint" (AC1, AC2)
|
||||
- Existing task has: AC1, AC2
|
||||
- Status: Done
|
||||
→ KEEP (task matches IDEAL plan, already complete)
|
||||
```
|
||||
|
||||
#### UPDATE Operation
|
||||
|
||||
**Criteria** (ANY must be true):
|
||||
- ⚠️ Task in IDEAL plan BUT AC changed
|
||||
- New AC added to Story
|
||||
- Existing AC modified (conditions changed)
|
||||
- AC removed from task scope
|
||||
- ⚠️ Technical approach changed
|
||||
- New guide links added to Story
|
||||
- Architecture patterns updated
|
||||
- Technology stack changed
|
||||
- ⚠️ Affected components changed
|
||||
- New files to modify
|
||||
- Different layers involved
|
||||
|
||||
**Constraints**:
|
||||
- ✅ Status: Todo or Backlog ONLY
|
||||
- ❌ If In Progress/To Review → WARNING, manual review needed (don't auto-update)
|
||||
- ❌ If Done → WARNING, never update Done tasks
|
||||
|
||||
**Action**: `update_issue(id, description=new_description)`
|
||||
|
||||
**Example**:
|
||||
```
|
||||
EP7_02: Validate JWT tokens
|
||||
- IDEAL plan has: "Token validation middleware" (AC3, AC4)
|
||||
- Existing task has: AC3 ONLY (AC4 missing!)
|
||||
- Status: Todo
|
||||
→ UPDATE (AC4 "Handle expired tokens" added to Story)
|
||||
|
||||
Changes to apply:
|
||||
- Update AC section: Add AC4 scenario
|
||||
- Update Implementation Plan: Add expiration check phase
|
||||
- Update Technical Approach: Reference token expiration guide
|
||||
```
|
||||
|
||||
#### OBSOLETE Operation
|
||||
|
||||
**Criteria** (ALL must be true):
|
||||
- ❌ Task NOT in IDEAL plan (no matching goal)
|
||||
- ❌ Feature removed from Story AC
|
||||
- ❌ OR functionality merged into different task
|
||||
|
||||
**Constraints**:
|
||||
- ✅ Status: Todo or Backlog ONLY
|
||||
- ❌ If In Progress/To Review → WARNING, manual review needed (don't auto-cancel)
|
||||
- ❌ If Done → WARNING, never obsolete Done tasks (work was completed)
|
||||
|
||||
**Action**:
|
||||
```
|
||||
update_issue(id, state="Canceled")
|
||||
```
|
||||
Add comment: "Task canceled due to Story replan. Feature removed from requirements."
|
||||
|
||||
**Example**:
|
||||
```
|
||||
EP7_03: Cache tokens in Redis
|
||||
- IDEAL plan does NOT have: Caching task
|
||||
- Story AC6 (caching requirement) REMOVED
|
||||
- Status: Todo
|
||||
→ OBSOLETE (caching is no longer in scope)
|
||||
|
||||
Action: Cancel task, preserve history
|
||||
```
|
||||
|
||||
#### CREATE Operation
|
||||
|
||||
**Criteria** (ALL must be true):
|
||||
- ✨ Task in IDEAL plan
|
||||
- ✨ No existing task matches goal
|
||||
- ✨ New requirement added to Story
|
||||
|
||||
**Action**: `create_issue(title, description, parentId=Story.id, ...)` (same as CREATE MODE)
|
||||
|
||||
**Example**:
|
||||
```
|
||||
IDEAL plan has: "Email validation" (NEW AC6)
|
||||
- No existing task for email validation
|
||||
- New requirement added to Story
|
||||
→ CREATE (new task needed)
|
||||
|
||||
Generate:
|
||||
- Title: "EP7_04: Validate email format in registration"
|
||||
- Description: Full 7 sections
|
||||
- AC: AC6 from Story
|
||||
- parentId: Story.id
|
||||
```
|
||||
|
||||
### Step 3: Handle Edge Cases
|
||||
|
||||
#### Edge Case 1: Obsolete Task In Progress
|
||||
|
||||
**Scenario**: Task is marked OBSOLETE but status is In Progress or To Review.
|
||||
|
||||
**Problem**: Someone is actively working on this task, auto-canceling would waste work.
|
||||
|
||||
**Action**:
|
||||
```
|
||||
WARNING: "Task EP7_03 is In Progress but no longer in IDEAL plan. Manual review needed."
|
||||
- Do NOT auto-cancel
|
||||
- Show in operations summary with ⚠️ warning
|
||||
- Let user decide:
|
||||
- Complete the task and cancel later?
|
||||
- Cancel now and abandon work?
|
||||
- Merge work into different task?
|
||||
```
|
||||
|
||||
#### Edge Case 2: UPDATE Task To Review
|
||||
|
||||
**Scenario**: Task needs UPDATE (AC changed) but status is To Review (awaiting review).
|
||||
|
||||
**Problem**: Task already completed and awaiting review, updating would invalidate the review.
|
||||
|
||||
**Action**:
|
||||
```
|
||||
WARNING: "Task EP7_02 is To Review but AC changed. Review may need to restart."
|
||||
- Show diff (old AC vs new AC)
|
||||
- Let user decide:
|
||||
- Update now (review must restart)?
|
||||
- Wait for review to complete, then update?
|
||||
- Cancel task and create new one?
|
||||
```
|
||||
|
||||
#### Edge Case 3: IDEAL Plan Differs from Done Tasks
|
||||
|
||||
**Scenario**: IDEAL plan significantly differs from completed Done tasks.
|
||||
|
||||
**Problem**: Work was completed under old requirements, new requirements are different.
|
||||
|
||||
**Action**:
|
||||
```
|
||||
WARNING: "Story requirements changed significantly. Done tasks may need follow-up work."
|
||||
- NEVER update or cancel Done tasks (preserve completed work)
|
||||
- If new requirements conflict with Done work → CREATE new task to address discrepancy
|
||||
- Example:
|
||||
- Done: "EP7_01: Token generation with JWT"
|
||||
- IDEAL: "Token generation with OAuth2" (different approach!)
|
||||
- Action: CREATE "EP7_04: Migrate token generation to OAuth2"
|
||||
```
|
||||
|
||||
#### Edge Case 4: Multiple Tasks Match Same IDEAL Goal
|
||||
|
||||
**Scenario**: Two existing tasks both match same IDEAL plan goal.
|
||||
|
||||
**Problem**: Duplicate work, unclear which to keep.
|
||||
|
||||
**Action**:
|
||||
```
|
||||
WARNING: "Multiple tasks match same IDEAL goal. Manual consolidation needed."
|
||||
- EP7_02: "Validate JWT tokens" (Todo)
|
||||
- EP7_05: "Add token validation" (In Progress)
|
||||
- Both match IDEAL: "Token validation middleware"
|
||||
|
||||
Let user decide:
|
||||
- Keep EP7_05 (In Progress), obsolete EP7_02?
|
||||
- Merge both into one task?
|
||||
```
|
||||
|
||||
#### Edge Case 5: AC Count Mismatch
|
||||
|
||||
**Scenario**: IDEAL plan has 5 AC, but distributed differently across tasks than existing tasks.
|
||||
|
||||
**Problem**: AC reassignment between tasks.
|
||||
|
||||
**Action**:
|
||||
```
|
||||
EXAMPLE:
|
||||
IDEAL Plan:
|
||||
- Task 1: AC1, AC2, AC3 (endpoint)
|
||||
- Task 2: AC4, AC5 (middleware)
|
||||
|
||||
Existing Tasks:
|
||||
- EP7_01: AC1, AC2 (endpoint) - Done
|
||||
- EP7_02: AC3, AC4, AC5 (middleware) - Todo
|
||||
|
||||
Operations:
|
||||
- EP7_01: KEEP (Done, matches AC1, AC2)
|
||||
- EP7_02: UPDATE (AC3 moved to Task 1, remove from EP7_02)
|
||||
- BUT AC3 implementation may be in EP7_02 code!
|
||||
- WARNING: "AC3 reassigned. Manual code review needed."
|
||||
```
|
||||
|
||||
## Example Scenarios
|
||||
|
||||
### Scenario 1: AC Change (UPDATE)
|
||||
|
||||
**Story**: US001 OAuth Authentication
|
||||
**Change**: AC4 "Handle expired tokens" ADDED to Story
|
||||
|
||||
**IDEAL Plan** (Phase 2):
|
||||
```
|
||||
1. Token generation endpoint (AC1, AC2)
|
||||
2. Token validation middleware (AC3, AC4) ← AC4 NEW!
|
||||
3. Token refresh logic (AC5)
|
||||
```
|
||||
|
||||
**Existing Tasks**:
|
||||
```
|
||||
1. EP7_01: Token generation (AC1, AC2) - Done
|
||||
2. EP7_02: Validate tokens (AC3 ONLY) - Todo
|
||||
3. EP7_03: Token refresh (AC5) - In Progress
|
||||
```
|
||||
|
||||
**Comparison**:
|
||||
```
|
||||
EP7_01 vs IDEAL Task 1:
|
||||
- Goals match: ✓ (token generation)
|
||||
- AC match: ✓ (AC1, AC2)
|
||||
- Status: Done
|
||||
→ KEEP
|
||||
|
||||
EP7_02 vs IDEAL Task 2:
|
||||
- Goals match: ✓ (token validation)
|
||||
- AC match: ✗ (AC3 only, AC4 missing)
|
||||
- Status: Todo
|
||||
→ UPDATE (add AC4)
|
||||
|
||||
EP7_03 vs IDEAL Task 3:
|
||||
- Goals match: ✓ (token refresh)
|
||||
- AC match: ✓ (AC5)
|
||||
- Status: In Progress
|
||||
→ KEEP (In Progress, don't interfere)
|
||||
```
|
||||
|
||||
**Operations Summary**:
|
||||
```
|
||||
KEEP: 2 tasks (EP7_01 Done, EP7_03 In Progress)
|
||||
UPDATE: 1 task (EP7_02 add AC4)
|
||||
OBSOLETE: 0 tasks
|
||||
CREATE: 0 tasks
|
||||
```
|
||||
|
||||
**Diff for EP7_02 UPDATE**:
|
||||
```diff
|
||||
## Acceptance Criteria
|
||||
|
||||
- **Given** valid JWT token in Authorization header
|
||||
**When** request is made to protected route
|
||||
**Then** request proceeds with authenticated user context
|
||||
|
||||
+ **Given** expired JWT token in Authorization header
|
||||
+ **When** request is made to protected route
|
||||
+ **Then** return 401 Unauthorized with "Token expired" message
|
||||
```
|
||||
|
||||
### Scenario 2: Feature Removed (OBSOLETE)
|
||||
|
||||
**Story**: US001 OAuth Authentication
|
||||
**Change**: Caching requirement REMOVED from Story (AC6 deleted)
|
||||
|
||||
**IDEAL Plan** (Phase 2):
|
||||
```
|
||||
1. Token generation endpoint (AC1, AC2)
|
||||
2. Token validation middleware (AC3, AC4)
|
||||
3. Token refresh logic (AC5)
|
||||
# NO caching task (AC6 removed)
|
||||
```
|
||||
|
||||
**Existing Tasks**:
|
||||
```
|
||||
1. EP7_01: Token generation (AC1, AC2) - Done
|
||||
2. EP7_02: Validate tokens (AC3, AC4) - Todo
|
||||
3. EP7_03: Cache tokens in Redis (AC6) - Todo ← AC6 REMOVED!
|
||||
```
|
||||
|
||||
**Comparison**:
|
||||
```
|
||||
EP7_01 → KEEP (matches IDEAL Task 1)
|
||||
EP7_02 → KEEP (matches IDEAL Task 2)
|
||||
EP7_03 → OBSOLETE (no matching goal in IDEAL plan, AC6 removed)
|
||||
```
|
||||
|
||||
**Operations Summary**:
|
||||
```
|
||||
KEEP: 2 tasks
|
||||
UPDATE: 0 tasks
|
||||
OBSOLETE: 1 task (EP7_03 caching)
|
||||
CREATE: 0 tasks
|
||||
```
|
||||
|
||||
**Action for EP7_03**:
|
||||
```
|
||||
update_issue(
|
||||
id="EP7_03",
|
||||
state="Canceled"
|
||||
)
|
||||
|
||||
Add comment:
|
||||
"Task canceled due to Story replan. Caching requirement (AC6) removed from Story.
|
||||
Original AC6: Cache JWT tokens in Redis with 1-hour TTL.
|
||||
Reason: Simplified authentication flow, removed caching complexity."
|
||||
```
|
||||
|
||||
### Scenario 3: New Feature Added (CREATE)
|
||||
|
||||
**Story**: US002 User Profile
|
||||
**Change**: NEW AC4 "Upload avatar" ADDED to Story
|
||||
|
||||
**IDEAL Plan** (Phase 2):
|
||||
```
|
||||
1. Create profile endpoint (AC1)
|
||||
2. Update profile endpoint (AC2, AC3)
|
||||
3. Upload avatar (AC4) ← NEW!
|
||||
```
|
||||
|
||||
**Existing Tasks**:
|
||||
```
|
||||
1. EP8_01: Create profile (AC1) - Done
|
||||
2. EP8_02: Update profile (AC2, AC3) - In Progress
|
||||
# NO avatar task
|
||||
```
|
||||
|
||||
**Comparison**:
|
||||
```
|
||||
EP8_01 → KEEP (matches IDEAL Task 1, Done)
|
||||
EP8_02 → KEEP (matches IDEAL Task 2, In Progress)
|
||||
IDEAL Task 3 → CREATE (no existing task for avatar upload)
|
||||
```
|
||||
|
||||
**Operations Summary**:
|
||||
```
|
||||
KEEP: 2 tasks
|
||||
UPDATE: 0 tasks
|
||||
OBSOLETE: 0 tasks
|
||||
CREATE: 1 task (avatar upload)
|
||||
```
|
||||
|
||||
**New Task EP8_03**:
|
||||
```
|
||||
Title: "EP8_03: Implement avatar upload for user profile"
|
||||
|
||||
Description: (7 sections)
|
||||
- Context: Users need to upload profile pictures
|
||||
- Implementation Plan: File upload, validation, storage, URL generation
|
||||
- Technical Approach: Multipart form data, S3/local storage, image processing
|
||||
- AC: AC4 from Story (upload, size limits, format validation)
|
||||
- Affected Components: src/api/profile.ts, src/services/storage.ts
|
||||
- Existing Code Impact: Add storage service, update profile model
|
||||
- DoD: Upload works, validation enforced, images stored securely
|
||||
|
||||
Estimate: 4 hours
|
||||
parentId: US002
|
||||
```
|
||||
|
||||
### Scenario 4: Scope Reduction (Multiple OBSOLETE)
|
||||
|
||||
**Story**: US003 Payment Integration
|
||||
**Change**: PayPal and Refund APIs REMOVED from scope (simplify to Stripe only)
|
||||
|
||||
**IDEAL Plan** (Phase 2):
|
||||
```
|
||||
1. Stripe integration (AC1, AC2)
|
||||
2. Payment webhook (AC3)
|
||||
# PayPal removed
|
||||
# Refund API removed
|
||||
```
|
||||
|
||||
**Existing Tasks**:
|
||||
```
|
||||
1. EP9_01: Stripe integration (AC1, AC2) - Todo
|
||||
2. EP9_02: Payment webhook (AC3) - In Progress
|
||||
3. EP9_03: PayPal integration (AC4) - Todo ← REMOVED!
|
||||
4. EP9_04: Refund API (AC5) - Todo ← REMOVED!
|
||||
```
|
||||
|
||||
**Comparison**:
|
||||
```
|
||||
EP9_01 → KEEP (matches IDEAL Task 1)
|
||||
EP9_02 → KEEP (matches IDEAL Task 2, In Progress)
|
||||
EP9_03 → OBSOLETE (PayPal removed)
|
||||
EP9_04 → OBSOLETE (Refund removed)
|
||||
```
|
||||
|
||||
**Operations Summary**:
|
||||
```
|
||||
KEEP: 2 tasks
|
||||
UPDATE: 0 tasks
|
||||
OBSOLETE: 2 tasks (EP9_03 PayPal, EP9_04 Refund)
|
||||
CREATE: 0 tasks
|
||||
```
|
||||
|
||||
**Warning**:
|
||||
```
|
||||
⚠️ EP9_02 (Payment webhook) is In Progress.
|
||||
Ensure webhook handler still works with reduced scope (Stripe only, no PayPal events).
|
||||
Manual review recommended.
|
||||
```
|
||||
|
||||
### Scenario 5: Complex Reassignment
|
||||
|
||||
**Story**: US004 Search Functionality
|
||||
**Change**: AC3 "Pagination" moved from "Search results" task to "Search API" task
|
||||
|
||||
**IDEAL Plan** (Phase 2):
|
||||
```
|
||||
1. Search API with pagination (AC1, AC2, AC3) ← AC3 moved here!
|
||||
2. Search results display (AC4, AC5)
|
||||
# AC3 was in Task 2, now in Task 1
|
||||
```
|
||||
|
||||
**Existing Tasks**:
|
||||
```
|
||||
1. EP10_01: Search API (AC1, AC2) - Done
|
||||
2. EP10_02: Search results (AC3, AC4, AC5) - Todo ← AC3 should move!
|
||||
```
|
||||
|
||||
**Comparison**:
|
||||
```
|
||||
EP10_01 vs IDEAL Task 1:
|
||||
- Goals match: ✓
|
||||
- AC match: ✗ (AC3 missing, now required)
|
||||
- Status: Done
|
||||
→ KEEP (Done, don't update)
|
||||
→ WARNING: AC3 pagination should be in API but implemented in results!
|
||||
|
||||
EP10_02 vs IDEAL Task 2:
|
||||
- Goals match: ✓
|
||||
- AC match: ✗ (AC3 should not be here)
|
||||
- Status: Todo
|
||||
→ UPDATE? (remove AC3, keep AC4/AC5)
|
||||
→ WARNING: AC3 code may be in EP10_02, refactoring needed!
|
||||
```
|
||||
|
||||
**Operations Summary**:
|
||||
```
|
||||
KEEP: 1 task (EP10_01 Done)
|
||||
UPDATE: 1 task (EP10_02 remove AC3 reference)
|
||||
CREATE: 1 task (NEW: Refactor pagination to API)
|
||||
OBSOLETE: 0 tasks
|
||||
|
||||
WARNINGS:
|
||||
- AC reassignment detected (AC3: results → API)
|
||||
- EP10_01 is Done, cannot update
|
||||
- Code refactoring required (move pagination logic)
|
||||
- Manual intervention needed
|
||||
```
|
||||
|
||||
**Recommended Action**:
|
||||
```
|
||||
Create NEW task:
|
||||
EP10_03: "Refactor pagination from results to API"
|
||||
- Goal: Move pagination logic from search results component to search API endpoint
|
||||
- Reason: AC3 reassignment after EP10_01 completion
|
||||
- Implementation: Extract pagination from EP10_02, integrate into API
|
||||
- Testing: Ensure backward compatibility, update existing tests
|
||||
- Estimate: 3 hours
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
### 1. Be Conservative with Updates
|
||||
|
||||
- **Prefer CREATE over UPDATE** when in doubt
|
||||
- Updating tasks can invalidate work in progress
|
||||
- Creating new tasks preserves existing work
|
||||
|
||||
### 2. Respect Status
|
||||
|
||||
- **Never auto-update In Progress/To Review tasks**
|
||||
- **Never auto-cancel In Progress/To Review tasks**
|
||||
- **Never update/cancel Done tasks**
|
||||
- Show warnings, let user decide
|
||||
|
||||
### 3. Preserve History
|
||||
|
||||
- Use `state="Canceled"` for obsolete tasks (don't delete)
|
||||
- Add comments explaining why task was canceled
|
||||
- Reference removed AC numbers and reasons
|
||||
|
||||
### 4. Handle AC Reassignment Carefully
|
||||
|
||||
- AC moving between tasks is complex
|
||||
- Code may be in wrong task
|
||||
- Requires manual refactoring
|
||||
- Create explicit refactoring tasks
|
||||
|
||||
### 5. Show Clear Diffs
|
||||
|
||||
- For UPDATE operations, show before/after
|
||||
- Highlight added/removed AC
|
||||
- Show technical approach changes
|
||||
- Make review easy for user
|
||||
|
||||
### 6. Warn About Work Loss
|
||||
|
||||
- If canceling task with partial work → warning
|
||||
- If updating task with code changes → warning
|
||||
- If Done task conflicts with new requirements → create follow-up task
|
||||
|
||||
### 7. Foundation-First Validation
|
||||
|
||||
- Ensure IDEAL plan respects Foundation-First execution order
|
||||
- If replan changes order → warning
|
||||
- Dependencies should flow correctly (Database before Repository before Service before API)
|
||||
|
||||
## Output Format
|
||||
|
||||
### Operations Summary
|
||||
|
||||
```
|
||||
REPLAN SUMMARY for US001:
|
||||
|
||||
IDEAL PLAN (from Story analysis):
|
||||
1. Token generation endpoint (AC1, AC2)
|
||||
2. Token validation middleware (AC3, AC4) ← AC4 ADDED!
|
||||
3. Email validation (NEW AC6) ← NEW!
|
||||
|
||||
EXISTING TASKS:
|
||||
✓ EP7_01: Token generation endpoint
|
||||
Status: Done
|
||||
Operation: KEEP (matches plan, already Done)
|
||||
|
||||
⚠ EP7_02: Token validation middleware
|
||||
Status: Todo
|
||||
Operation: UPDATE (AC4 added to Story)
|
||||
Changes:
|
||||
- Add AC4: Handle expired token scenario
|
||||
- Update Implementation Plan with expiration check
|
||||
- Update Technical Approach: Reference token expiration guide
|
||||
|
||||
✗ EP7_03: Cache tokens in Redis
|
||||
Status: Todo
|
||||
Operation: OBSOLETE (caching removed from Story)
|
||||
Action: Cancel task (state="Canceled")
|
||||
|
||||
NEW TASKS:
|
||||
+ EP7_04: Email validation
|
||||
Goal: Validate email format in registration
|
||||
Estimate: 3 hours
|
||||
AC: New AC6 from Story
|
||||
|
||||
OPERATIONS: 1 keep, 1 update, 1 cancel, 1 create
|
||||
|
||||
WARNINGS:
|
||||
- EP7_02 will be updated (AC changed)
|
||||
|
||||
Type "confirm" to execute all operations.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Last Updated:** 2025-11-10
|
||||
Reference in New Issue
Block a user