AgileFlow

/sprint

PreviousNext

Data-driven sprint planning with velocity forecasting

/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

ParameterRequiredDefaultDescription
SPRINTNoAuto-generatedSprint identifier (e.g., "Sprint-42", "2025-W43")
DURATIONNo10Sprint duration in days
AGENTSNoAll activeComma-separated agent IDs to plan for (e.g., AG-UI,AG-API)
MODENosuggestsuggest to preview, commit to save plan to status.json
FOCUS_EPICNo-Optionally focus sprint on specific epic (e.g., EP-0010)

Examples

View Sprint Suggestion

/agileflow:sprint

Analyzes current backlog, capacity, and velocity. Shows recommended stories without committing changes.

Plan Specific Sprint

/agileflow:sprint SPRINT=Sprint-42 DURATION=10 MODE=suggest

Plans 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=commit

Commits 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=suggest

Plans 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)

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 frees

Sprint 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:

SourcePurpose
docs/09-agents/status.jsonCurrent story status, WIP, assignments
docs/09-agents/bus/log.jsonlHistorical velocity from completed stories
docs/08-project/backlog.mdPriority order for story selection
docs/08-project/roadmap.mdStrategic priorities
docs/08-project/milestones.mdDeadline constraints
docs/05-epics/*.mdEpic goals and context
docs/06-stories/**/*.mdStory 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

  1. Prepare stories - Ensure stories are ready (use /story-validate)
  2. Analyze capacity - Run /sprint MODE=suggest to see recommendation
  3. Review risks - Check cross-agent dependencies and blockers
  4. Adjust if needed - Add/remove stories or adjust sequencing
  5. Commit plan - Run /sprint MODE=commit to save
  6. Start sprint - Begin with highest priority story
  7. Monitor progress - Use /board and /blockers during sprint

Story Selection Criteria

Stories are selected in this priority order:

  1. Must be "ready" status - Definition of Ready met
  2. Dependencies resolved - All deps have status="done"
  3. Backlog priority - Order specified in backlog.md
  4. Epic alignment - Focus epic if specified
  5. Milestone deadlines - Urgent items from milestones.md
  6. Team capacity - Don't exceed calculated velocity
  7. 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 story

Mid-Sprint Adjustment

/agileflow:sprint MODE=suggest    # Reassess remaining capacity
/agileflow:assign STORY=US-0055   # Pick up deferred story if space

End of Sprint

/agileflow:velocity              # Update historical velocity
/agileflow:sprint                # Plan next sprint

Best 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 /deps to understand dependency risks
  • Before starting: Use /story-validate on all stories
  • During sprint: Use /board for daily standup
  • When blocked: Use /blockers to surface and resolve
  • At end: Use /velocity to update historical data
  • Next sprint: Use /sprint again with updated velocity
  • /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