# Skill: Lean - Backlog Management ## Description Manage and prioritize product backlog using WSJF (Weighted Shortest Job First) and lean principles for optimal value delivery. ## Input - **project_id**: Project identifier (required) - **action**: list|add|prioritize|groom|estimate (required) - **item**: Backlog item details for add/update (optional) - **filters**: Status, phase, assignee filters (optional) ## Backlog Item Structure ```json { "id": "BLI-042", "title": "Add dark mode toggle", "description": "Allow users to switch between light and dark themes", "type": "feature|bug|tech_debt|spike", "phase": "empathize|define|ideate|prototype|test", "status": "idea|ready|in_progress|review|done|blocked", "priority_score": 8.5, "scoring": { "user_value": 7, "time_criticality": 3, "risk_reduction": 2, "effort": 3 }, "story_points": 5, "assigned_agent": "frontend|backend|tester|devops|pm", "dependencies": ["BLI-040", "BLI-041"], "labels": ["ux", "settings", "mvp"], "acceptance_criteria": [ "Toggle visible in settings page", "Theme persists across sessions", "Respects system preference by default" ], "created_at": "2024-12-14T10:00:00Z", "updated_at": "2024-12-14T15:30:00Z", "sprint_id": null } ``` ## WSJF Prioritization ### Formula ``` Priority Score = (User Value + Time Criticality + Risk Reduction) / Effort Scale: 1-10 for each factor Result: Higher score = Higher priority ``` ### Scoring Guide **User Value (1-10):** - 10: Core feature, all users need - 7-9: Important feature, most users benefit - 4-6: Nice to have, some users want - 1-3: Edge case, few users affected **Time Criticality (1-10):** - 10: Must ship this sprint, blocking release - 7-9: Needed soon, customer commitment - 4-6: Planned for quarter, flexible timing - 1-3: Backlog, no deadline **Risk Reduction (1-10):** - 10: Eliminates critical security/stability risk - 7-9: Reduces significant technical debt - 4-6: Improves maintainability - 1-3: Minor improvement **Effort (1-10):** - 1-2: Trivial, < 2 hours - 3-4: Small, 2-8 hours - 5-6: Medium, 1-2 days - 7-8: Large, 3-5 days - 9-10: Epic, > 1 week (should be split) ### Priority Buckets ``` Score > 10: 🔥 Critical - Do immediately Score 7-10: ⚡ High - Sprint commitment Score 4-7: 📌 Medium - Plan for next sprint Score < 4: 💤 Low - Future backlog ``` ## Backlog Actions ### List Backlog ```json { "action": "list", "filters": { "status": ["ready", "in_progress"], "phase": "prototype", "label": "mvp" }, "sort": "priority_score", "limit": 20 } ``` ### Add Item ```json { "action": "add", "item": { "title": "Implement password reset flow", "description": "Users need ability to reset forgotten passwords", "type": "feature", "phase": "prototype", "labels": ["auth", "mvp"], "acceptance_criteria": [ "Email sent with reset link", "Link expires after 1 hour", "Password requirements enforced" ] } } ``` ### Prioritize Backlog ```json { "action": "prioritize", "items": [ { "id": "BLI-042", "user_value": 7, "time_criticality": 3, "risk_reduction": 2, "effort": 3 }, { "id": "BLI-043", "user_value": 9, "time_criticality": 8, "risk_reduction": 5, "effort": 5 } ] } ``` ### Groom Items ```json { "action": "groom", "item_id": "BLI-042", "updates": { "description": "Updated description with more detail", "acceptance_criteria": ["New criteria"], "story_points": 8, "status": "ready" } } ``` ## Output Format ```json { "status": "success", "action": "list", "backlog": { "total_items": 45, "ready_items": 12, "in_progress": 5, "blocked": 1 }, "items": [ { "id": "BLI-043", "title": "User authentication", "priority_score": 7.33, "status": "ready", "story_points": 8, "phase": "prototype" } ], "recommendations": [ { "type": "split", "item_id": "BLI-050", "reason": "Effort score 9 - consider breaking into smaller items" }, { "type": "prioritize", "item_id": "BLI-043", "reason": "High time criticality, move to top" } ], "next_step": "Plan sprint with /sprint plan" } ``` ## AI Advisory ### Recommendations Engine ```javascript function generateRecommendations(backlog) { const recommendations = []; // Large items should be split backlog.filter(i => i.scoring.effort >= 8).forEach(item => { recommendations.push({ type: 'split', item_id: item.id, reason: `Effort ${item.scoring.effort} is too high. Split into 2-3 smaller items.`, priority: 'high' }); }); // Blocked items need attention backlog.filter(i => i.status === 'blocked').forEach(item => { recommendations.push({ type: 'unblock', item_id: item.id, reason: `Item blocked. Check dependencies: ${item.dependencies.join(', ')}`, priority: 'critical' }); }); // Old items in "idea" status const oldIdeas = backlog.filter(i => i.status === 'idea' && daysSince(i.created_at) > 30 ); if (oldIdeas.length > 5) { recommendations.push({ type: 'cleanup', reason: `${oldIdeas.length} items in "idea" status for 30+ days. Review or remove.`, priority: 'medium' }); } return recommendations; } ``` ## Quality Gates - [ ] All items have clear titles - [ ] Ready items have acceptance criteria - [ ] WSJF scores calculated - [ ] Dependencies documented - [ ] Large items flagged for splitting - [ ] Blocked items have resolution plan ## Token Budget - Max input: 800 tokens - Max output: 1500 tokens ## Model - Recommended: sonnet (prioritization reasoning) ## Philosophy > "Build less, ship faster. Priority is about saying no." **Keep it simple:** - Small items > Large epics - Done > Perfect - User value > Technical elegance - Weekly grooming beats quarterly planning