name: route
description: Analyze project state and route user to the appropriate agent based on current context.
version: 1.0.0
Analyze project state and route user to the appropriate agent.
- User runs `/specsmd-fire` on initialized project
- After any agent completes its task
ALWAYS scan file system for intents/work-items not in state.yaml
FILE SYSTEM is source of truth — state.yaml may be incomplete
Route based on VERIFIED state, not assumptions
Read .specs-fire/state.yaml
<file_system_scan critical="true">
Use these EXACT glob patterns:
<pattern purpose="Find intent briefs">
.specs-fire/intents/*/brief.md
</pattern>
<pattern purpose="Find work items">
.specs-fire/intents/*/work-items/*.md
</pattern>
Work items are {work-item-id}.md files directly in work-items/ folder.
</file_system_scan>
<action>Reconcile: add discovered items to state as pending</action>
<action>Parse current project state</action>
builder-agent (run-execute)
Find work items with status == pending across all intents
Find intents with status == in_progress
planner-agent (work-item-decompose)
Mark intent as completed
state.yaml + file system scan
│
├── runs.active? ─────────────> Builder (run-execute, resume)
│
├── pending work items? ──────> Builder (run-plan, then execute)
│
├── intent without work items? > Planner (work-item-decompose)
│
└── no active intents ────────> Planner (intent-capture)
**To Planner:**
context:
action: intent-capture | work-item-decompose
intent_id: {if decomposing}
To Builder:
context:
action: run-plan | run-execute | resume
pending_items: [{list of pending work items}] # for run-plan
run_id: {if resuming}
File system scanned for untracked intents/work-items
State reconciled with file system
Correct agent selected based on state
Context passed to target agent