| name | workflow-routing |
| description | Use when a user request arrives and the appropriate workflow or skill chain is not immediately obvious |
Workflow Routing
Overview
Route user requests to the right workflow based on their goal. Keep main context for coordination; delegate work to agents.
Goal Detection
Detect the user's primary goal from their message:
| Signal | Goal | Skill Chain |
|---|
| "how does", "what is", "find", "understand" | Research | explore → document findings |
| "design", "plan", "break down" | Plan | brainstorming → premortem → writing-plans |
| "spec", "decompose", "break into tasks", "encode" | Encode | beadcraft (decompose mode) |
| "add", "implement", "create", "build" | Build | executing-beads → finishing-work |
| "fix", "broken", "failing", "debug", "bug" | Fix | systematic-debugging → test-driven-development → finishing-work |
| "work task", "pick up a task", "execute task", "do " | Work Task | work-bead |
If intent is clear from context, infer the goal. Otherwise, ask:
What's your primary goal?
1. Research — understand/explore something
2. Plan — design and spec a solution (brainstorming → premortem → writing-plans)
3. Encode — decompose a spec into tasks (beadcraft)
4. Build — execute tasks and ship
5. Fix — debug/fix an issue
Workflow Chains
Research
explore skill at appropriate depth
- Document findings
- Suggest: "Ready for planning?"
Plan
Runs automatically as a single chain — do not stop between steps.
brainstorming — explore requirements, generate design options, make decisions (includes per-decision premortems)
premortem — full plan-level risk analysis on the chosen design
writing-plans — produce a spec document incorporating brainstorming output and premortem mitigations
- Suggest: "Ready to encode into tasks?"
Output: A spec document ready for decomposition.
Encode
Runs automatically — invoke beadcraft and present the tree.
beadcraft (decompose mode) — parse spec into epic + tasks with full quality (Rule of Five, acceptance criteria, Read/Signature/Edges)
- Present task tree for user confirmation
- Suggest: "Ready to build?"
Input: Spec from Plan phase. Output: Task dependency graph.
Build
Runs automatically — execute tasks in dependency order.
executing-beads — TDD cycle per task, quality gate, atomic commit
requesting-code-review — review between batches
finishing-work — integrate and clean up
Input: Task graph from Encode phase.
Fix
systematic-debugging — find root cause
test-driven-development — write failing test, fix
verification-before-completion — verify fix
finishing-work — integrate
Parallel Detection
When tasks are independent, suggest parallel agents:
User: "Research auth patterns and fix the login bug"
→ Detect: 2 independent tasks (Research + Fix)
→ Suggest parallel agents
→ Synthesize results
Main Context = Coordination
Delegate to agents:
- Reading 3+ files → agent
- External research → agent
- Implementation → agent
- Running tests → agent
Keep in main context:
- Understanding user intent
- Workflow selection
- Agent coordination
- Presenting summaries
After Completing a Workflow
Suggest the natural next step:
| After | Suggest |
|---|
| Research | "Ready to plan?" |
| Plan | "Ready to encode into tasks?" |
| Encode | "Ready to build?" |
| Build | "All tasks closed. Ready to finish?" |
| Fix | "Create commit for the fix?" |