---
title: PM Sprints
---

# PM Sprints

## What it is

**PM Sprints** is sprint management for Mission Control boards: time-boxed iterations with velocity
tracking, item assignment, and AI-powered retrospectives.

Sprints let you organize board items into time-boxed iterations. Each sprint has a title, optional
goal, start/end dates, and a status that moves through a fixed lifecycle: planned, active,
completed.

## Where to find it

Sprints are driven from the board itself. Items are assigned to or removed from sprints via the
board toolbar's sprint selector, and completing a sprint opens a completion modal with a rollover
toggle. A retrospective can be generated for any completed sprint. Dashboard widgets render
burndown, velocity, and planned-vs-unplanned charts from the recorded sprint history.

## How it behaves

Items are assigned to or removed from sprints via the board toolbar's sprint selector. When you
complete a sprint, it records velocity stats (points planned vs completed, items total vs
completed, carry-over count, duration) and optionally rolls incomplete items into an auto-created
next sprint with an auto-incremented title.

A retrospective can be generated for any completed sprint. Two paths are available depending on
the board's AI comfort setting: a template-based summary (always free) or an LLM-generated analysis
via Anthropic Haiku (30-second timeout, $5/day spend cap, 1024 max tokens).

### Sprint lifecycle

1. **Create** -- inserted with status `planned`, auto-positioned at the end
2. **Start** -- transitions to `active`; emits a `sprint_started` board event for automations
3. **Assign / Unassign** -- moves items between the backlog (`sprint_id = NULL`) and the active
   sprint
4. **Complete** -- records a `PmSprintHistory` row with velocity stats; optionally carries over
   incomplete items into a new sprint; emits `sprint_ended`
5. **Retrospective** -- analyzes the sprint history (template or LLM path)

### Velocity tracking

Sprint history rows feed two queries: `getSprintHistoryForBoard` (raw history) and
`getSprintVelocityTrend` (aggregated trend points). Dashboard widgets in
`features/dashboard/widgets/` render burndown, velocity, and planned-vs-unplanned charts from this
data.

## For agents

### Key files

- `src/main/services/pm/sprints/pm-sprint-queries.ts` -- read-only SQLite queries (list, get,
  active sprint, items, backlog, history, velocity trend)
- `src/main/services/pm/sprints/pm-sprint-mutations.ts` -- write operations (create, update,
  delete, start, complete, assign, unassign); uses optimistic concurrency via `guardCasConflict`
- `src/main/services/pm/sprints/pm-sprint-mappers.ts` -- pure mappers converting DB rows to
  `SprintDto`, `SprintHistoryDto`, `VelocityTrendPointDto`
- `src/main/services/pm/sprints/sprint-retrospective.ts` -- retrospective generation (template
  path + LLM path with spend cap)
- `src/main/ipc/pm-sprint-handlers.ts` -- 11 IPC handlers (`pm:sprint:*`)
- `src/plugins/mission-control/web/features/board/useSprints.ts` -- React hook with optimistic
  updates
- `src/plugins/mission-control/web/features/board/SprintCompletionDialog.tsx` -- completion modal
  with rollover toggle

### Implementation notes

- 11 IPC channels prefixed `pm:sprint:`: list, create, update, delete, start, complete, assign,
  unassign, backlog, velocity-trend, retrospective
- Input validated with Zod schemas (`pmSprintCreateSchema`, etc.)
- `start` and `complete` emit `BoardEvent` objects for the automation subsystem
- Sprint title auto-increment via `inferNextSprintTitle` (increments trailing number or week)
- Soft delete (`is_deleted = 1`)

## Related

The whole project management system this sits inside is described in
[mission-control.md](mission-control.md), the parent page, and the sibling that plans work at a
larger scale than a single iteration is [pm-goals.md](pm-goals.md). If you want the view that
gathers what is assigned to you personally, read [pm-my-work.md](pm-my-work.md). Every other page
in this library is listed in [INDEX.md](INDEX.md).
