/sprint
Create data-driven sprint plans using historical velocity, agent capacity analysis, and intelligent story selection based on dependencies and priorities.
Quick Start
/agileflow:sprint [SPRINT=<id>] [DURATION=<days>] [MODE=suggest|commit]Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
SPRINT | No | Auto-generated | Sprint identifier (e.g., "Sprint-42", "2025-W43") |
DURATION | No | 10 | Sprint duration in days |
AGENTS | No | All active | Comma-separated agent IDs to plan for (e.g., AG-UI,AG-API) |
MODE | No | suggest | suggest to preview, commit to save plan to status.json |
FOCUS_EPIC | No | - | Optionally focus sprint on specific epic (e.g., EP-0010) |
Examples
View Sprint Suggestion
/agileflow:sprintAnalyzes current backlog, capacity, and velocity. Shows recommended stories without committing changes.
Plan Specific Sprint
/agileflow:sprint SPRINT=Sprint-42 DURATION=10 MODE=suggestPlans a 10-day sprint and displays preview of recommended stories, risks, and capacity analysis.
Commit Sprint Plan
/agileflow:sprint SPRINT=Sprint-42 DURATION=10 MODE=commitCommits the sprint plan to docs/09-agents/status.json and creates milestone in docs/08-project/milestones.md.
Focus on Specific Epic
/agileflow:sprint FOCUS_EPIC=EP-0010 AGENTS=AG-API MODE=suggestPlans sprint focused on authentication epic, prioritizing stories from that epic for AG-API agent.
Output
The sprint plan report includes:
Capacity Analysis
- Historical velocity: Days completed in last 30 days per agent
- Projected capacity: Estimated capacity for this sprint duration
- Available slots: WIP positions available per agent
- Risk factors: In-review stories that may free capacity
Backlog Status
- Ready stories count
- Blocked stories (may unblock during sprint)
- Eligible stories (dependencies resolved)
Recommended Sprint Commitment
Prioritized list of stories to commit:
✅ US-0042 (1d) - AG-UI - Epic: EP-0010
"User login form with validation"
Dependencies: None ✅
✅ US-0043 (0.5d) - AG-API - Epic: EP-0010
"POST /auth/login endpoint"
Risk: Blocks US-0042 → Schedule first ⚠️Deferred Stories
Stories that can be picked up if capacity frees:
⚠️ US-0055 (1d) - AG-API - Epic: EP-0013
"GET /user/settings endpoint"
→ Move to next sprint or pick up if capacity freesSprint Goals
High-level goals based on epic distribution and priorities.
Risks & Dependencies
- Cross-agent coordination needed
- Dependency chains that need sequencing
- High-impact blockers
- Stories that may complete early
Recommendations
- Suggested story sequencing
- Sprint monitoring focus areas
- Daily standup topics
- When to reassess and adjust
Data Sources
The command analyzes:
| Source | Purpose |
|---|---|
docs/09-agents/status.json | Current story status, WIP, assignments |
docs/09-agents/bus/log.jsonl | Historical velocity from completed stories |
docs/08-project/backlog.md | Priority order for story selection |
docs/08-project/roadmap.md | Strategic priorities |
docs/08-project/milestones.md | Deadline constraints |
docs/05-epics/*.md | Epic goals and context |
docs/06-stories/**/*.md | Story details, AC, estimates |
Planning Algorithm
Phase 1: Analyze Capacity
- Count in-progress and in-review stories per agent
- Calculate available slots (max 2 per agent)
- Note which in-review stories may complete soon
Phase 2: Calculate Velocity
- Parse historical completions from bus/log.jsonl (last 30 days)
- Sum story estimates to get total velocity
- Calculate per-agent velocity
- Project capacity for sprint duration
Phase 3: Select Stories
- Filter ready stories (Definition of Ready met)
- Validate dependencies (all deps must be status="done")
- Prioritize by backlog order and epic focus
- Select until capacity reached
- Balance across agents
Phase 4: Assess Risks
- Identify critical path stories
- Check for high-impact blockers
- Flag cross-agent coordination needs
- Find long dependency chains
Phase 5: Commit (if MODE=commit)
- Update status.json with sprint metadata
- Create milestone in milestones.md
- Log sprint planning decision in bus/log.jsonl
Workflow
- Prepare stories - Ensure stories are ready (use
/story-validate) - Analyze capacity - Run
/sprint MODE=suggestto see recommendation - Review risks - Check cross-agent dependencies and blockers
- Adjust if needed - Add/remove stories or adjust sequencing
- Commit plan - Run
/sprint MODE=committo save - Start sprint - Begin with highest priority story
- Monitor progress - Use
/boardand/blockersduring sprint
Story Selection Criteria
Stories are selected in this priority order:
- Must be "ready" status - Definition of Ready met
- Dependencies resolved - All deps have status="done"
- Backlog priority - Order specified in backlog.md
- Epic alignment - Focus epic if specified
- Milestone deadlines - Urgent items from milestones.md
- Team capacity - Don't exceed calculated velocity
- Agent balance - Distribute work evenly
WIP Limits
- Maximum 2 stories in-progress per agent
- Stories in-review may complete soon and free capacity
- Pairing on high-risk stories counts as 2 slots
Common Usage Patterns
Start of Sprint
/agileflow:sprint MODE=suggest # See recommendation
/agileflow:sprint MODE=commit # Commit when ready
/agileflow:assign STORY=US-0042 # Start with first storyMid-Sprint Adjustment
/agileflow:sprint MODE=suggest # Reassess remaining capacity
/agileflow:assign STORY=US-0055 # Pick up deferred story if spaceEnd of Sprint
/agileflow:velocity # Update historical velocity
/agileflow:sprint # Plan next sprintBest Practices
- Plan based on velocity - Historical velocity is better predictor than estimates
- Respect WIP limits - Don't exceed 2 per agent (limits context switching)
- Validate dependencies - Blocked stories won't complete
- Sequence wisely - Backend before frontend when dependencies exist
- Monitor risks - High-impact blockers need daily attention
- Be conservative - Plan to 70-80% capacity, save buffer for issues
- Adjust mid-sprint - If tasks complete early, add deferred stories
Integration with Other Commands
- Before sprint: Use
/depsto understand dependency risks - Before starting: Use
/story-validateon all stories - During sprint: Use
/boardfor daily standup - When blocked: Use
/blockersto surface and resolve - At end: Use
/velocityto update historical data - Next sprint: Use
/sprintagain with updated velocity
Related Commands
/epic- Create feature epics to organize stories/story- Create individual stories/story-validate- Validate stories before sprint/deps- Understand story dependencies and risks/board- View sprint progress during development/blockers- Track and resolve issues/velocity- Measure team capacity/metrics- View sprint analytics
On This Page
/sprintQuick StartParametersExamplesView Sprint SuggestionPlan Specific SprintCommit Sprint PlanFocus on Specific EpicOutputCapacity AnalysisBacklog StatusRecommended Sprint CommitmentDeferred StoriesSprint GoalsRisks & DependenciesRecommendationsData SourcesPlanning AlgorithmPhase 1: Analyze CapacityPhase 2: Calculate VelocityPhase 3: Select StoriesPhase 4: Assess RisksPhase 5: Commit (if MODE=commit)WorkflowStory Selection CriteriaWIP LimitsCommon Usage PatternsStart of SprintMid-Sprint AdjustmentEnd of SprintBest PracticesIntegration with Other CommandsRelated Commands