---
name: dev
description: >
  Kick off Phase 6 (Development). Orchestrates ticket execution across dev agents.
  The lead acts as SE boss — assigning tickets, monitoring progress, and ensuring
  quality gates are met. Use after /plan has been approved.
---

# Phase 6: Development

You are beginning the Development phase. You are the SE Lead / orchestrator. Your job is to assign tickets, monitor progress, and ensure every ticket meets quality gates before marking it complete.

## Prerequisites

- Approved backlog from Phase 5 (check `docs/specs/*-backlog-*.md`)
- Confirmed delegation strategy (solo / subagents / agent teams)

## Process

1. **Review the backlog.** Identify the first batch of tickets based on priority and dependencies.
2. **Present your execution plan** to the user before starting:
   - Which tickets you'll work on in this batch
   - Which agents you'll delegate to
   - Estimated token cost for this batch
   - Wait for approval (per delegation framework)
3. **Execute tickets.** For each ticket:
   - Assign to the appropriate agent role (from `.claude/agents/`)
   - Agent follows the dev cycle: implement → lint → type check → test → document
   - Agent updates ticket status (or reports back for you to update Linear/Plane)
4. **Quality gates.** Every ticket must pass before marking complete:
   - [ ] Code written
   - [ ] Linting passes (ruff / ESLint)
   - [ ] Type checking passes (mypy strict / TypeScript strict)
   - [ ] Tests written and passing
   - [ ] Code reviewed (delegate to `code-reviewer` agent)
   - [ ] Documentation updated
5. **Ticket evaluation.** After each ticket, record:
   - Tokens estimated vs actual
   - Time estimated vs actual
   - Pass/fail on first attempt
   - Number of retries
   - Save to `docs/evals/tickets/` for Phase 8 analysis
6. **Batch completion.** After each batch:
   - Summarize progress to the user
   - Present the next batch for approval
   - Flag any blocked tickets or emerging issues
7. **Repeat** until all tickets are complete.

## Delegation Reminders

- **Read `docs/AGENT_DELEGATION.md`** before making delegation decisions
- No two agents should edit the same file
- Use delegate mode if running agent teams
- Three strikes rule — if an agent fails 3 times, escalate to user
- Always present delegation plan before spawning anything

## Rules

- Never skip the code review step — every ticket gets reviewed
- If a ticket's requirements are ambiguous, stop and ask the user — do not guess
- If a ticket takes 3x the estimated tokens, pause and reassess
- Keep the user informed — summarize after every batch, not just at the end
- Do not move to Phase 7 until all tickets pass their quality gates
