@boyingliu01/xp-gate 0.12.13 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/adapters/typescript.sh +5 -2
  2. package/build-integrity/__tests__/ccn-refactor-gate10.test.ts +133 -0
  3. package/build-integrity/gate-10.ts +111 -123
  4. package/hooks/gate-3.sh +68 -0
  5. package/hooks/gate-4.sh +80 -0
  6. package/hooks/gate-7.sh +45 -0
  7. package/hooks/gate-8.sh +56 -0
  8. package/hooks/pre-commit +15 -3
  9. package/mock-policy/AGENTS.md +4 -4
  10. package/mutation/AGENTS.md +4 -4
  11. package/package.json +1 -1
  12. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude-code/skills/delphi-review/AGENTS.md +4 -4
  14. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +50 -62
  15. package/plugins/claude-code/skills/sprint-flow/SKILL.md +200 -238
  16. package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +13 -14
  17. package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +61 -197
  18. package/plugins/claude-code/skills/sprint-flow/references/phase-1-prep.md +294 -0
  19. package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +194 -0
  20. package/{skills/sprint-flow/references/phase-2-build.md → plugins/claude-code/skills/sprint-flow/references/phase-3-build.md} +11 -11
  21. package/plugins/claude-code/skills/sprint-flow/references/phase-4-verify.md +153 -0
  22. package/plugins/claude-code/skills/sprint-flow/references/phase-5-ship.md +40 -0
  23. package/plugins/claude-code/skills/sprint-flow/references/phase-6-close.md +134 -0
  24. package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-learning-log.md +1 -1
  25. package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-output-template.md +15 -37
  26. package/plugins/claude-code/skills/sprint-flow/templates/emergent-issues-template.md +7 -7
  27. package/plugins/claude-code/skills/sprint-flow/templates/pain-document-template.md +5 -5
  28. package/plugins/claude-code/skills/sprint-flow/templates/sprint-progress-template.md +36 -47
  29. package/plugins/claude-code/skills/sprint-flow/templates/sprint-summary-template.md +16 -15
  30. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +4 -4
  31. package/plugins/opencode/package.json +1 -1
  32. package/plugins/opencode/skills/delphi-review/AGENTS.md +4 -4
  33. package/plugins/opencode/skills/sprint-flow/AGENTS.md +50 -62
  34. package/plugins/opencode/skills/sprint-flow/SKILL.md +200 -238
  35. package/plugins/opencode/skills/sprint-flow/references/force-levels.md +13 -14
  36. package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +61 -197
  37. package/plugins/opencode/skills/sprint-flow/references/phase-1-prep.md +294 -0
  38. package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +194 -0
  39. package/plugins/{claude-code/skills/sprint-flow/references/phase-2-build.md → opencode/skills/sprint-flow/references/phase-3-build.md} +11 -11
  40. package/plugins/opencode/skills/sprint-flow/references/phase-4-verify.md +153 -0
  41. package/plugins/opencode/skills/sprint-flow/references/phase-5-ship.md +40 -0
  42. package/plugins/opencode/skills/sprint-flow/references/phase-6-close.md +134 -0
  43. package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-learning-log.md +1 -1
  44. package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-output-template.md +15 -37
  45. package/plugins/opencode/skills/sprint-flow/templates/emergent-issues-template.md +7 -7
  46. package/plugins/opencode/skills/sprint-flow/templates/pain-document-template.md +5 -5
  47. package/plugins/opencode/skills/sprint-flow/templates/sprint-progress-template.md +36 -47
  48. package/plugins/opencode/skills/sprint-flow/templates/sprint-summary-template.md +16 -15
  49. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +4 -4
  50. package/plugins/qoder/plugin.json +1 -1
  51. package/plugins/qoder/skills/delphi-review/AGENTS.md +4 -4
  52. package/plugins/qoder/skills/sprint-flow/AGENTS.md +50 -62
  53. package/plugins/qoder/skills/sprint-flow/SKILL.md +274 -208
  54. package/plugins/qoder/skills/sprint-flow/references/components/middleware.md +5 -2
  55. package/plugins/qoder/skills/sprint-flow/references/force-levels.md +13 -14
  56. package/plugins/qoder/skills/sprint-flow/references/orchestration-rules.md +61 -197
  57. package/plugins/qoder/skills/sprint-flow/references/phase-1-prep.md +294 -0
  58. package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +194 -0
  59. package/plugins/{opencode/skills/sprint-flow/references/phase-2-build.md → qoder/skills/sprint-flow/references/phase-3-build.md} +11 -11
  60. package/plugins/qoder/skills/sprint-flow/references/phase-4-verify.md +153 -0
  61. package/plugins/qoder/skills/sprint-flow/references/phase-5-ship.md +40 -0
  62. package/plugins/qoder/skills/sprint-flow/references/phase-6-close.md +134 -0
  63. package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-learning-log.md +1 -1
  64. package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-output-template.md +15 -37
  65. package/plugins/qoder/skills/sprint-flow/templates/emergent-issues-template.md +7 -7
  66. package/plugins/qoder/skills/sprint-flow/templates/pain-document-template.md +5 -5
  67. package/plugins/qoder/skills/sprint-flow/templates/sprint-progress-template.md +36 -47
  68. package/plugins/qoder/skills/sprint-flow/templates/sprint-summary-template.md +16 -15
  69. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +4 -4
  70. package/principles/AGENTS.md +4 -4
  71. package/principles/lint-baseline.ts +35 -40
  72. package/skills/delphi-review/AGENTS.md +4 -4
  73. package/skills/sprint-flow/AGENTS.md +50 -62
  74. package/skills/sprint-flow/SKILL.md +200 -238
  75. package/skills/sprint-flow/references/force-levels.md +13 -14
  76. package/skills/sprint-flow/references/orchestration-rules.md +61 -197
  77. package/skills/sprint-flow/references/phase-1-prep.md +294 -0
  78. package/skills/sprint-flow/references/phase-2-design.md +194 -0
  79. package/skills/sprint-flow/references/phase-3-build.md +147 -0
  80. package/skills/sprint-flow/references/phase-4-verify.md +153 -0
  81. package/skills/sprint-flow/references/phase-5-ship.md +40 -0
  82. package/skills/sprint-flow/references/phase-6-close.md +134 -0
  83. package/skills/sprint-flow/templates/auto-estimate-learning-log.md +1 -1
  84. package/skills/sprint-flow/templates/auto-estimate-output-template.md +15 -37
  85. package/skills/sprint-flow/templates/emergent-issues-template.md +7 -7
  86. package/skills/sprint-flow/templates/pain-document-template.md +5 -5
  87. package/skills/sprint-flow/templates/sprint-progress-template.md +36 -47
  88. package/skills/sprint-flow/templates/sprint-summary-template.md +16 -15
  89. package/skills/test-specification-alignment/AGENTS.md +4 -4
  90. package/plugins/claude-code/skills/sprint-flow/references/phase-0-think.md +0 -115
  91. package/plugins/claude-code/skills/sprint-flow/references/phase-1-plan.md +0 -178
  92. package/plugins/claude-code/skills/sprint-flow/references/phase-3-review.md +0 -215
  93. package/plugins/claude-code/skills/sprint-flow/references/phase-4-uat.md +0 -125
  94. package/plugins/claude-code/skills/sprint-flow/references/phase-5-feedback.md +0 -100
  95. package/plugins/claude-code/skills/sprint-flow/references/phase-6-ship.md +0 -9
  96. package/plugins/claude-code/skills/sprint-flow/references/phase-7-land.md +0 -9
  97. package/plugins/claude-code/skills/sprint-flow/references/phase-8-cleanup.md +0 -9
  98. package/plugins/claude-code/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +0 -263
  99. package/plugins/claude-code/skills/sprint-flow/references/phase-minus-1-isolate.md +0 -58
  100. package/plugins/opencode/skills/sprint-flow/references/phase-0-think.md +0 -115
  101. package/plugins/opencode/skills/sprint-flow/references/phase-1-plan.md +0 -178
  102. package/plugins/opencode/skills/sprint-flow/references/phase-3-review.md +0 -215
  103. package/plugins/opencode/skills/sprint-flow/references/phase-4-uat.md +0 -125
  104. package/plugins/opencode/skills/sprint-flow/references/phase-5-feedback.md +0 -100
  105. package/plugins/opencode/skills/sprint-flow/references/phase-6-ship.md +0 -9
  106. package/plugins/opencode/skills/sprint-flow/references/phase-7-land.md +0 -9
  107. package/plugins/opencode/skills/sprint-flow/references/phase-8-cleanup.md +0 -9
  108. package/plugins/opencode/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +0 -263
  109. package/plugins/opencode/skills/sprint-flow/references/phase-minus-1-isolate.md +0 -58
  110. package/plugins/qoder/skills/sprint-flow/references/phase-0-think.md +0 -115
  111. package/plugins/qoder/skills/sprint-flow/references/phase-1-plan.md +0 -178
  112. package/plugins/qoder/skills/sprint-flow/references/phase-2-build.md +0 -43
  113. package/plugins/qoder/skills/sprint-flow/references/phase-3-review.md +0 -215
  114. package/plugins/qoder/skills/sprint-flow/references/phase-4-uat.md +0 -125
  115. package/plugins/qoder/skills/sprint-flow/references/phase-5-feedback.md +0 -100
  116. package/plugins/qoder/skills/sprint-flow/references/phase-6-ship.md +0 -9
  117. package/plugins/qoder/skills/sprint-flow/references/phase-7-land.md +0 -9
  118. package/plugins/qoder/skills/sprint-flow/references/phase-8-cleanup.md +0 -9
  119. package/plugins/qoder/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +0 -263
  120. package/plugins/qoder/skills/sprint-flow/references/phase-minus-1-isolate.md +0 -58
  121. package/skills/sprint-flow/references/phase-0-think.md +0 -115
  122. package/skills/sprint-flow/references/phase-1-plan.md +0 -178
  123. package/skills/sprint-flow/references/phase-3-review.md +0 -215
  124. package/skills/sprint-flow/references/phase-4-uat.md +0 -125
  125. package/skills/sprint-flow/references/phase-5-feedback.md +0 -100
  126. package/skills/sprint-flow/references/phase-6-ship.md +0 -9
  127. package/skills/sprint-flow/references/phase-7-land.md +0 -9
  128. package/skills/sprint-flow/references/phase-8-cleanup.md +0 -9
  129. package/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +0 -263
  130. package/skills/sprint-flow/references/phase-minus-1-isolate.md +0 -58
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sprint-flow
3
- version: 1.0.0
3
+ version: 2.0.0
4
4
  description: >
5
5
  One-Shot Sprint 自动流水线。单一入口,自动串联 Think → Plan → Build →
6
6
  Review → Ship 流程。整合 brainstorming + autoplan + delphi-review + TDD +
@@ -13,21 +13,21 @@ description: >
13
13
  - "start sprint"
14
14
  - "一键开发"
15
15
  - "/sprint-flow"
16
- 触发后第一行输出: `Sprint Flow: ISOLATEAUTO-ESTIMATETHINK → PLAN → BUILD → REVIEWUSER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP`
16
+ 触发后第一行输出: `Sprint Flow: PREPDESIGN → BUILD → VERIFY → SHIP → CLOSE`
17
17
  用法: /sprint-flow "[需求描述]"
18
18
  示例: /sprint-flow "开发访谈机器人,支持多轮对话"
19
19
  可选参数:
20
20
  --no-isolate: 跳过自动 worktree 隔离(⚠️ 在保护分支上有污染风险)
21
21
  --branch-name <name>: 自定义分支名(默认自动生成 sprint/YYYY-MM-DD-NN)
22
22
  --force: 强制在当前分支继续(即使已是保护分支,⚠️ 输出警告)
23
- --stop-at <phase>: 执行到指定阶段后停止 (isolate/think/plan/build/review/ship/land/cleanup)
24
- --resume-from <phase>: 从指定阶段继续,跳过前面阶段
25
- --phase <phase>: 只执行单个阶段 (isolate-only/think-only/plan-only/build-only/review-only/ship-only/land-only/cleanup-only)
23
+ --stop-at <phase>: 执行到指定阶段后停止 (prep/design/build/verify/ship/close). Legacy names: isolate/think/plan/review/ship/land/cleanup
24
+ --resume-from <phase>: 从指定阶段继续,跳过前面阶段 (prep/design/build/verify/ship/close)
25
+ --phase <phase>: 只执行单个阶段 (prep-only/design-only/build-only/verify-only/ship-only/close-only). Legacy: isolate-only/think-only/plan-only/build-only/review-only/ship-only/land-only/cleanup-only
26
26
  --lang <language>: 指定项目语言 (springboot/django/golang)
27
27
  --type <project_type>: 指定项目类型 (web-nextjs/web-react/web-vue/mobile-flutter/mobile-react-native/backend-django/backend-go/backend-springboot)
28
28
  --spec <file>: 使用已有的 specification.yaml 文件
29
29
  --with-performance: 启用负载/压力测试(后端项目)
30
- --mode <build_mode>: 指定 Phase 2 构建模式。默认 = ralph-loop(逐 REQ 迭代,token 节约)。parallel = 旧有并行模式(一次性 dispatch 所有需求)
30
+ --mode <build_mode>: 指定 Phase 3 BUILD 构建模式。默认 = ralph-loop(逐 REQ 迭代,token 节约)。parallel = 旧有并行模式(一次性 dispatch 所有需求)
31
31
  --status: 查看当前 Sprint 进度看板(不执行任何阶段,仅读取 sprint-state.json 并渲染进度)
32
32
  Use when asked to "开发新功能", "实现 X", "start sprint", "一键开发", or "/sprint-flow" for end-to-end feature development.
33
33
  maturity: beta
@@ -37,18 +37,51 @@ triggers:
37
37
  - "开发新功能"
38
38
  - "实现 X"
39
39
  - "一键开发"
40
+ triggers_negative_examples:
41
+ - "实现排序算法" # algorithm implementation, not feature development
42
+ - "实现一下" # casual "do it", not a sprint request
43
+ - "帮我实现这个函数" # single function, not full feature
44
+ - "怎么实现登录功能" # asking HOW, not requesting development
45
+ - "start spring boot" # framework name, not sprint
46
+ - "开发环境配置" # environment setup, not feature development
47
+ - "一键部署" # deploy, not develop
48
+ - "新功能建议" # feature suggestion/request, not execution
49
+ - "implement a sort function" # algorithm, not full feature
50
+ - "how to implement auth" # educational question
51
+ triggers_negative_test_cases:
52
+ - input: "实现排序算法"
53
+ expect: "NOT triggered"
54
+ - input: "实现一下"
55
+ expect: "NOT triggered"
56
+ - input: "帮我实现这个函数"
57
+ expect: "NOT triggered"
58
+ - input: "怎么实现登录功能"
59
+ expect: "NOT triggered"
60
+ - input: "start spring boot"
61
+ expect: "NOT triggered"
62
+ - input: "开发环境配置"
63
+ expect: "NOT triggered"
64
+ - input: "一键部署"
65
+ expect: "NOT triggered"
66
+ - input: "新功能建议"
67
+ expect: "NOT triggered"
68
+ - input: "implement a sort function"
69
+ expect: "NOT triggered"
70
+ - input: "how to implement auth"
71
+ expect: "NOT triggered"
72
+ - input: "开发用户认证模块"
73
+ expect: "triggered"
74
+ - input: "/sprint-flow \"开发访谈机器人\""
75
+ expect: "triggered"
76
+ - input: "一键开发 REST API"
77
+ expect: "triggered"
40
78
  workflow_steps:
41
- - "Phase -1: ISOLATE"
42
- - "Phase -0.5: AUTO-ESTIMATE"
43
- - "Phase 0: THINK"
44
- - "Phase 1: PLAN"
45
- - "Phase 2: BUILD"
46
- - "Phase 3: REVIEW"
47
- - "Phase 4: USER ACCEPTANCE"
48
- - "Phase 5: FEEDBACK"
49
- - "Phase 6: SHIP"
50
- - "Phase 7: LAND"
51
- - "Phase 8: CLEANUP"
79
+ - "Phase 1/6: PREP"
80
+ - "Phase 2/6: DESIGN"
81
+ - "Phase 3/6: BUILD"
82
+ - "Phase 4/6: VERIFY"
83
+ - "Phase 5/6: SHIP"
84
+ - "Phase 6/6: CLOSE"
52
85
  ---
53
86
 
54
87
  ## Triggers
@@ -69,14 +102,14 @@ workflow_steps:
69
102
  - `--no-isolate`: Skip auto worktree isolation (⚠️ risk of polluting protected branches)
70
103
  - `--branch-name <name>`: Custom branch name (default: `sprint/YYYY-MM-DD-NN`)
71
104
  - `--force`: Force continue on current branch even if protected (⚠️ requires explicit confirmation)
72
- - `--stop-at <phase>`: Stop after specified phase (isolate/think/plan/build/review/ship/land/cleanup)
73
- - `--resume-from <phase>`: Resume from specified phase, skipping earlier phases
74
- - `--phase <phase>`: Execute only single phase (isolate-only/think-only/plan-only/build-only/review-only/ship-only/land-only/cleanup-only)
105
+ - `--stop-at <phase>`: Stop after specified phase (prep/design/build/verify/ship/close). For backward compat, legacy names (isolate/think/plan/review/ship/land/cleanup) are accepted and mapped.
106
+ - `--resume-from <phase>`: Resume from specified phase, skipping earlier phases (prep/design/build/verify/ship/close)
107
+ - `--phase <phase>`: Execute only single phase (prep-only/design-only/build-only/verify-only/ship-only/close-only). Legacy: isolate-only/think-only/plan-only/build-only/review-only/ship-only/land-only/cleanup-only
75
108
  - `--lang <language>`: Specify project language (springboot/django/golang)
76
109
  - `--type <project_type>`: Specify project type (web-nextjs/web-react/web-vue/mobile-flutter/mobile-react-native/backend-django/backend-go/backend-springboot)
77
110
  - `--spec <file>`: Use existing specification.yaml file
78
111
  - `--with-performance`: Enable load/stress testing (backend projects)
79
- - `--mode <build_mode>`: Phase 2 build mode. Default = ralph-loop (REQ-level iteration, token-efficient). parallel = legacy all-at-once mode
112
+ - `--mode <build_mode>`: Phase 3 BUILD build mode. Default = ralph-loop (REQ-level iteration, token-efficient). parallel = legacy all-at-once mode
80
113
 
81
114
  # Sprint Flow Skill
82
115
 
@@ -84,8 +117,8 @@ workflow_steps:
84
117
 
85
118
  - sprint-flow **不执行任何破坏性命令**(no `rm -rf`, `git push --force`, `DROP TABLE` 等)
86
119
  - `git worktree remove` 仅删除 sprint 创建的临时 worktree 目录,不影响主仓库
87
- - Phase 6 SHIP 仅创建 PR(`gh pr create`),不自动 merge(除非用户显式确认)
88
- - Phase 7 LAND 使用 `gh pr merge --squash`(非 force push),merge 前等待 CI 通过
120
+ - Phase 5 SHIP 仅创建 PR(`gh pr create`),不自动 merge(除非用户显式确认)
121
+ - Phase 5 SHIP / LAND 使用 `gh pr merge --squash`(非 force push),merge 前等待 CI 通过
89
122
  - 文档中 `+ platform deploy` 等描述仅表示可选的部署步骤映射,**不是可执行命令**
90
123
  - sprint-flow 不下载、安装或执行任何外部二进制文件
91
124
 
@@ -102,45 +135,66 @@ workflow_steps:
102
135
  |------|------|
103
136
  | **单一入口** | 用户只需调用 `/sprint-flow`,自动串联全流程 |
104
137
  | **自动流水线** | 类似 autoplan,自动执行多个阶段 |
105
- | **关键节点暂停** | APPROVED 确认、Gate 1 通过、Ship 确认、⚠️ Phase 4 必须人工 |
138
+ | **关键节点暂停** | APPROVED 确认、DELPHI-GATE 通过、Ship 确认、⚠️ Phase 6 CLOSE 必须人工 |
106
139
  | **承认 Emergent** | 用户验收环节必须人工,无法自动化(78% 失败不可见) |
107
140
  | **复用现有 Skills** | 不重新发明,整合调用现有体系 |
108
141
 
109
142
  ---
110
143
 
144
+ ## Unique Value Proposition
145
+
146
+ Sprint Flow is NOT just a sequential launcher of existing skills. Here's what makes it different from manually running each skill:
147
+
148
+ ### Why Sprint Flow vs Manual Skill Execution
149
+
150
+ | Dimension | Manual Execution | Sprint Flow |
151
+ |-----------|-----------------|-------------|
152
+ | **Context Continuity** | Each skill starts fresh; lost design decisions between phases | Phase summaries + sprint-state.json maintain full traceability across 6 phases |
153
+ | **Gate Enforcement** | No enforcement — easy to skip Delphi, skip TDD, skip UAT | HARD-GATE: design must be APPROVED (≥90% Delphi consensus) before coding; UAT is mandatory (no bypass) |
154
+ | **Token Efficiency** | Linear context accumulation across phases — ~150K+ tokens | Ralph-loop default: 40-67% token savings via clean REQ-level contexts |
155
+ | **Emergent Requirements** | Discovered late, silently ignored or merged | Phase 6 CLOSE explicitly captures emergent issues via template; triggers Sprint 2 for critical issues |
156
+ | **Quality Ecosystem** | No integration with quality gates | Integrated with xp-gate's full quality ecosystem: Gate 5 (coverage), Gate M2 (mock density), Delphi code-walkthrough |
157
+ | **Progress Tracking** | Ad-hoc, memory-based | `.sprint-state/` persistence with phase history, timing, and metrics — `--status` renders progress dashboard |
158
+
159
+ ### Key Differentiators
160
+
161
+ 1. **40-67% Token Savings via Ralph Loop**: Phase 3 BUILD default (`ralph-loop`) processes one REQ at a time with clean context, avoiding the linear context accumulation that costs 150K+ tokens in parallel mode.
162
+
163
+ 2. **HARD-GATE Discipline**: Design must pass Delphi review (≥90% consensus, ≥2 model providers, domestic models only) before Phase 3 BUILD can start. This is enforced both in SKILL.md instructions and via the Claude Code plugin's PreToolUse hook.
164
+
165
+ 3. **Emergent Requirements Acknowledgment**: Based on research showing 78% of failures are invisible to AI (arXiv study), Phase 6 CLOSE includes mandatory manual UAT verification — cannot be automated, skipped, or bypassed.
166
+
167
+ 4. **XP-Gate Quality Ecosystem Integration**: Sprint Flow is part of the broader xp-gate ecosystem. Phase 3 BUILD integrates with Gate 5 (test coverage ≥80%), Gate M2 (mock density ≤30%), and Gate MW (code-walkthrough validation). Phase 4 VERIFY runs Delphi code-walkthrough that generates `.code-walkthrough-result.json` for pre-push enforcement.
168
+
169
+ 5. **Full Lifecycle Coverage**: From worktree isolation (PREP) to cleanup (CLOSE), sprint-flow covers the entire development lifecycle — not just the "write code" part. PREP (Phase 1/6) prevents over-engineering by routing lightweight changes through simplified workflows.
170
+
171
+ ---
172
+
111
173
  ## 完整流程(默认无参数)
112
174
 
113
175
  调用 `/sprint-flow "[需求描述]"` 后,自动执行以下流程:
114
176
 
115
177
  ```
116
- Phase -1: ISOLATE保护分支检测→强制worktree
117
- Phase -0.5: AUTO-ESTIMATE展示评估结果→用户确认路由(轻量/标准/复杂)
118
- Phase 0: THINKbrainstorming⚠️ HARD-GATE(设计未批准→阻断)
119
- Phase 1: PLANautoplandelphi-review(等待APPROVED)specification.yaml
120
- Phase 2: BUILDGITHOOKS-GATEralph-loop/TDDfreeze/盲评→verification
121
- Phase 3: REVIEWdelphi-review --mode code-walkthroughtest-alignmentbrowse
122
- Phase 4: ⚠️ USER ACCEPTANCE → 必须人工验收 → Emergent Issues List
123
- Phase 5: FEEDBACK → learn + retro + systematic-debugging
124
- Phase 6: SHIP → finishing-a-development-branch → ship(PR)
125
- Phase 7: ⚠️ LAND → land-and-deploy → merge + CI + canary
126
- Phase 8: CLEANUP → worktree remove + branch delete + sprint summary
178
+ Phase 1/6: PREP → worktree隔离 + 规模评估 + 流程路由
179
+ Phase 2/6: DESIGN → brainstorming → autoplan → delphi-reviewspecification.yaml
180
+ Phase 3/6: BUILDGITHOOKS-GATEDELPHI-GATE → ralph-loop/TDD → freeze/盲评 → verification
181
+ Phase 4/6: VERIFYdelphi-review --mode code-walkthrough test-alignment browse → learn + retro
182
+ Phase 5/6: SHIPfinishing-a-development-branchship → land-and-deploycanary
183
+ Phase 6/6: CLOSEUSER ACCEPTANCE (⚠️ 人工) emergent issues cleanup
127
184
  ```
128
185
 
186
+ **v2.0 Compact Redesign** (Issue #290): Merged from 11 phases to 6. PREP = old ISOLATE + AUTO-ESTIMATE. DESIGN = old THINK + PLAN. BUILD = old BUILD (unchanged). VERIFY = old REVIEW + FEEDBACK. SHIP = old SHIP + LAND. CLOSE = old USER ACCEPTANCE + CLEANUP.
187
+
129
188
  ---
130
189
 
131
190
  ## 暂停点设计(不是随时停,而是设计明确的暂停点)
132
191
 
133
- - **Phase -1**: 保护分支强制隔离 → 输出警告或自动创建 worktree → 自动恢复
134
- - **Phase -0.5**: AUTO-ESTIMATE 结果展示用户确认按路由继续
135
- - **Phase 0**: 设计未 APPROVED (HARD-GATE)用户修改APPROVED 后继续
136
- - **Phase 1**: autoplan taste_decisions用户确认 / delphi-review 未APPROVED修复→APPROVED
137
- - **Phase 2**: 验证失败>max3用户决策修复/放弃 / 成本超阈值 → 用户确认
138
- - **Phase 3**: browse 发现问题回退 Phase 2(不暂停)
139
- - **Phase 4**: ⚠️ 必须人工验收 → 用户确认后继续
140
- - **Phase 5**: ⚠️ 不可跳过 (HARD-GATE) → feedback-log.md 生成后自动继续
141
- - **Phase 6**: finishing-a-development-branch(4选项) → 确认; ship PR → 用户确认合并
142
- - **Phase 7**: land-and-deploy 完成/失败 → 用户确认合并结果/处理部署失败
143
- - **Phase 8**: worktree 清理完成/失败 → 用户确认 → 结束流程
192
+ - **Phase 1/6 PREP**: 保护分支强制隔离 → 输出警告或自动创建 worktree → 自动恢复;AUTO-ESTIMATE 结果展示 → 用户确认 → 按路由继续
193
+ - **Phase 2/6 DESIGN**: brainstorming 设计未 APPROVED (HARD-GATE) 用户修改 APPROVED 后继续;autoplan taste_decisions 用户确认;delphi-review 未 APPROVED → 修复 → APPROVED → specification.yaml
194
+ - **Phase 3/6 BUILD**: DELPHI-GATE 未通过 BLOCK;验证失败 > max3 用户决策修复/放弃;成本超阈值 → 用户确认
195
+ - **Phase 4/6 VERIFY**: delphi code-walkthrough REQUEST_CHANGES 用户处理 重新评审;browse 发现问题回退 Phase 3(不暂停)
196
+ - **Phase 5/6 SHIP**: finishing-a-development-branch (4选项) 确认;ship PR 用户确认合并;land-and-deploy 完成/失败 → 用户确认
197
+ - **Phase 6/6 CLOSE**: USER ACCEPTANCE ⚠️ 必须人工验收 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
144
198
 
145
199
  ---
146
200
 
@@ -148,28 +202,22 @@ Phase 8: CLEANUP → worktree remove + branch delete + sprint summary
148
202
 
149
203
  | Step | Phase | Name | Key Actions | Output |
150
204
  |------|-------|------|-------------|--------|
151
- | 1 | **-1** | **ISOLATE** | Detect protected branch → Create git worktree → Setup projectValidate .gitignore Record sprint state | Worktree path |
152
- | 2 | **-0.5** | **AUTO-ESTIMATE** | Analyze code structureCount referencesAssess cross-module impact Classify (lightweight/standard/complex) | Impact assessment + flow recommendation |
153
- | 3 | **0** | **THINK** | brainstormingGenerate design doc + CONTEXT.md + ADR | Design document |
154
- | 4 | **1** | **PLAN** | autoplandelphi-review (mandatory; lightweight allowed) → Generate specification.yaml + slices-manifest.json | specification.yaml |
155
- | 5 | **2** | **BUILD** | GITHOOKS-GATEralph-loop (default) or parallelTDD freeze blind review verification | MVP code |
156
- | 6 | **3** | **REVIEW** | delphi-review --mode code-walkthroughtest-specification-alignmentbrowse QAbenchmark (optional) | Review report |
157
- | 7 | **4** | **USER ACCEPT** | **Manual verification** → Capture emergent issues | Emergent issues list |
158
- | 8 | **5** | **FEEDBACK** | learn → retro → systematic-debugging | feedback-log.md |
159
- | 9 | **6** | **SHIP** | finishing-a-development-branch → ship (create PR) | PR URL |
160
- | 10 | **7** | **LAND** | land-and-deploy → merge PR → wait CI → canary health check → rollback on failure | Deploy status |
161
- | 11 | **8** | **CLEANUP** | Safe worktree removal → Update sprint state → Sprint summary | Cleanup report |
205
+ | 1 | **1/6** | **PREP** | Detect protected branch → Create git worktree → AUTO-ESTIMATE sizingClassify (lightweight/standard/complex) | Worktree path + impact assessment |
206
+ | 2 | **2/6** | **DESIGN** | brainstorming autoplandelphi-review (HARD-GATE ≥90% consensus) to-issuesspecification.yaml | specification.yaml + slices-manifest.json |
207
+ | 3 | **3/6** | **BUILD** | GITHOOKS-GATEDELPHI-GATE ralph-loop (default) or parallel TDD → freeze → blind review → verification | MVP code |
208
+ | 4 | **4/6** | **VERIFY** | delphi-review --mode code-walkthrough test-specification-alignment browse QA → benchmark (optional) → learn + retro | Review report + feedback-log.md |
209
+ | 5 | **5/6** | **SHIP** | finishing-a-development-branchship (create PR) land-and-deploymerge + CI + canary | PR URL + deploy status |
210
+ | 6 | **6/6** | **CLOSE** | USER ACCEPTANCE (⚠️ mandatory manual) Capture emergent issues Cleanup worktree + branch Sprint summary | Emergent issues list + cleanup report |
162
211
 
163
212
  **Phase Flow**:
164
213
  ```
165
- ISOLATEAUTO-ESTIMATETHINK → PLAN → [GITHOOKS-GATE] → BUILD → REVIEWUSER ACCEPT → FEEDBACK → SHIP → LAND → CLEANUP
214
+ PREPDESIGN → BUILD → VERIFY → SHIP → CLOSE
166
215
  ```
167
216
 
168
217
  **Hard Gates**:
169
- - **Phase 01**: Design must be APPROVED by delphi-review (≥90% consensus)
170
- - **Phase 12**: GITHOOKS-GATE (hooks must be installed) + DELPHI-GATE (spec must be APPROVED)
171
- - **Phase 45**: User acceptance must be completed (mandatory manual step)
172
- - **Phase 5→6**: feedback-log.md must exist (HARD-GATE)
218
+ - **Phase 2/6 3/6 (DESIGN → BUILD)**: Design must be APPROVED by delphi-review (≥90% consensus) + GITHOOKS-GATE (hooks installed) + DELPHI-GATE (spec APPROVED)
219
+ - **Phase 4/6 5/6 (VERIFY SHIP)**: feedback-log.md must exist (HARD-GATE)
220
+ - **Phase 5/6 6/6 (SHIP → CLOSE)**: User acceptance must be completed (mandatory manual step)
173
221
 
174
222
  ---
175
223
 
@@ -180,159 +228,136 @@ ISOLATE → AUTO-ESTIMATE → THINK → PLAN → [GITHOOKS-GATE] → BUILD → R
180
228
  **执行每个 Phase 时,必须以以下固定格式输出阶段标题**,不可省略、不可合并、不可替换:
181
229
 
182
230
  ```markdown
183
- ## Phase -1: ISOLATE (隔离)
184
- ## Phase -0.5: AUTO-ESTIMATE (规模评估)
185
- ## Phase 0: THINK (思考)
186
- ## Phase 1: PLAN (规划)
187
- ## Phase 2: BUILD (构建)
188
- ## Phase 3: REVIEW (评审)
189
- ## Phase 4: USER ACCEPTANCE (用户验收)
190
- ## Phase 5: FEEDBACK (反馈)
191
- ## Phase 6: SHIP (发布)
192
- ## Phase 7: LAND (部署)
193
- ## Phase 8: CLEANUP (清理)
231
+ ## Phase 1/6: PREP (准备工作)
232
+ ## Phase 2/6: DESIGN (设计)
233
+ ## Phase 3/6: BUILD (构建)
234
+ ## Phase 4/6: VERIFY (验证)
235
+ ## Phase 5/6: SHIP (发布)
236
+ ## Phase 6/6: CLOSE (收尾)
194
237
  ```
195
238
 
196
239
  **规则**:
197
- 1. 每个 Phase **开始执行时必须首先输出**对应的 `## Phase X: NAME` 标题行(作为该 Phase 输出的第一行)
198
- 2. **禁止省略** "Phase" 关键词(如不能只写 "ISOLATE" 或 "## -1")
240
+ 1. 每个 Phase **开始执行时必须首先输出**对应的 `## Phase X/6: NAME` 标题行(作为该 Phase 输出的第一行)
241
+ 2. **禁止省略** "Phase" 关键词(如不能只写 "PREP" 或 "## 1/6")
199
242
  3. **禁止合并**多个 Phase 的输出(每个 Phase 必须有独立标题)
200
- 4. **格式必须精确匹配**:`## Phase ` + 数字 + `: ` + 大写英文名 + ` (中文名)`
201
- 5. 跳过某个 Phase(如 `--resume-from build` 跳过了 -1, -0.5, 0, 1)时,不输出被跳过 Phase 的标题
243
+ 4. **格式必须精确匹配**:`## Phase X/6:` + 大写英文名 + ` (中文名)`
244
+ 5. 跳过某个 Phase(如 `--resume-from build` 跳过了 PREP, DESIGN)时,不输出被跳过 Phase 的标题
202
245
  6. 触发 `/sprint-flow` 后,**第一行输出应包含工作流阶段概览**:
203
246
 
204
247
  ```
205
- Sprint Flow: ISOLATEAUTO-ESTIMATETHINK → PLAN → BUILD → REVIEWUSER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP
248
+ Sprint Flow: PREPDESIGN → BUILD → VERIFY → SHIP → CLOSE
206
249
  ```
207
250
 
208
- ### Phase -1: ISOLATE(git worktree 隔离)
251
+ ### Phase 1/6: PREP (准备工作 — worktree 隔离 + 规模评估)
252
+
253
+ **执行时机**: `/sprint-flow` 启动后 → Phase 2/6 DESIGN 前。**自动执行**。
209
254
 
210
- **执行时机**: `/sprint-flow` 启动后 Phase 0 THINK 前。**自动执行**。
255
+ **对应旧模型**: Phase -1 ISOLATE + Phase -0.5 AUTO-ESTIMATE
211
256
 
212
- **详细指令**: 参见 `references/phase-minus-1-isolate.md` — 包含步骤表、参数处理、错误回退、sprint-state 格式。
257
+ **详细指令**: 参见 `references/phase-1-prep.md` — 包含步骤表、参数处理、错误回退、sprint-state 格式、AUTO-ESTIMATE 指标计算、路由决策。
213
258
 
214
259
  **快速参考**:
215
260
  1. 检测保护分支 (main/master/develop) → 自动创建 worktree `.worktrees/sprint/sprint-YYYY-MM-DD-NN`
216
261
  2. Sprint Lock 检测(Issue #144)— stale 锁自动覆盖,非 stale 阻断
217
262
  3. 项目 setup (`npm install`/`go mod download`/`pip install`)
218
263
  4. `.gitignore` 校验 + Sprint State 记录 + 基线测试
219
- 5. **参数**: `--no-isolate` (跳过),`--branch-name <name>`,`--force` (绕过保护分支)
264
+ 5. 识别需求类型 收集指标(引用计数、跨模块依赖、循环依赖)→ **轻量** / **标准** / **复杂**
265
+ 6. 输出评估结果 → 用户确认后按路由继续
266
+ 7. **参数**: `--no-isolate` (跳过), `--branch-name <name>`, `--force` (绕过保护分支)
220
267
 
221
- ### Phase -0.5: AUTO-ESTIMATE(自动化规模评估与流程路由)
268
+ ### Phase 2/6: DESIGN (设计 — 需求探索 + 共识评审)
222
269
 
223
- **执行时机**: Phase -1 ISOLATE 完成后 Phase 0 THINK 前。**自动执行**。
270
+ **对应旧模型**: Phase 0 THINK + Phase 1 PLAN
224
271
 
225
- **详细指令**: 参见 `references/phase-minus-0-5-auto-estimate.md` — 包含步骤、决策表、输出格式、纠偏机制。
272
+ **执行者**: orchestrator 直接执行全部步骤(交互式 skill)。
273
+
274
+ **详细指令**: 参见 `references/phase-2-design.md` — 完整流程、条件分支、HARD-GATE。
226
275
 
227
276
  **快速参考**:
228
- 1. 识别需求类型(删除/修改/新增/BugFix)→ 收集指标(引用计数、跨模块依赖、循环依赖)
229
- 2. 综合打分 **轻量** (≤3 ref, 同模块) / **标准** (4-10 ref, 1-2 modules) / **复杂** (>10 ref 或循环依赖)
230
- 3. 输出评估结果(使用 `templates/auto-estimate-output-template.md`)→ 用户确认后路由至对应 Phase
231
- 4. **所有路由必须产生** `delphi-reviewed.json` (verdict: APPROVED) 才能进入 Phase 2 BUILD
232
-
233
- ### Phase 0: THINK(需求探索与设计)
234
- - **Orchestrator 直接执行**: brainstorming 是交互式 skill,**必须由 orchestrator 直接调用** `skill(name="brainstorming")`,不可 dispatch subagent(Issue #217, #225, #248)
235
- - 输入: Phase -1 summary(worktree 路径)+ 用户原始需求
236
- - 输出: 结构化设计文档 直接作为 Phase 1 PLAN 的输入
237
- - **HARD-GATE**: 设计未批准 → 不可进入实现
238
-
239
- ### Phase 1: PLAN(共识评审)
240
- - **注意**: `autoplan`、`delphi-review` 和 `to-issues` 均为交互式 skill,**必须由 orchestrator 直接执行**(Issue #225, #248, #249)
241
- - **执行模式(三阶段,全部 orchestrator 直接执行)**:
242
- 1. **Orchestrator 直接执行 autoplan**: `skill(name="autoplan")` → 用户确认 taste_decisions
243
- 2. **Orchestrator 直接执行 delphi-review**: `skill(name="delphi-review")` — 等待 APPROVED(非 APPROVED 时需等待用户确认/处理)
244
- 3. **Orchestrator 直接执行 to-issues**: `skill(name="to-issues")` → 用户确认 Issue 拆分方案
245
- - 输入: phase-0-summary.md + 设计文档
246
- - 输出: `specification.yaml`(含 user_stories[])+ `slices-manifest.json`
247
-
248
- **条件分支逻辑**:
249
- - IF autoplan AUTO_APPROVED + 无 taste_decisions → 可执行 **lightweight delphi-review**(2 专家、1 轮、2/2 APPROVED,参考 `references/force-levels.md`)
250
- - IF autoplan NEEDS_REVIEW OR taste_decisions > 0 → 调用标准 delphi-review(3 专家)
251
- - **delphi-review 必须产生** `.sprint-state/delphi-reviewed.json` 且 `verdict = "APPROVED"` → 生成 specification.yaml(含 user_stories[]) → **调用 /to-issues** 拆解为垂直切片 → slices-manifest.json → Phase 2 按 execution_order 执行
252
-
253
- ### Phase 1→2: GITHOOKS-GATE(质量门禁安装检查)
254
-
255
- **执行时机**: Phase 1 完全通过、准备进入 Phase 2 BUILD 之前.
277
+ - **Step 1: brainstorming** — `skill(name="brainstorming")` — 输出设计文档 + CONTEXT.md + ADR。**HARD-GATE**: 设计未批准 → 不可进入实现
278
+ - **Step 2: autoplan** `skill(name="autoplan")` CEO/设计/工程自动评审 用户确认 taste_decisions
279
+ - **Step 3: delphi-review** `skill(name="delphi-review")` 等待 APPROVED(非 APPROVED 暂停等待用户确认)
280
+ - **Step 4: to-issues** `skill(name="to-issues")` 垂直切片 Issue 拆分 slices-manifest.json
281
+ - **Step 5: specification.yaml** — 从 APPROVED 设计文档自动提取
282
+ - **Web 前端额外注入**: `design-shotgun`
283
+ - **条件分支**: IF autoplan AUTO_APPROVED lightweight delphi-review (2 专家、1 轮); ELSE 标准 delphi-review (3 专家)
284
+
285
+ ### Phase 2/63/6: GITHOOKS-GATE(质量门禁安装检查)
286
+
287
+ **执行时机**: Phase 2/6 DESIGN 完全通过、准备进入 Phase 3/6 BUILD 之前。
256
288
 
257
289
  **必须执行**: 运行 `githooks/verify.sh` 检查当前项目的 hooks 是否安装。
258
290
 
259
291
  **检查结果处理**:
260
- - ✅ 全部存在 → 进入 Phase 2 BUILD 入口(仍必须先执行 DELPHI-GATE)
292
+ - ✅ 全部存在 → 进入 Phase 3/6 BUILD 入口(仍必须先执行 DELPHI-GATE)
261
293
  - ❌ 部分/全部缺失 → 运行 `githooks/install.sh` 安装(包括 `.git/hooks/pre-commit`、`.git/hooks/pre-push`、`githooks/adapter-common.sh`、`githooks/adapters/`)
262
294
  - 如果 githooks/ 目录不存在于项目根目录(即当前项目不是 xp-gate) → 从 xp-gate 仓库拉取 `githooks/` 目录结构
263
295
  - 安装完成后再次 `verify.sh` 确认
264
296
 
265
297
  **核心原则**: 没有质量门禁的代码不可进入 BUILD 阶段。**GITHOOKS-GATE 失败 → 不可编码。**
266
298
 
267
- ### Phase 2: BUILDralph-loop 默认 + TDD + 盲评 + 验证)
299
+ ### Phase 3/6: BUILD (构建 — ralph-loop 默认 + TDD + 盲评 + 验证)
268
300
 
269
- **详细指令**: 参见 `references/phase-2-build.md`。
301
+ **对应旧模型**: Phase 2 BUILD(功能不变)
302
+
303
+ **详细指令**: 参见 `references/phase-3-build.md`。
270
304
 
271
305
  **快速参考**:
272
306
  1. **DELPHI-GATE**: 验证 `.sprint-state/delphi-reviewed.json` 存在且 `verdict = "APPROVED"` → 否则 BLOCK
273
- 2. **输入**: `slices-manifest.json`(Phase 1 生成),按 `execution_order` 逐个执行
307
+ 2. **输入**: `slices-manifest.json`(Phase 2/6 生成),按 `execution_order` 逐个执行
274
308
  3. **模式**: 默认 `ralph-loop`(逐 REQ 迭代,token 节约 40-67%),可选 `--mode parallel`
275
309
  4. **Skill 步骤**: hooks-install → dispatching-parallel-agents → TDD (RED/GREEN/REFACTOR) → freeze → blind-review → unfreeze → verification-before-completion → 成本监控
276
310
  5. **Mock Minimization**: integration-first, mock 仅限 external services, 密度 > 30% 需 `@mock-justified`
277
311
 
278
- ### Phase 3: REVIEW + TEST(验证)
312
+ ### Phase 4/6: VERIFY (验证 — 代码走查 + QA + 反馈获取)
313
+
314
+ **对应旧模型**: Phase 3 REVIEW + Phase 4 FEEDBACK
315
+
316
+ **详细指令**: 参见 `references/phase-4-verify.md`。
317
+
318
+ **快速参考**:
279
319
  - **Orchestrator 直接执行**: delphi-review code-walkthrough 需要用户确认 verdict(Issue #249),**必须由 orchestrator 直接调用** `skill(name="delphi-review")`
280
- - **Orchestrator 按序执行**: `delphi-review --mode code-walkthrough` → 等待 APPROVED → `test-specification-alignment` → `browse` (gstack) → 可选 `qa`/`design-review`/`benchmark` (gstack)
281
- - 输入: phase-2-summary.md + MVP 代码
282
- - 输出: 评审报告 + 测试对齐结果
320
+ - **执行顺序**: `delphi-review --mode code-walkthrough` → 等待 APPROVED → `test-specification-alignment` → `browse` (gstack) → 可选 `qa`/`design-review`/`benchmark` (gstack)
321
+ - **Feedback 子阶段**: `learn` (Sprint 级复盘) + `retro` (工程回顾) + 可选 `systematic-debugging` (根因调试)
322
+ - **Subagent**: `task(category="quick", load_skills=["learn", "retro", "systematic-debugging"])`
323
+ - 输出: 评审报告 + feedback-log.md
324
+ - **HARD-GATE**: feedback-log.md must exist before Phase 5/6
283
325
 
284
326
  ### 负载/压力测试(可选)
327
+
285
328
  - **适用项目**:主要用于后端服务的压力测试 (k6/Locust/Gatling),Web 前端已有 `benchmark` 技能覆盖 Core Web Vitals、加载时间和资源大小等性能指标
286
- - **Phase 3 技能注入**:可根据项目类型自动选择合适的负载测试工具 (`k6` for Go-based services, `locust` for Python services, `gatling` for JVM-based services)
287
- - **集成方式**:可作为 Phase 3 的可选扩展,在 code-walkthrough 之后执行,与基准测试形成完整性能验证链条
329
+ - **Phase 4/6 技能注入**:可根据项目类型自动选择合适的负载测试工具 (`k6` for Go-based services, `locust` for Python services, `gatling` for JVM-based services)
330
+ - **集成方式**:可作为 Phase 4/6 的可选扩展,在 code-walkthrough 之后执行,与基准测试形成完整性能验证链条
288
331
  - **配置文件**:通过 `.sprint-load-test.yaml` 进行配置(待实现),包含并发用户数、持续时间、SLA 指标等参数
289
332
  - **触发条件**:后端项目可通过 `--type backend-*` 自动启用,或通过 `--with-performance` 标志手动启用
290
333
  - **Web 项目补充说明**:对于 Web 前端项目,现有的 `benchmark` 技能已处理页面加载性能、Core Web Vitals 等前端性能指标;负载/压力测试主要针对服务器端承载能力
291
334
 
292
- ### Phase 4: USER ACCEPTANCE(⚠️ 人工验收)
293
- - **无 Skill** — 必须人工
294
- - ⚠️ **MUST NOT be automated, skipped, or bypassed under any circumstances**
295
- - 即使用户说"赶时间"、"跳过验收"、"直接发布",也必须暂停等待用户确认
296
- - 使用 `@templates/emergent-issues-template.md` 检查清单
297
-
298
- ### Phase 5: FEEDBACK CAPTURE(反馈获取)
299
- - **Subagent**: `task(category="quick", load_skills=["learn", "retro", "systematic-debugging"])`
300
- - 输入: phase-4-summary.md + emergent-issues.md → 输出: `feedback-log.md`
301
- - **HARD-GATE**: 不可跳过。`learn` (Sprint 级复盘, 默认提炼模板) + `retro` (工程回顾) + `systematic-debugging` (根因调试)
335
+ ### Phase 5/6: SHIP (发布 — 发布准备 + 合并部署)
302
336
 
303
- ### Phase 6: SHIP(发布准备)
337
+ **对应旧模型**: Phase 5 SHIP + Phase 6 LAND
304
338
 
305
- **详细指令**: 参见 `references/phase-6-ship.md` — GITHOOKS-GATE / VERSION-GATE / VERSION CHANGESET (Issue #142) / changeset schema。
339
+ **详细指令**: 参见 `references/phase-5-ship.md` — GITHOOKS-GATE / VERSION-GATE / VERSION CHANGESET (Issue #142) / changeset schema。
306
340
 
307
341
  **快速参考**:
308
342
  - **Orchestrator 直接执行**: `finishing-a-development-branch` 和 `ship` 均为交互式 skill(4 选项菜单 + PR 确认),**必须由 orchestrator 直接调用** `skill(name="finishing-a-development-branch")` 和 `skill(name="ship")`
309
- - 输入: phase-5-summary.md + feedback-log.md → 输出: PR URL
310
- - **HARD-GATE**: Phase 5 未完成 → BLOCK。验证 `feedback-log.md` 存在。
343
+ - 输入: phase-4-summary.md + feedback-log.md → 输出: PR URL
344
+ - **HARD-GATE**: Phase 4/6 未完成 → BLOCK。验证 `feedback-log.md` 存在。
311
345
  - **GITHOOKS-GATE**: 验证 hooks 完整性,缺失则 `githooks/install.sh`
312
346
  - **VERSION-GATE**: bump PATCH/MINOR/MAJOR → `sync-version.sh` → CHANGELOG.md → `git diff VERSION` 验证
313
-
314
- ### Phase 7: LAND(合并 + 部署)
315
-
316
- **详细指令**: 参见 `references/phase-7-land.md` — 完整流程、SLA 指标、回滚策略。
317
-
318
- **快速参考**:
319
- - **Orchestrator 直接执行**: `land-and-deploy` 包含 merge 确认和 rollback 决策,**必须由 orchestrator 直接调用** `skill(name="land-and-deploy")`
320
- - 输入: phase-6-summary.md + PR URL → 输出: 部署状态 + Canary 报告
321
- - 流程: Merge PR → 等待 CI (10min) → 等待 Deploy (10min) → Canary Health Check (5min)
347
+ - **LAND**: `land-and-deploy` — merge PR → 等待 CI (10min) → 等待 Deploy (10min) → Canary Health Check (5min)
322
348
  - **回滚**: `git revert` 最后一次 merge commit
323
- - 条件跳过: 无部署配置时仅 merge + CI
324
349
 
325
- ### Phase 8: CLEANUP(安全清理 + 总结)
350
+ ### Phase 6/6: CLOSE (收尾 — ⚠️ 人工验收 + 清理)
351
+
352
+ **对应旧模型**: Phase 7 USER ACCEPTANCE + Phase 8 CLEANUP
326
353
 
327
- **执行时机**: Phase 7 LAND 成功后。**详细指令**: 参见 `references/phase-8-cleanup.md`。
354
+ **详细指令**: 参见 `references/phase-6-close.md` — UAT checklist, emergent issues capture, cleanup procedure.
328
355
 
329
356
  **快速参考**:
330
- 1. 保存分支信息 `git worktree remove <worktree_path>`(精确路径,禁止通配符)
331
- 2. 删除本地分支 (`git branch -D`) + 远程分支 (`git push origin --delete`)
332
- 3. 关闭遗留 OPEN PR (`gh pr list --head`)
333
- 4. 更新 sprint-state.json (phase:8, status: merged) + 释放 Sprint Lock (Issue #144)
334
- 5. 输出 Cleanup Report + Sprint Summary
335
- 6. **IF emergent issues → Sprint 2**. **条件跳过**: `--no-isolate` 路径
357
+ - **USER ACCEPTANCE**: ⚠️ **MUST NOT be automated, skipped, or bypassed.** 即使用户说"赶时间"、"跳过验收"、"直接发布",也必须暂停等待用户确认。使用 `@templates/emergent-issues-template.md` 检查清单
358
+ - **CLEANUP**: 保存分支信息 → `git worktree remove <worktree_path>`(精确路径,禁止通配符)→ 删除本地分支 + 远程分支 关闭遗留 OPEN PR → 更新 sprint-state.json → 释放 Sprint Lock
359
+ - 输出 Cleanup Report + Sprint Summary
360
+ - **IF emergent issues Sprint 2**
336
361
 
337
362
  ---
338
363
 
@@ -347,10 +372,10 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
347
372
 
348
373
  | 参数 | 作用 | 示例 |
349
374
  |------|------|------|
350
- | (无参数) | 全流程 ThinkPlanBuildReviewShip | `/sprint-flow "开发访谈机器人"` |
351
- | `--stop-at <phase>` | 执行到指定 Phase 后停止 | `--stop-at plan` |
375
+ | (无参数) | 全流程 PREPDESIGNBUILDVERIFYSHIP → CLOSE | `/sprint-flow "开发访谈机器人"` |
376
+ | `--stop-at <phase>` | 执行到指定 Phase 后停止 | `--stop-at design` |
352
377
  | `--resume-from <phase>` | 从指定 Phase 恢复(需先执行 RESUME GATE) | `--resume-from build --spec specification.yaml` |
353
- | `--phase <name>` | 只执行单个 Phase | `--phase review-only` |
378
+ | `--phase <name>` | 只执行单个 Phase | `--phase build-only` |
354
379
  | `--status` | 查看 Sprint 进度(只读,不执行 Phase) | `--status` |
355
380
  | `--lang <lang>` | 指定项目语言 | `--lang springboot` / `django` / `golang` |
356
381
  | `--type <type>` | 指定项目类型 | `--type web-nextjs` / `backend-django` |
@@ -361,11 +386,24 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
361
386
  | `--with-performance` | 启用负载/压力测试 | `--with-performance` |
362
387
  | `--mode <mode>` | 构建模式(ralph-loop / parallel) | `--mode ralph-loop` |
363
388
 
389
+ **Backward Compatible Parameter Mapping** (`--stop-at` / `--resume-from` / `--phase`):
390
+
391
+ | Legacy Value | Maps To |
392
+ |-------------|---------|
393
+ | `isolate`, `isolate-only` | `prep`, `prep-only` |
394
+ | `think`, `think-only` | `design`, `design-only` |
395
+ | `plan`, `plan-only` | `design`, `design-only` |
396
+ | `build`, `build-only` | `build`, `build-only` |
397
+ | `review`, `review-only` | `verify`, `verify-only` |
398
+ | `ship`, `ship-only` | `ship`, `ship-only` |
399
+ | `land`, `land-only` | `ship`, `ship-only` |
400
+ | `cleanup`, `cleanup-only` | `close`, `close-only` |
401
+
364
402
  **`--status` 行为规则**:
365
403
  - 执行 `node scripts/render-sprint-progress.cjs`,读取 `.sprint-state/sprint-state.json` 并渲染 ASCII 进度看板
366
404
  - 如果 `sprint-state.json` 不存在 → `[INFO] 未找到活跃的 Sprint`
367
405
  - 如果 `status == "completed"` → 输出完整看板 + `[INFO] Sprint 已完成。`
368
- - `--status` 可与其他参数组合:`--status --resume-from build` → 先展示状态,再提示 "将从 Phase 2 BUILD 继续"
406
+ - `--status` 可与其他参数组合:`--status --resume-from build` → 先展示状态,再提示 "将从 Phase 3/6 BUILD 继续"
369
407
 
370
408
  **`--resume-from` 限制**:校验为**尽力而为**(git commit 可被 GC 回收、文件 mtime 可被 `git checkout` 修改)。校验失败时输出完整诊断日志,建议启动新 Sprint。
371
409
 
@@ -387,14 +425,12 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
387
425
 
388
426
  | Phase | Backend (default) | Web Frontend | Mobile | Load Test |
389
427
  |-------|------------------|-------------|--------|-----------|
390
- | 0 THINK | `brainstorming` | (同) | (同) | (通用) |
391
- | 1 PLAN | `autoplan` + `delphi-review` | + `design-shotgun` | (同 web) | (同) |
392
- | 2 BUILD | TDD + blind-review | (同 backend) | + `vercel-react-native-skills` / `flutter-review` | (同) |
393
- | 3 REVIEW | `delphi-review --mode code-walkthrough` + `test-specification-alignment` + k6/locust/gatling | + `qa` + `design-review` + `benchmark` | Flutter: `flutter-test` / RN: `detox E2E` | k6/locust/gatling |
394
- | 5 FEEDBACK | `learn` + `retro` | (同) | (同) | (同) |
395
- | 6 SHIP | `finishing-a-development-branch` + `ship` | (同) | + platform deploy | (同) |
396
- | 7 LAND | `land-and-deploy` + canary | (同) | (同) | (同) |
397
- | 8 CLEANUP | worktree remove + branch delete + state update | (同) | (同) | (同) |
428
+ | 2/6 DESIGN | `brainstorming` + `autoplan` + `delphi-review` | + `design-shotgun` | (同 web) | (通用) |
429
+ | 3/6 BUILD | TDD + blind-review | (同 backend) | + `vercel-react-native-skills` / `flutter-review` | (同) |
430
+ | 4/6 VERIFY | `delphi-review --mode code-walkthrough` + `test-specification-alignment` + k6/locust/gatling | + `qa` + `design-review` + `benchmark` | Flutter: `flutter-test` / RN: `detox E2E` | k6/locust/gatling |
431
+ | 4/6 VERIFY (Feedback) | `learn` + `retro` | (同) | (同) | (同) |
432
+ | 5/6 SHIP | `finishing-a-development-branch` + `ship` + `land-and-deploy` | (同) | + platform deploy | (同) |
433
+ | 6/6 CLOSE | 人工验收 cleanup | (同) | (同) | (同) |
398
434
  | Browse | `localhost:3000` | 部署 URL + 表单/交互 | Flutter Web / RN Web | (专用) |
399
435
 
400
436
  **Mobile 工具链**: Flutter — `flutter analyze/test/build/pub publish`; RN — `metro/detox/jest/react-native run-ios/android`
@@ -405,7 +441,7 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
405
441
 
406
442
  **Sprint State**: 存储于 `<project-root>/.sprint-state/` — `sprint-state.yaml`/`.json` + `phase-outputs/` (pain-document.md / specification.yaml / mvp-v1 / review-report.md / emergent-issues.md / feedback-log.md / sprint-summary.md)
407
443
 
408
- **Sprint 2 自动触发**: Phase 6 完成时 — `emergent_issues_count == 0` → 结束; `> 0` → Critical 自动启动 Sprint 2, Major/Minor 询问用户
444
+ **Sprint 2 自动触发**: Phase 6/6 CLOSE 完成时 — `emergent_issues_count == 0` → 结束; `> 0` → Critical 自动启动 Sprint 2, Major/Minor 询问用户
409
445
 
410
446
  ---
411
447
 
@@ -414,17 +450,17 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
414
450
  **编排器必须在每个 Phase 完成后更新 `.sprint-state/sprint-state.json`**:
415
451
 
416
452
  1. **Phase 完成后立即更新**(每个 Phase 结束前):
417
- - `phase`: 更新为当前 Phase 编号(如 `0`, `1`, `2`...)
453
+ - `phase`: 更新为当前 Phase 编号(如 `1`, `2`, `3`...)
418
454
  - `status`: 更新为 `"completed"`(已完成 Phase)
419
455
  - `phase_history`: 追加新条目
420
456
 
421
457
  2. **`phase_history` 数组条目 schema**:
422
458
  ```json
423
459
  {
424
- "phase": 0,
425
- "phase_name": "THINK",
460
+ "phase": 1,
461
+ "phase_name": "PREP",
426
462
  "status": "completed",
427
- "timestamp": "2026-06-20T10:30:00Z"
463
+ "timestamp": "2026-07-08T10:30:00Z"
428
464
  }
429
465
  ```
430
466
 
@@ -436,21 +472,19 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
436
472
  4. **完整 sprint-state.json 示例**:
437
473
  ```json
438
474
  {
439
- "id": "sprint-2026-06-20-01",
440
- "phase": 2,
475
+ "id": "sprint-2026-07-08-01",
476
+ "phase": 3,
441
477
  "status": "in_progress",
442
478
  "phase_history": [
443
- {"phase": -1, "phase_name": "ISOLATE", "status": "completed", "timestamp": "2026-06-20T10:00:00Z"},
444
- {"phase": -0.5, "phase_name": "AUTO-ESTIMATE", "status": "completed", "timestamp": "2026-06-20T10:05:00Z"},
445
- {"phase": 0, "phase_name": "THINK", "status": "completed", "timestamp": "2026-06-20T10:15:00Z"},
446
- {"phase": 1, "phase_name": "PLAN", "status": "completed", "timestamp": "2026-06-20T10:30:00Z"}
479
+ {"phase": 1, "phase_name": "PREP", "status": "completed", "timestamp": "2026-07-08T10:00:00Z"},
480
+ {"phase": 2, "phase_name": "DESIGN", "status": "completed", "timestamp": "2026-07-08T10:30:00Z"}
447
481
  ],
448
482
  "isolation": {
449
- "worktree_path": "/home/boyingliu01/projects/xp-gate/.worktrees/sprint/sprint-2026-06-20-01",
450
- "branch": "sprint/2026-06-20-01"
483
+ "worktree_path": "/home/boyingliu01/projects/xp-gate/.worktrees/sprint/sprint-2026-07-08-01",
484
+ "branch": "sprint/2026-07-08-01"
451
485
  },
452
486
  "outputs": {
453
- "pain_document": "phase-outputs/phase-0-summary.md",
487
+ "pain_document": "phase-outputs/phase-2-summary.md",
454
488
  "specification": "phase-outputs/specification.yaml"
455
489
  },
456
490
  "metrics": {
@@ -459,15 +493,17 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
459
493
  }
460
494
  ```
461
495
 
496
+ **Backward compat**: Old sprint-state.json files using negative/legacy phase numbers (`-1`, `-0.5`, `0`..`8`) remain readable. Dashboard renders them as-is. New sprints use phase numbers 1-6.
497
+
462
498
  ---
463
499
 
464
500
  ## 使用示例
465
501
 
466
502
  | 场景 | 命令 | 说明 |
467
503
  |------|------|------|
468
- | 完整流水线 | `/sprint-flow "开发访谈机器人"` | 自动执行 11 阶段 → specification.yaml + PR URL |
469
- | 规划后停止 | `/sprint-flow "开发认证模块" --stop-at plan` | 输出 specification.yaml 后停止,供评审 |
470
- | 仅构建阶段 | `/sprint-flow "开发 API" --lang django --phase build-only` | 跳过隔离/规划,直接 Build |
504
+ | 完整流水线 | `/sprint-flow "开发访谈机器人"` | 自动执行 6 阶段 → specification.yaml + PR URL |
505
+ | 设计后停止 | `/sprint-flow "开发认证模块" --stop-at design` | 输出 specification.yaml 后停止,供评审 |
506
+ | 仅构建阶段 | `/sprint-flow "开发 API" --lang django --phase build-only` | 跳过准备/设计,直接 Build |
471
507
 
472
508
  ## 底层 Skills 保持独立
473
509
 
@@ -480,11 +516,11 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
480
516
  | 错误 | 正确 |
481
517
  |------|------|
482
518
  | 把普通问答、解释、代码检索请求路由到 sprint-flow | 仅在用户明确要求开发/实现/一键开发完整需求时触发 sprint-flow |
483
- | 跳过 Phase -1 隔离,直接在 main/master/develop 上改代码 | 默认创建 worktree;除非用户显式使用 `--no-isolate` 或 `--force` 并确认风险 |
484
- | 未完成 Phase -0.5 AUTO-ESTIMATE 就套用完整重流程 | 先评估轻量/标准/复杂,再按推荐流程或用户确认后的流程执行 |
485
- | Plan 阶段跳过 Delphi 评审直接 Build | 所有需求级别(轻量/标准/复杂)必须经过 autoplan + delphi-review;未 APPROVED 禁止编码 |
486
- | 跳过 TDD 直接实现代码 | Phase 2 必须遵循 RED → GREEN → REFACTOR,测试与实现一起交付 |
487
- | 跳过用户验收直接 Ship | Phase 4 USER ACCEPTANCE 必须人工完成;不得自动化、跳过或伪造 |
519
+ | 跳过 Phase 1/6 PREP 隔离,直接在 main/master/develop 上改代码 | 默认创建 worktree;除非用户显式使用 `--no-isolate` 或 `--force` 并确认风险 |
520
+ | 未完成 PREP AUTO-ESTIMATE 就套用完整重流程 | 先评估轻量/标准/复杂,再按推荐流程或用户确认后的流程执行 |
521
+ | DESIGN 阶段跳过 Delphi 评审直接 BUILD | 所有需求级别(轻量/标准/复杂)必须经过 autoplan + delphi-review;未 APPROVED 禁止编码 |
522
+ | 跳过 TDD 直接实现代码 | Phase 3/6 BUILD 必须遵循 RED → GREEN → REFACTOR,测试与实现一起交付 |
523
+ | 跳过用户验收直接 Ship | Phase 6/6 CLOSE USER ACCEPTANCE 必须人工完成;不得自动化、跳过或伪造 |
488
524
  | 验证失败后继续追加随机修改 | 最多 3 次修复循环;仍失败则 BLOCK 并请求用户决策 |
489
525
  | 未生成 Phase Summary 就进入下一阶段 | 每个 Phase 必须写入 `.sprint-state/phase-outputs/phase-{N}-summary.md` 并通过 transition gate |
490
526
 
@@ -507,27 +543,31 @@ See [Output Contract](#output-contract) below for the canonical machine-readable
507
543
  ## References
508
544
 
509
545
  详细指令文件位于 `@references/`:
510
- - `@references/phase-minus-1-isolate.md` — Phase -1 详细指令
511
- - `@references/phase-minus-0-5-auto-estimate.md` Phase -0.5 详细指令
512
- - `@references/phase-0-think.md` — Phase 0 详细指令
513
- - `@references/phase-1-plan.md` Phase 1 详细指令
514
- - `@references/phase-2-build.md` Phase 2 详细指令
515
- - `@references/phase-3-review.md` Phase 3 详细指令
516
- - `@references/phase-4-uat.md` Phase 4 详细指令(人工)
517
- - `@references/phase-5-feedback.md` Phase 5 详细指令
518
- - `@references/phase-6-ship.md` Phase 6 详细指令
519
- - `@references/phase-7-land.md` — Phase 7 详细指令
520
- - `@references/phase-8-cleanup.md` — Phase 8 详细指令
546
+
547
+ | File | Phase | Phase Name | Maps From (Old) |
548
+ |------|-------|------------|-----------------|
549
+ | `@references/phase-1-prep.md` | 1/6 | PREP | Phase -1 ISOLATE + Phase -0.5 AUTO-ESTIMATE |
550
+ | `@references/phase-2-design.md` | 2/6 | DESIGN | Phase 0 THINK + Phase 1 PLAN |
551
+ | `@references/phase-3-build.md` | 3/6 | BUILD | Phase 2 BUILD |
552
+ | `@references/phase-4-verify.md` | 4/6 | VERIFY | Phase 3 REVIEW + Phase 4 FEEDBACK |
553
+ | `@references/phase-5-ship.md` | 5/6 | SHIP | Phase 5 SHIP + Phase 6 LAND |
554
+ | `@references/phase-6-close.md` | 6/6 | CLOSE | Phase 7 USER ACCEPTANCE + Phase 8 CLEANUP |
555
+
556
+ Additional reference files:
557
+ - `@references/force-levels.md` — Phase forcing rules
558
+ - `@references/orchestration-rules.md` — Orchestration layer rules
559
+ - `@references/components/` — Reusable phase building blocks
521
560
 
522
561
  ---
523
562
 
524
563
  ## Templates
525
564
 
526
565
  模板文件位于 `@templates/`:
527
- - `@templates/pain-document-template.md` — Pain Document 模板
528
- - `@templates/emergent-issues-template.md` — Emergent Issues 检查清单
529
- - `@templates/sprint-summary-template.md` — Sprint Summary 模板
566
+ - `@templates/pain-document-template.md` — Pain Document 模板 (Phase 2/6 DESIGN)
567
+ - `@templates/emergent-issues-template.md` — Emergent Issues 检查清单 (Phase 6/6 CLOSE)
568
+ - `@templates/sprint-summary-template.md` — Sprint Summary 模板 (Phase 6/6 CLOSE)
530
569
  - `@templates/sprint-progress-template.md` — Sprint 进度看板(每个 Phase 完成后 + `--status` 查询时渲染)
570
+ - `@templates/auto-estimate-output-template.md` — AUTO-ESTIMATE 输出格式 (Phase 1/6 PREP)
531
571
 
532
572
  ---
533
573
 
@@ -535,10 +575,36 @@ See [Output Contract](#output-contract) below for the canonical machine-readable
535
575
 
536
576
  | 证据 | 来源 | 应用 |
537
577
  |------|------|------|
538
- | One-shot = 单次迭代执行 | Boris Cherny interview | Phase 2 设计 |
539
- | 80% session 从 Plan Mode 开始 | Boris skill | Phase 1 设计 |
540
- | Verification improves 2-3x | Boris #1 tip | Phase 3 设计 |
541
- | Emergent requirements 无法消除 | Mike Cohn, Rafael Santos | Phase 4 人工设计 |
542
- | 78% failures invisible | arXiv research | Phase 4 必要性证明 |
578
+ | One-shot = 单次迭代执行 | Boris Cherny interview | Phase 3/6 BUILD 设计 |
579
+ | 80% session 从 Plan Mode 开始 | Boris skill | Phase 2/6 DESIGN 设计 |
580
+ | Verification improves 2-3x | Boris #1 tip | Phase 4/6 VERIFY 设计 |
581
+ | Emergent requirements 无法消除 | Mike Cohn, Rafael Santos | Phase 6/6 CLOSE 人工设计 |
582
+ | 78% failures invisible | arXiv research | Phase 6/6 必要性证明 |
543
583
  | Think → Plan → Build → Ship | gstack ETHOS | 整体流程设计 |
544
584
 
585
+ ---
586
+
587
+ ## Phase Flow Consistency
588
+
589
+ This section documents the canonical 6-phase order to ensure all future edits keep the phase sequence synchronized across all locations in this document and its reference files.
590
+
591
+ **Canonical Phase Order** (Phase 1/6..6/6):
592
+
593
+ | Phase # | Name | Phase # | Name |
594
+ |---------|------|---------|------|
595
+ | 1/6 | PREP | 4/6 | VERIFY |
596
+ | 2/6 | DESIGN | 5/6 | SHIP |
597
+ | 3/6 | BUILD | 6/6 | CLOSE |
598
+
599
+ **Locations that MUST keep this order synchronized**:
600
+ 1. **Frontmatter `workflow_steps`** — Phase list
601
+ 2. **Frontmatter `description` trigger text** — Flow string
602
+ 3. **Body "完整流程" section** — Phase descriptions in order
603
+ 4. **Body "Phase Flow" diagram** — ASCII flow diagram
604
+ 5. **Body "强制输出格式规范" section** — Output format
605
+ 6. **Body "Workflow Steps" table** — Step/Phase table
606
+ 7. **Body "References" section** — Reference file list
607
+ 8. **`references/orchestration-rules.md` Phase Subagent Dispatch Matrix** — Phase/Name order
608
+ 9. **`references/force-levels.md`** — Phase references
609
+
610
+ **⚠️ Migration from old 11-phase model (v2.0)**: The 6-phase model was introduced in Issue #290 to reduce cognitive load. Old sprint-state.json files with negative/legacy phase numbers remain backward-compatible.