---
name: Auto-Increment Work Item IDs
---

# Story 56: Auto-Increment Work Item IDs

## User Story

As a developer, I want the server to automatically assign the next sequential ID when creating stories, bugs, or spikes, so that agents don't pick conflicting numbers and I don't have to deduplicate manually.

## Acceptance Criteria

- [ ] `create_story` scans all stories (upcoming, current, archived) to find the highest existing number and assigns N+1
- [ ] `create_bug` scans all bugs (open and archived) to find the highest existing bug number and assigns N+1
- [ ] `create_spike` scans all spikes (open and archived) to find the highest existing spike number and assigns N+1
- [ ] The `name` parameter no longer needs a number prefix — the server prepends it (e.g. `create_story(name="Foo")` → `56_foo.md`)
- [ ] Race condition: if two agents create stories simultaneously, they get distinct IDs (simple file-system lock or retry)
- [ ] Existing `create_story` callers (MCP tool, REST API) continue to work with the new behavior

## Out of Scope

- Reserving ID ranges for parallel agents
- Non-numeric IDs
