From harness-flow
Routes HF workflows by deciding direct leaf skill invocation versus route-first to hf-workflow-router for new sessions, /hf-* commands, and uncertain entry points.
npx claudepluginhub hujianbest/harness-flow --plugin harness-flowThis skill uses the workspace's default tool permissions.
HF workflow family 的 **public shell**。帮助你决定:
Routes HF workflows at runtime by analyzing artifacts to determine current node, profile, execution mode, branches like hotfix/increment, and review dispatch. Use on 'continue/advance', post-review recovery, conflicts, or unclear stages.
Routes requests into spec-first workflows before substantial work like editing files, running state-changing commands, debugging, reviewing, planning, setup, updates, or architecture decisions.
Routes development tasks to express/standard/deep workflow agents via complexity analysis or --workflow param. Preprocesses args, inits env with bash/pwsh scripts, detects/resumes state. Triggers: /routing.
Share bugs, ideas, or general feedback.
HF workflow family 的 public shell。帮助你决定:
direct invoke:当前节点已明确,直接进入 leaf skillroute-first:阶段/profile/证据不稳定,交给 hf-workflow-router本 skill 是 public entry,不是 runtime handoff。不替代 router 的 authoritative routing。
本 skill 融合以下已验证方法。每个方法在 Workflow 中有对应的落地步骤。
| 方法 | 核心原则 | 来源 | 落地步骤 |
|---|---|---|---|
| Front Controller Pattern | 作为统一入口点,解析用户意图后分发到对应处理节点 | GoF 设计模式 / Martin Fowler, "Patterns of Enterprise Application Architecture" | 步骤 1 — 判断 entry vs recovery;步骤 7 — 正确结束 |
| Evidence-Based Dispatch | 通过读取 feature progress.md 与工件状态判断 entry vs recovery | 项目化实践(HF 核心约定) | 步骤 1 — entry vs runtime recovery;步骤 4 — direct invoke 判断 |
| Separation of Concerns | 入口层只负责意图识别和分发,不做 authoritative routing 或状态修改 | 项目化实践(分层架构原则) | 步骤 7 — 只输出两类结果 |
适用:
/hf-spec、/hf-build、/hf-review 等命令意图auto mode 但还没确定交给哪个节点不适用:已在 leaf skill 内部 → 继续当前 skill;需要 authoritative routing → 直接交给 hf-workflow-router。
若问题仍在产品 thesis/wedge/probe 层面 → 仍由当前 public entry 统一分流,但目标 leaf 应是 hf-product-discovery,而不是再引入第二个 public shell。
若已产出 docs/insights/*-spec-bridge.md 且目标是 formal spec/design/tasks → 可进入 coding family。
entry(用本 skill):新会话、高层意图、命令 bias、direct vs route 选择。
runtime recovery(交给 router):review/gate 刚完成、evidence 冲突、需切支线、需消费 gate 结论 → hf-workflow-router。
归到以下之一:新需求、product discovery、继续推进、review-only、gate-only、当前任务实现、规格相关、hotfix、increment、closeout、Execution Mode 偏好。
用户说 auto mode/自动执行/不用等我确认 → 视为 Execution Mode 偏好,不是新 Profile,不是跳过 approval 的理由,不是 direct invoke 的充分条件。随 handoff 带给下游。
同时满足才可:节点已明确、请求属于该 skill 职责、工件存在可读、无 route/stage/profile 冲突、Execution Mode 偏好已传递。任一不满足 → route-first 交给 router。
如果当前只差 1 个关键事实就能稳定判断 direct invoke vs route-first,先问 1 个最小判别问题,再继续;不要为了这 1 个缺口展开整套 intake,也不要过早假设答案。
适用信号:
不适用:
以上任一命中时,不做入口层小问答,直接 route-first 交给 hf-workflow-router。
| 用户意图 | 可优先尝试 | 不明确时回退 |
|---|---|---|
| 产品发现 / thesis / wedge / probe | hf-product-discovery | hf-workflow-router |
| 规格澄清/修订 | hf-specify | hf-workflow-router |
| UI / 前端 / 页面 / 交互 / 视觉 设计(规格已批准含 UI surface) | hf-ui-design | hf-workflow-router |
| 当前活跃任务实现 | hf-test-driven-dev | hf-workflow-router |
| review/gate 请求 | 具体 review/gate skill(含 hf-ui-review) | hf-workflow-router |
| closeout/finalize | hf-completion-gate / hf-finalize | hf-workflow-router |
| 线上问题修复 | hf-hotfix | hf-workflow-router |
| 范围/验收/约束变化 | hf-increment | hf-workflow-router |
/hf-* 命令是高频意图的薄包装,不拥有独立路由权——一律先经过本 skill 解析,再决定 direct invoke 还是交给 router:
| 命令 | 主意图 | 偏向 direct invoke 的节点 | 不确定时回退 |
|---|---|---|---|
/hf-spec [topic] | 规格澄清 / 修订 / 入口 | hf-specify | hf-workflow-router |
/hf-build [task-id] | 当前活跃任务实现 | hf-test-driven-dev | hf-workflow-router |
/hf-review [spec|design|tasks|test|code|trace|regression|completion] | review / gate 请求 | 具体 review / gate 节点 | hf-workflow-router |
/hf-closeout [task-id] | 完成判断 + 收尾 | hf-completion-gate(gate 未跑)/ hf-finalize(gate 已通过) | hf-workflow-router |
命令规则:
输出只有两类:1) 明确进入合法 leaf skill;2) 明确交给 hf-workflow-router。不在这里展开 transition map、做 review recovery、或把 using-hf-workflow 写进 handoff。
如果结论是 direct invoke,不要只报出目标 skill 名就停下。要在同一回复里进入该 leaf skill 的最小 kickoff:继续执行它的第一步,补最少必要 intake / scope check / preflight,而不是再多等一轮"要不要继续"。
如果结论是 route-first,只说明为什么不能 direct invoke,然后立即转交 hf-workflow-router。不要提前替 router 做业务分析,也不要混入 leaf skill 的启动内容。
唯一确定下一步时用 3 行编号格式:
Entry Classification:direct invoke 或 route-firstTarget Skill:canonical skill 名Why:1-2 条最关键证据3 行快路径用于先给路由结论,不是整轮响应的全部内容。
direct invoke 时,3 行之后继续追加目标 leaf skill 的最小 kickoff,规则如下:
hf-product-discovery、hf-specify、hf-hotfix、hf-increment 这类本来就以 intake 开场的 skill,紧接着给出最小问题集或默认假设route-first 时,不回放 entry matrix、不重讲分层历史、不展开不相关的备选;只说明"为什么不能 direct invoke"然后立即转交。
| 场景 | 用 using-hf-workflow | 不用 |
|---|---|---|
| 新会话入口、意图识别、direct vs route | ✅ | |
| runtime 恢复编排、profile/mode 判断 | → hf-workflow-router | |
| 已在 leaf skill 内部 | → 继续当前 skill | |
| 产品 thesis 层面 | → hf-product-discovery |
| 维度 | Public entry(本 skill) | Router 编排 | Direct invoke |
|---|---|---|---|
| 目标 | 判断该 direct invoke 哪个 leaf 还是交给 router | 决定当前应进入哪个节点 | 完成某个已经明确的节点职责 |
| 最小输入 | 用户请求 + 最少 family entry context + Execution Mode 信号 | 用户请求 + 项目级约定 + 上游工件状态 + 当前 active feature 的 progress.md + review/gate/verification/approval 证据 | 当前节点所需最小工件 + 当前请求 + Execution Mode 信号 |
| 是否判断 profile | 否;profile 不清就回 router | 是 | 否;profile 不清就回 router |
| 是否处理 Execution Mode | 只识别并下传 | 是;归一化并约束 interactive / auto | 只消费已明确的 mode;冲突就回 router |
| 是否决定下一节点 | 只决定"leaf 还是 router" | 是 | 否;只写 canonical handoff,后续编排回到父会话 / router |
| review 如何执行 | 只判断是否进入某 review 节点;进入后由 router/父会话按 review-dispatch 派发 | 由父会话按 review-dispatch protocol 派发 reviewer subagent | 同 router 模式 |
| 输出 | 进入 leaf skill 或交给 hf-workflow-router | 当前阶段判断 + profile + 推荐节点,并立即继续或命中暂停点 | 节点本地工件 + 状态更新 + canonical handoff + 必要 review/verification record |
hf-product-discoveryhf-experimenthf-specifyhf-spec-reviewhf-test-driven-devhf-hotfixhf-incrementhf-finalizeusing-hf-workflow 写进 Next Action Or Recommended Skillusing-hf-workflow 写成完整状态机Next Action Or Recommended Skillhf-product-discovery 的前提下仍发明第二个 product public shell| 文件 | 用途 |
|---|---|
hf-workflow-router/SKILL.md | authoritative runtime routing |
hf-workflow-router/references/workflow-shared-conventions.md | progress schema / verdict 词表 / record_path 语义 / <kind> allowlist 等运行时约定 |
横切行为基线(所有 HF 节点共同遵守,无需外部引用):
当前 pack 已提供 hf-product-discovery 作为 discovery leaf;本 skill 继续作为唯一 public entry,不再引入第二个 product public shell。
direct invoke 时已在同一轮进入 target leaf skill 的最小 kickoffhf-workflow-router