# Workflow Status - Lightweight Status Checker

<critical>The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/workflow-status/workflow.yaml</critical>
<critical>This workflow answers \"what should I do now?\" for any agent by reading workflow configuration.</critical>

<workflow>

<step n="1" goal="Check workflow path configuration">
  <action>Check if {workflow_path} exists</action>
  <check if="file does not exist">
    <output>
工作流路径配置文件不存在: {workflow_path}

这是一个新项目！请先运行 workflow-init 来初始化项目：
`/bmad:bmm:workflows:workflow-init`
    </output>
    <action>Exit workflow</action>
  </check>
  <action>Read {workflow_path}</action>
  <action>Parse: project_level, project_type, workflow_mode, recommended_workflows</action>
</step>

<step n="2" goal="Check implementation status">
  <action>Check if {sprint_status_file} exists</action>
  <check if="file exists">
    <action>Read {sprint_status_file}</action>
    <action>Parse sprint status for current implementation phase</action>
    <action>Determine if project is in active implementation</action>
  </check>
  <check if="file does not exist">
    <output>
注意: sprint-status.yaml 不存在，项目可能不在实施阶段
    </output>
  </check>
</step>

<step n="3" goal="Display status and next steps">
  <output>
## 项目工作流状态

**项目级别**: Level {{project_level}}
**项目类型**: Type {{project_type}}
**工作流模式**: {{workflow_mode}}

  </output>

  <check if="{{project_level}} == 1">
    <output>
### 当前阶段: Analysis (分析阶段)

推荐工作流:
- `/bmad:bmm:workflows:create-product-brief` - 创建产品简介
- `/bmad:bmm:workflows:research` - 进行市场/技术/领域调研
    </output>
  </check>

  <check if="{{project_level}} == 2">
    <output>
### 当前阶段: Planning (规划阶段)

推荐工作流:
- `/bmad:bmm:workflows:create-prd` - 创建产品需求文档
- `/bmad:bmm:workflows:create-ux-design` - 设计 UX 模式
    </output>
  </check>

  <check if="{{project_level}} == 3">
    <output>
### 当前阶段: Solutioning (解决方案阶段)

推荐工作流:
- `/bmad:bmm:workflows:create-architecture` - 创建架构文档
- `/bmad:bmm:workflows:create-epics-and-stories` - 分解 Epic 和 Story
- `/bmad:bmm:workflows:check-implementation-readiness` - 检查实施准备情况
    </output>
  </check>

  <check if="{{project_level}} == 4">
    <output>
### 当前阶段: Implementation (实施阶段)

推荐工作流:
- `/bmad:bmm:workflows:sprint-planning` - Sprint 规划
- `/bmad:bmm:workflows:create-story` - 创建 Story
- `/bmad:bmm:workflows:dev-story` - 开发 Story
- `/bmad:bmm:workflows:code-review` - 代码审查
- `/bmad:bmm:workflows:sprint-status` - Sprint 状态查询
- `/bmad:bmm:workflows:retrospective` - 回顾
- `/bmad:bmm:workflows:correct-course` - 航向修正
    </output>
  </check>

  <output>

### 其他可用工作流

**快速开发工作流**:
- `/bmad:bmm:workflows:quick-dev` - 灵活开发工作流
- `/bmad:bmm:workflows:quick-spec` - 快速技术规范
- `/bmad:bmm:workflows:create-tech-spec` - 创建技术规范

**测试工作流**:
- `/bmad:bmm:workflows:testarch-framework` - 初始化测试框架
- `/bmad:bmm:workflows:testarch-atdd` - 验收测试驱动开发
- `/bmad:bmm:workflows:testarch-automate` - 扩展测试覆盖

**文档工作流**:
- `/bmad:bmm:workflows:generate-project-context` - 生成项目上下文
- `/bmad:bmm:workflows:document-project` - 文档化项目

**图表工作流**:
- `/bmad:bmm:workflows:create-excalidraw-diagram` - 创建系统架构图
- `/bmad:bmm:workflows:create-excalidraw-dataflow` - 创建数据流图
- `/bmad:bmm:workflows:create-excalidraw-wireframe` - 创建线框图
- `/bmad:bmm:workflows:create-excalidraw-flowchart` - 创建流程图

**协作工作流**:
- `/bmad:bmm:workflows:brainstorming` - 头脑风暴
- `/bmad:bmm:workflows:party-mode` - 多代理讨论
  </output>
</step>

<step n="4" goal="Offer next action">
  <ask>
选择下一步操作:
1) 运行推荐工作流
2) 查看 sprint-status 详情 (仅 Level 4)
3) 重新初始化项目 (运行 workflow-init)
4) 退出
  </ask>

  <check if="choice == 1">
    <check if="{{project_level}} == 1">
      <output>运行 `/bmad:bmm:workflows:create-product-brief` 或 `/bmad:bmm:workflows:research`</output>
    </check>
    <check if="{{project_level}} == 2">
      <output>运行 `/bmad:bmm:workflows:create-prd` 或 `/bmad:bmm:workflows:create-ux-design`</output>
    </check>
    <check if="{{project_level}} == 3">
      <output>运行 `/bmad:bmm:workflows:create-architecture` 或 `/bmad:bmm:workflows:create-epics-and-stories`</output>
    </check>
    <check if="{{project_level}} == 4">
      <output>运行 `/bmad:bmm:workflows:sprint-status` 查看当前 Sprint 状态</output>
    </check>
  </check>

  <check if="choice == 2 and {{project_level}} == 4">
    <action>Display contents of {sprint_status_file} if exists</action>
    <check if="sprint_status_file not found">
      <output>sprint-status.yaml 不存在，请先运行 `/bmad:bmm:workflows:sprint-planning`</output>
    </check>
  </check>

  <check if="choice == 2 and {{project_level}} != 4">
    <output>sprint-status 仅适用于 Level 4 (实施阶段)</output>
  </check>

  <check if="choice == 3">
    <output>运行 `/bmad:bmm:workflows:workflow-init` 重新初始化项目</output>
  </check>

  <check if="choice == 4">
    <action>Exit workflow</action>
  </check>
</step>

</workflow>
