Manage structured tickets in .tickets/. Use when: creating tickets, executing/implementing tickets, decomposing tickets into sub-tickets, updating ticket status, creating or closing epics, archiving completed epics, or verifying ticket completion. Handles the full lifecycle: template-based creation, ID assignment, dependency checking, complexity assessment, decomposition, scoped execution, verification, and archival.
.tickets/
_standalone/ # Tickets without a parent epic
_archive/ # Completed epics (read-only historical context)
EPIC-<hex>_<slug>/
EPIC-<hex>_<slug>/ # Active epic directories (hex = 4-char random ID)
_epic.md # Epic ticket
TYPE-NNN_*.md # Sub-tickets (sequential numbering within epic)
Epic directories: EPIC-<hex>_<slug>/ where <hex> is a 4-character random hex ID (e.g., EPIC-a7f3_field-contract/). Sub-ticket files: TYPE-NNN_kebab-slug.md with IDs locally scoped within their epic. Cross-epic references: EPIC-<hex>/TYPE-NNN (e.g., EPIC-a7f3/FEAT-001).
| Prefix | Type | Use case |
|---|---|---|
FEAT | feature | New functionality |
BUG | bug | Defect fix |
REFAC | refactor | Structural improvement, zero behavior change |
CHORE | chore | Maintenance, CI, docs, tooling |
TASK | task | Agent-generated sub-ticket |
EPIC | epic | Parent ticket grouping related work |
to-do --> in-progress --> done
A ticket may also be blocked. in-progress is optional -- agents may go directly from to-do to done.
Generate a 4-character random hex ID. No filesystem scan needed -- eliminates collision risk when multiple agents create epics concurrently.
python -c "import secrets; print(f'EPIC-{secrets.token_hex(2)}')"
Sequential numbering within their directory scope. Find the next available number:
# Within an epic:
ls .tickets/EPIC-*_*/[A-Z]*.md | sed 's|.*/||;s|_.*||' | sort -t- -k1,1 -k2,2rn | awk -F- '!seen[$1]++' | sort
# Standalone:
ls .tickets/_standalone/[A-Z]*.md | sed 's|.*/||;s|_.*||' | sort -t- -k1,1 -k2,2rn | awk -F- '!seen[$1]++' | sort
All epic-related work (creation, execution, orchestration, archival) MUST happen in a git worktree — never directly on the main branch. Main is the integration target; agents never modify it directly.
The agent that creates an epic's tickets and orchestration prompt — or orchestrates epic execution — must work in a worktree, not on main. This prevents accidental main branch mutations when multiple epics run concurrently.
# Ticket-creator / orchestrator worktree setup
git worktree add .claude/worktrees/epic-<hex> -b epic/<hex>/<slug> main
cd .claude/worktrees/epic-<hex>
Sub-ticket agents branch from the epic branch, not main. Paths and branch names are namespaced under the epic hex to prevent collisions when multiple epics run concurrently.
git worktree add .claude/worktrees/epic-<hex>/<ticket-id> -b epic-<hex>/<ticket-id>/<slug> epic/<hex>/<slug>
cd to the primary clone. An agent's working directory is its worktree. All git and gh commands run from there.gh pr create inherits the branch from cwd. Running it from the worktree automatically targets the correct branch — no checkout needed.git add -A or git add . in a worktree-heavy repo. Stage specific files by name._standalone/) is exempt — it may happen on main.python -c "import secrets; print(secrets.token_hex(2))" (e.g., a7f3).git worktree add .claude/worktrees/epic-<hex> -b epic/<hex>/<slug> main..tickets/EPIC-<hex>_<slug>/._epic.md with the generated ID and branch: epic/<hex>/<slug> in frontmatter..prompts/orchestration/epic-<hex>_*.md) in the same worktree..tickets/EPIC-<hex>_<slug>/ or .tickets/_standalone/.TYPE-NNN_kebab-slug.md. Required frontmatter: id, title, type, status.Each epic develops on its own branch, isolating it from other concurrent epics.
epic/<hex>/<slug> -- created from main when the epic starts.This prevents cross-epic conflicts on shared files. Conflicts between epics surface at PR review time, not during agent execution.
Follow in exact order when assigned a ticket.
Read the full ticket file. Understand requirements, constraints, acceptance criteria, and verification commands.
Inspect dependencies in frontmatter. If any dependency status != done, STOP and report the blocker.
If 4+ files or 5+ acceptance criteria, decompose into sub-tickets (Step 4). Otherwise skip to Step 5.
Create TASK-NNN files with parent: set, dependencies: for execution order, agent_created: true, each targeting 1-2 files and <=3 acceptance criteria. Use templates from references/templates.md. Update the parent ticket with a sub-tickets tracking table and set status to in-progress.
Run every command in the ticket's ## Verification section. All must pass.
On the branch, before merge:
status: done and update updated date in frontmatter.{TICKET-ID}: mark ticket as done (separate from implementation work).Every epic MUST include a final closure ticket (typically the last CHORE in merge order) that performs all cleanup. This ticket runs on the epic branch before the PR to main, so main receives a clean state.
The closure ticket must:
done — set status: done and update updated dates.git mv .tickets/EPIC-<hex>_<slug> .tickets/_archive/EPIC-<hex>_<slug>.git rm .prompts/orchestration/epic-<hex>_*.md.docs/INDEX.md — remove this epic's entries from "Active Initiative Artifacts" if present. This must be idempotent: if another epic's closure already merged and removed the entries, do not fail. Do not add to "Completed Initiative Artifacts" (the archive itself is the record).rm -rf .claude/worktrees/epic-<hex> (if the directory exists in the tree).{EPIC-ID}: archive epic and clean up orchestration artifacts.After the epic's PR is merged to main, the orchestrator cleans up only its own worktrees — never other epics':
# Remove only this epic's worktrees and branches
git worktree list | grep '.claude/worktrees/epic-<hex>' | awk '{print $1}' | xargs -I{} git worktree remove {} --force
git branch -d epic/<hex>/<slug>
git branch --list 'epic-<hex>/*' | xargs git branch -d 2>/dev/null
Archived tickets are read-only. Do not modify files under _archive/. Active sources are authoritative when conflicts arise.
## Verification with runnable commands.## Constraints to prevent scope creep.