# Sprints

Sprints are time-boxed cycles of work at the **team level**. A single sprint pulls tasks from any project — frontend, backend, infra — into one focused iteration. Think of it as "what the whole team commits to this cycle."

## Core Features

### Accessing Sprints

Sprints live under the **team** in the sidebar:

```
Team: iKanban
├── Issues
├── Projects
├── Sprints  ← click here
├── Views
├── Documents
└── Members
```

Route: `/teams/{team}/sprints`

For the retrospective board, manual notes, votes, action items, and optional AI drafts, see [Sprint Retrospectives](/docs/tasks/retrospectives).

### Creating a Sprint

1. Click **+ New Sprint**
2. Fill in:
   - **Name** — e.g., "Sprint 3", "Auth Cycle"
   - **Goal** (optional) — What should be accomplished
   - **Start Date** — When the sprint begins
   - **End Date** — When the sprint ends
3. Click **Create**

The sprint starts with **Planned** status.

### Sprint Lifecycle

| Status | What Happens |
|--------|-------------|
| **Planned** | Sprint created, not yet started. "Start Sprint" button visible. |
| **Active** | Team is working on it. Blue border on card. "Complete Sprint" button visible. |
| **Completed** | Sprint ended. Green checkmark. Tasks stay assigned for review. |
| **Cancelled** | Sprint abandoned. Tasks return to backlog. |

Clicking **Start Sprint** shows a confirmation dialog with the task count and date range. If no tasks are assigned, a warning appears suggesting you add tasks first.

### Editing & Deleting

- **Edit** (✎ icon) — Change name, goal, or dates
- **Delete** (🗑 icon) — Confirmation dialog shows how many tasks will move back to backlog

## Task Assignment

### Single Task

Hover any backlog task → a **"Sprint"** dropdown appears on the right. Click it and pick the target sprint.

### Multi-Select Bulk Assignment

1. Use **checkboxes** on backlog tasks to select multiple
2. A floating bar appears: **"X selected" → "Add to sprint" dropdown**
3. Pick a sprint → all selected tasks are assigned at once
4. Click **Clear** to deselect

### Removing Tasks

**Single remove:** Expand a sprint → hover a task → click **✕**

**Bulk remove:** Use checkboxes inside the sprint → click **"Remove from sprint"** → all selected tasks return to backlog

### Backlog

The backlog section shows all team tasks not assigned to any sprint. Tasks are sorted by issue number (most recent first). Click "Show all" to expand beyond the default 20.

## Search

An **inline search bar** is always visible in the sprint page header.

- Type to filter by sprint name or task title/issue number
- Results appear in a dropdown below the search box
- **Click a sprint** → scrolls to and expands that sprint card
- **Click a task** → highlights it with a yellow ring for 3 seconds, scrolls into view
- Each task result shows which sprint it belongs to (or "backlog")
- Clicking a task also shows a detail panel with description, priority, and dates

## Bulk Upload (Import)

Import tasks from a **markdown file** to create them in bulk.

### How to Use

1. Click **Template** (⬇ icon) to download the sample `.md` file
2. Edit the file with your tasks
3. Click **Import** (⬆ icon) to upload
4. Preview dialog shows parsed tasks grouped by section
5. Click **Import X tasks** to create them

### Template Format

```markdown
## Backlog

- Investigate performance regression  project:frontend  priority:2
- Set up staging environment for QA  project:backend  priority:3
- Write API documentation  project:backend

## Sprint 3

- Build notification preferences UI  project:frontend  priority:2
- Add WebSocket reconnection logic  project:backend  priority:1
- Create user onboarding flow  project:frontend  status:inprogress
```

### Tags

| Tag | Example | Description |
|-----|---------|-------------|
| `project:<name>` | `project:frontend` | Assigns to a project. Default: first project. |
| `priority:<1-4>` | `priority:1` | 1=urgent, 2=high, 3=medium, 4=low |
| `status:<value>` | `status:inprogress` | Initial status. Default: todo |

Each `## Section` header is either "Backlog" (no sprint) or a sprint name (must match an existing sprint).

## Analytics

Click the **Analytics** tab next to the Sprints tab to access sprint charts and metrics.

### Sprint Selector

- **Sprint dropdown** — Pick which sprint to analyze
- **Compare dropdown** — Select a second sprint to overlay on the burndown chart
- **Color theme** (🎨) — Choose from 5 themes: Default, Ocean, Sunset, Forest, Purple

### Charts

#### 1. Scope Change (4 metric cards)

Shows sprint discipline:

| Card | Meaning |
|------|---------|
| **Started with** | Tasks at sprint start |
| **Added** | Tasks added after sprint started |
| **Current** | Total tasks now |
| **Scope change** | % increase — flags scope creep if >15% |

#### 2. Sprint Burndown

A step-line chart showing **tasks remaining** (red) vs the **guideline** (gray dashed). The guideline assumes linear progress from total to zero.

- **Below the line** = ahead of schedule
- **Above the line** = behind schedule
- Compare mode overlays a second sprint in a different color

#### 3. Sprint Velocity

Bar chart showing **done** (colored) vs **total** (gray) for each completed or active sprint. Shows whether the team is completing more work over time.

#### 4. Sprint Work Breakdown

Stacked bar per sprint:
- **Green** = Work Completed
- **Light blue** = Work Remaining
- **Dark blue** = Work Added (after sprint start)

A badge shows projected completion based on average velocity of the last 3 sprints.

#### 5. Cycle Time Stats (4 metric cards)

| Card | Meaning |
|------|---------|
| **Average** | Mean time from task creation to completion |
| **Median** | Middle value (less affected by outliers) |
| **Fastest** | Quickest task turnaround |
| **Slowest** | Longest task turnaround |

#### 6. Cycle Time Control Chart

Scatter plot of individual task durations:
- **Green dots** = individual tasks (X = completion date, Y = days taken)
- **Orange line** = average cycle time
- **Blue line** = rolling average (5-task window)

Tasks below the average line indicate fast delivery.

### Downloading Charts

Every chart card has a **⬇ download** button in its header. Click to export the chart as a high-resolution PNG image.

## Tips

- **One active sprint per team** — Focus on finishing the current cycle before starting the next
- **Keep sprints short** — 1-2 weeks gives fast feedback
- **Use the bulk upload** — Plan sprints in a doc, then import with one click
- **Watch scope creep** — If the Scope Change card shows >15%, tasks are being added mid-sprint
- **Review velocity** — Compare completed sprints to see if the team is improving
- **Use cycle time** — Identify tasks that took unusually long and investigate why
