Skip to main content

Flow 对象

Flow 是 Huoban 的版式:它声明能力如何排列、上下文如何传递、哪里需要校对、产物如何生成。 Flow 应优先引用 capability,而不是强绑定具体 Skill。具体 Skill 由 Run 或 runtime binding 解析。

spec 字段

字段要求说明
profileRefs可选Flow 默认使用的 Profile。
policyRefs可选Flow 默认使用的 Policy。
stages必填阶段数组。
stages[].id必填稳定 stage id。
stages[].requires.capability推荐需要的能力,例如 huoban.dev/designReview
stages[].uses可选shortcut:直接引用具体 Skill 或 Adapter。
stages[].inputs可选输入来源。
stages[].outputs可选输出 artifact 声明。
checkpoints可选人工或规则校对点。

最小示例

apiVersion: huoban.dev/v1alpha1
kind: Flow
metadata:
  name: idea-to-spec-review
spec:
  profileRefs:
    - name: huoban-project
  stages:
    - id: sharpen-idea
      requires:
        capability: huoban.dev/designReview
      inputs:
        - name: idea
          from: user.prompt
      outputs:
        - name: review-notes
          artifactType: decision-notes
  checkpoints:
    - after: sharpen-idea
      type: humanApproval
      required: true

status

Flow status 通常由 validator 或 runtime 写入:
  • FlowValidated
  • ProfileResolved
  • PolicyChecked
  • SkillResolved
  • RunPlanned

设计约束

不要把 Flow 写成过程式脚本。shellcommand、具体 CLI 参数应进入 Adapter 或 runtime-specific extension,不应污染核心 Flow。