Loading...
Loading...
Replans Stories when Epic requirements change. Compares IDEAL vs existing, categorizes operations (KEEP/UPDATE/OBSOLETE/CREATE), executes in Linear.
npx skill4agent add levnikolaevich/claude-code-skills ln-222-story-replannerepicDataidealPlanstandardsResearchexistingStoryIdsteamIdautoApprove{
epicData: {id, title, description},
idealPlan: [{number, title, statement, ac, technicalNotes, estimatedHours, testCounts}],
standardsResearch: "OAuth 2.0 (RFC 6749)...", // May differ from existing
existingStoryIds: ["STORY-123", "STORY-124"], // Metadata only
teamId: "team-id",
autoApprove: true
}for each story_id:
get_issue(id=story_id) // ~5,000 tokens per Story| Operation | Criteria | Status Constraint | Action |
|---|---|---|---|
| KEEP | Goal + Persona + Capability + AC + Standards Research same | Any | None |
| UPDATE | Match + (AC OR Standards Research OR Technical Notes changed) | Backlog/Todo ✅<br>In Progress/Review ⚠️<br>Done ❌ | |
| OBSOLETE | No match + Feature removed | Backlog/Todo ✅<br>In Progress/Review ⚠️<br>Done ❌ | |
| CREATE | In IDEAL + No match + New requirement | N/A | Generate doc + |
| Case | Action |
|---|---|
| In Progress OBSOLETE | ⚠️ NO auto-cancel, show warning |
| Done conflicts | Preserve Done, CREATE follow-up |
| Story Split (1 → 2+) | ⚠️ UPDATE first + CREATE new |
| Story Merge (2+ → 1) | ⚠️ UPDATE first + OBSOLETE rest |
| Ambiguous match (>70% similarity) | Show all, select highest |
REPLAN SUMMARY for Epic 7: OAuth Authentication
IDEAL PLAN:
1. US004: Register OAuth client (Persona: Third-party developer)
2. US005: Request access token ← AC5 ADDED! ← RFC 7636 PKCE ADDED!
3. US006: Validate access token
4. US009: Token scope management (NEW!)
EXISTING STORIES:
✓ US004 - Status: Done - KEEP
⚠ US005 - Status: Todo - UPDATE
Changes: Add AC5, Add RFC 7636 to Technical Notes, Add 2 Integration tests
Diff (AC): + AC5 "Given public client, When request with PKCE..."
Diff (Technical Notes): + RFC 7636 (PKCE)
✗ US008 - Status: Todo - OBSOLETE (feature removed)
+ US009 - NEW (14h, 20 tests, OAuth 2.0 Scope standard)
OPERATIONS: 2 keep, 1 update, 1 cancel, 1 create
WARNINGS:
- ⚠️ US005 (Todo): AC changed, Standards Research updated
- ⚠️ US008 (Todo): Feature removed - check dependencies
Type "confirm" to execute.update_issue(id, description=new_description)update_issue(id, state="Canceled")create_issue({title, description, project=Epic, team, labels=["user-story"], state="Backlog"})### BacklogREPLAN EXECUTED for Epic 7
OPERATIONS SUMMARY:
✓ Kept: 2 Stories
✓ Updated: 1 Story (AC/Standards Research changed)
✓ Canceled: 1 Story (feature removed)
✓ Created: 1 Story (new requirement)
UPDATED: [ID: US005](url) - AC5 added, RFC 7636 PKCE added
CANCELED: US008 Custom token formats
NEW: [ID: US009](url) - Token scope management
WARNINGS: US005 (Todo) AC changed
✓ kanban_board.md updated
✓ Standards Research updates: RFC 7636 PKCE added to US005
NEXT STEPS:
1. Review warnings
2. Run ln-310-story-validator on updated/created Stories
3. Use ln-300-task-coordinator to create/replan tasks| Rule | Description |
|---|---|
| Status Constraints | UPDATE/OBSOLETE: Backlog/Todo ✅, In Progress/Review ⚠️, Done ❌ |
| Preserve Done | Never update/cancel Done Stories (CREATE follow-up if conflicts) |
| Story Split/Merge | Detect 1→2+ OR 2+→1, show warnings (complex, impacts Tasks) |
| Clear Diffs | Show before/after for UPDATE (AC, Standards Research, Technical Notes) |
| Meaningful Comments | Explain why updated/canceled (reference removed capabilities) |
| Conservative Updates | Prefer CREATE over UPDATE when in doubt |
| Progressive Loading | Load Stories ONE BY ONE (not all at once, token efficiency) |
shared/references/template_loading_pattern.mdstory_template.mddocs/templates/story_template.mdshared/references/template_loading_pattern.mdshared/references/linear_creation_workflow.mdshared/references/replan_algorithm.mdreferences/shared/templates/story_template.mddocs/templates/story_template.md