AgentSkillsCN

workflow-routing

当用户的需求传来,而恰当的工作流程或技能链条一时并不显而易见时使用。

SKILL.md
--- frontmatter
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:

SignalGoalSkill Chain
"how does", "what is", "find", "understand"Researchexplore → document findings
"design", "architect", "plan", "break down"Planbrainstormingpremortemwriting-plans
"spec", "decompose", "break into beads", "encode"Encodebeadcraft (decompose mode)
"add", "implement", "create", "build"Buildexecuting-beadsfinishing-work
"fix", "broken", "failing", "debug", "bug"Fixsystematic-debuggingtest-driven-developmentfinishing-work
"work bead", "pick up a bead", "execute bead", "do <id>"Work Beadwork-bead

If intent is clear from context, infer the goal. Otherwise, ask:

code
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 beads (beadcraft)
4. Build — execute beads and ship
5. Fix — debug/fix an issue

Workflow Chains

Research

  1. explore skill at appropriate depth
  2. Document findings
  3. Suggest: "Ready for planning?"

Plan

Runs automatically as a single chain — do not stop between steps.

  1. brainstorming — explore requirements, generate design options, make decisions (includes per-decision premortems)
  2. premortem — full plan-level risk analysis on the chosen design
  3. writing-plans — produce a spec document incorporating brainstorming output and premortem mitigations
  4. Suggest: "Ready to encode into beads?"

Output: A spec document ready for decomposition.

Encode

Runs automatically — invoke beadcraft and present the tree.

  1. beadcraft (decompose mode) — parse spec into epic + task beads with full quality (Rule of Five, acceptance criteria, Read/Signature/Edges)
  2. Present bead tree for user confirmation
  3. Suggest: "Ready to build?"

Input: Spec from Plan phase. Output: Bead dependency graph.

Build

Runs automatically — execute beads in dependency order.

  1. executing-beads — TDD cycle per bead, quality gate, atomic commit
  2. requesting-code-review — review between batches
  3. finishing-work — integrate and clean up

Input: Bead graph from Encode phase.

Fix

  1. systematic-debugging — find root cause
  2. test-driven-development — write failing test, fix
  3. verification-before-completion — verify fix
  4. finishing-work — integrate

Parallel Detection

When tasks are independent, suggest parallel agents:

code
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:

AfterSuggest
Research"Ready to plan?"
Plan"Ready to encode into beads?"
Encode"Ready to build?"
Build"All beads closed. Ready to finish?"
Fix"Create commit for the fix?"