cc-devflow 4.1.5 → 4.1.6

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 (111) hide show
  1. package/.claude/CLAUDE.md +87 -1091
  2. package/.claude/commands/core/architecture.md +2 -2
  3. package/.claude/commands/core/guidelines.md +2 -2
  4. package/.claude/commands/core/roadmap.md +4 -4
  5. package/.claude/commands/core/style.md +40 -268
  6. package/.claude/commands/flow/CLAUDE.md +28 -0
  7. package/.claude/commands/flow/archive.md +2 -2
  8. package/.claude/commands/flow/checklist.md +9 -251
  9. package/.claude/commands/flow/clarify.md +9 -127
  10. package/.claude/commands/flow/constitution.md +1 -1
  11. package/.claude/commands/flow/context.md +1 -1
  12. package/.claude/commands/flow/dev.md +19 -395
  13. package/.claude/commands/flow/ideate.md +13 -13
  14. package/.claude/commands/flow/init.md +19 -30
  15. package/.claude/commands/flow/new.md +12 -268
  16. package/.claude/commands/flow/quality.md +10 -153
  17. package/.claude/commands/flow/release.md +18 -81
  18. package/.claude/commands/flow/restart.md +15 -16
  19. package/.claude/commands/flow/spec.md +14 -164
  20. package/.claude/commands/flow/status.md +12 -12
  21. package/.claude/commands/flow/update.md +4 -4
  22. package/.claude/commands/flow/upgrade.md +6 -6
  23. package/.claude/commands/flow/verify.md +19 -78
  24. package/.claude/commands/flow/workspace.md +1 -1
  25. package/.claude/docs/guides/INIT_TROUBLESHOOTING.md +7 -7
  26. package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +44 -96
  27. package/.claude/docs/guides/ROADMAP_TROUBLESHOOTING.md +1 -1
  28. package/.claude/docs/guides/TASK_COMPLETION_MARKING.md +5 -5
  29. package/.claude/docs/templates/ATTEMPT_TEMPLATE.md +1 -1
  30. package/.claude/docs/templates/BACKLOG_TEMPLATE.md +3 -3
  31. package/.claude/docs/templates/CLARIFICATION_REPORT_TEMPLATE.md +5 -5
  32. package/.claude/docs/templates/ERROR_LOG_TEMPLATE.md +2 -2
  33. package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +3 -3
  34. package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +33 -64
  35. package/.claude/docs/templates/RESEARCH_TEMPLATE.md +3 -3
  36. package/.claude/docs/templates/ROADMAP_DIALOGUE_TEMPLATE.md +2 -2
  37. package/.claude/docs/templates/ROADMAP_TEMPLATE.md +2 -2
  38. package/.claude/docs/templates/STYLE_TEMPLATE.md +3 -3
  39. package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +8 -9
  40. package/.claude/guides/workflow-guides/flow-orchestrator.md +31 -265
  41. package/.claude/hooks/CLAUDE.md +1 -1
  42. package/.claude/hooks/checklist-gate.js +4 -4
  43. package/.claude/hooks/inject-agent-context.ts +2 -2
  44. package/.claude/scripts/calculate-checklist-completion.sh +2 -2
  45. package/.claude/scripts/check-prerequisites.sh +2 -2
  46. package/.claude/scripts/checklist-errors.sh +4 -4
  47. package/.claude/scripts/flow-quality-full.sh +5 -5
  48. package/.claude/scripts/flow-quality-quick.sh +4 -4
  49. package/.claude/scripts/flow-workspace-init.sh +2 -2
  50. package/.claude/scripts/generate-clarification-report.sh +4 -4
  51. package/.claude/scripts/recover-workflow.sh +70 -73
  52. package/.claude/scripts/run-quality-gates.sh +1 -1
  53. package/.claude/scripts/setup-epic.sh +2 -2
  54. package/.claude/scripts/setup-ralph-loop.sh +2 -2
  55. package/.claude/scripts/validate-research.sh +1 -1
  56. package/.claude/scripts/verify-setup.sh +1 -1
  57. package/.claude/skills/cc-devflow-orchestrator/SKILL.md +88 -108
  58. package/.claude/skills/workflow/CLAUDE.md +24 -0
  59. package/.claude/skills/workflow/flow-dev/CLAUDE.md +14 -76
  60. package/.claude/skills/workflow/flow-dev/SKILL.md +29 -67
  61. package/.claude/skills/workflow/flow-dev/context.jsonl +4 -8
  62. package/.claude/skills/workflow/flow-init/SKILL.md +24 -151
  63. package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +1 -1
  64. package/.claude/skills/workflow/flow-init/context.jsonl +3 -3
  65. package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +1 -1
  66. package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +1 -1
  67. package/.claude/skills/workflow/flow-release/SKILL.md +23 -56
  68. package/.claude/skills/workflow/flow-release/context.jsonl +5 -7
  69. package/.claude/skills/workflow/flow-spec/CLAUDE.md +15 -101
  70. package/.claude/skills/workflow/flow-spec/SKILL.md +15 -518
  71. package/.claude/skills/workflow/flow-spec/context.jsonl +5 -7
  72. package/.claude/skills/workflow/flow-verify/CLAUDE.md +10 -0
  73. package/.claude/skills/workflow/flow-verify/SKILL.md +53 -0
  74. package/.claude/skills/workflow/flow-verify/context.jsonl +5 -0
  75. package/.claude/skills/workflow.yaml +72 -267
  76. package/CHANGELOG.md +31 -0
  77. package/README.md +91 -69
  78. package/README.zh-CN.md +90 -67
  79. package/bin/harness.js +22 -0
  80. package/docs/commands/README.md +34 -38
  81. package/docs/commands/README.zh-CN.md +34 -36
  82. package/docs/commands/core-roadmap.md +2 -2
  83. package/docs/commands/core-roadmap.zh-CN.md +2 -2
  84. package/docs/commands/core-style.md +29 -381
  85. package/docs/commands/core-style.zh-CN.md +29 -381
  86. package/docs/commands/flow-init.md +10 -10
  87. package/docs/commands/flow-init.zh-CN.md +11 -11
  88. package/docs/commands/flow-new.md +25 -260
  89. package/docs/commands/flow-new.zh-CN.md +26 -257
  90. package/docs/guides/getting-started.md +16 -15
  91. package/docs/guides/getting-started.zh-CN.md +10 -12
  92. package/lib/compiler/__tests__/manifest.test.js +156 -0
  93. package/lib/compiler/__tests__/parser.test.js +21 -0
  94. package/lib/compiler/index.js +17 -1
  95. package/lib/compiler/manifest.js +68 -6
  96. package/lib/compiler/parser.js +5 -0
  97. package/lib/harness/CLAUDE.md +21 -0
  98. package/lib/harness/cli.js +208 -0
  99. package/lib/harness/index.js +16 -0
  100. package/lib/harness/operations/dispatch.js +285 -0
  101. package/lib/harness/operations/init.js +48 -0
  102. package/lib/harness/operations/janitor.js +74 -0
  103. package/lib/harness/operations/pack.js +100 -0
  104. package/lib/harness/operations/plan.js +29 -0
  105. package/lib/harness/operations/release.js +83 -0
  106. package/lib/harness/operations/resume.js +44 -0
  107. package/lib/harness/operations/verify.js +163 -0
  108. package/lib/harness/planner.js +141 -0
  109. package/lib/harness/schemas.js +108 -0
  110. package/lib/harness/store.js +240 -0
  111. package/package.json +9 -1
@@ -1,6 +1,6 @@
1
- # Flow-New Troubleshooting Guide
1
+ # Mainline Troubleshooting Guide
2
2
 
3
- > Quick reference for `/flow-new` errors and recovery
3
+ > Quick reference for canonical `/flow:*` delivery errors and recovery.
4
4
 
5
5
  ---
6
6
 
@@ -8,144 +8,92 @@
8
8
 
9
9
  ### E1: Stage Command Not Found
10
10
  ```bash
11
- ❌ ERROR: Command /flow-init not found
11
+ ❌ ERROR: Command /flow:init not found
12
12
  ```
13
- **Fix**: `ls .claude/commands/flow-*.md` → 检查缺失文件 → `git checkout HEAD -- .claude/commands/`
14
-
15
- ---
13
+ **Fix**: 检查 `.claude/commands/flow/` 是否完整;确认当前分支已同步最新命令目录。
16
14
 
17
15
  ### E2: Status File Corrupted
18
16
  ```bash
19
17
  ❌ ERROR: Invalid orchestration_status.json
20
18
  ```
21
19
  **Diagnose**: `jq . devflow/requirements/REQ-123/orchestration_status.json`
22
- **Fix**: 从模板重建或 `/flow-restart "REQ-123"`
23
-
24
- ---
20
+ **Fix**: 重建状态文件后执行 `/flow:status "REQ-123"` 并从建议阶段恢复。
25
21
 
26
22
  ### E3: Interrupted, Cannot Resume
27
23
  ```bash
28
- ❌ ERROR: Requirement REQ-123 already exists
29
- ```
30
- **Diagnose**: `/flow-status REQ-123`
31
- **Fix**: `/flow-restart "REQ-123"` 或手动从特定阶段继续
32
-
33
- ---
34
-
35
- ### E4: UI Detection False Positive
36
- ```bash
37
- ✅ UI原型生成完成 (但项目是纯后端)
24
+ ❌ ERROR: development_in_progress but checkpoint missing
38
25
  ```
39
- **Fix**: PRD.md 开头添加 `## 项目类型声明\n**纯后端 API 项目**,无 UI 需求。`
40
-
41
- ---
26
+ **Diagnose**: `/flow:status "REQ-123"`
27
+ **Fix**: `/flow:dev "REQ-123" --resume`
42
28
 
43
- ### E5: Epic 未覆盖所有技术层
29
+ ### E4: Task Manifest Missing
44
30
  ```bash
45
- ⚠️ WARNING: TASKS.md 未覆盖 TECH_DESIGN.md 所有层
31
+ ERROR: TASKS.md not found
46
32
  ```
47
- **Diagnose**: `grep "## Section" devflow/requirements/REQ-123/TECH_DESIGN.md`
48
- **Fix**: 手动补充缺失任务或重新生成 `/flow-epic "REQ-123"`
49
-
50
- ---
33
+ **Fix**: 重新执行 `/flow:spec "REQ-123"` 生成规划产物。
51
34
 
52
- ### E6: QA Gate Failure
35
+ ### E5: Verify Gate Failure
53
36
  ```bash
54
- 代码覆盖率: 65% (要求 ≥ 80%)
55
- 安全问题: 2 个高危漏洞
37
+ Coverage below threshold
38
+ High severity security issue
56
39
  ```
57
40
  **Fix**:
58
- - 补充测试: `npm test -- --coverage --verbose` → 识别未覆盖模块
59
- - 修复漏洞: 查看 `SECURITY_REPORT.md` → 修复代码 → 重新运行 `/flow-qa "REQ-123" --full`
60
-
61
- ---
62
-
63
- ### E7: Build Failure
64
- ```bash
65
- ❌ error TS2345: Argument of type 'string | undefined'...
66
- ```
67
- **Fix**: `npm run typecheck` → 修复类型错误 → `npm run build`
68
-
69
- ---
41
+ - 修复代码与测试后重跑 `/flow:verify "REQ-123" --strict`
42
+ - 通过后再执行 `/flow:release "REQ-123"`
70
43
 
71
- ### E8: PR Creation Failed
44
+ ### E6: Release Blocked
72
45
  ```bash
73
- gh pr create: HTTP 403: Resource not accessible
46
+ Missing strict verify report-card
74
47
  ```
75
- **Fix**: `gh auth login` 重新认证 → `/flow-release "REQ-123"`
48
+ **Fix**: 先执行 `/flow:verify "REQ-123" --strict`,再执行 `/flow:release "REQ-123"`。
76
49
 
77
50
  ---
78
51
 
79
52
  ## Recovery Procedures
80
53
 
81
- ### Complete Restart
54
+ ### Full Rebuild
82
55
  ```bash
83
56
  rm -rf devflow/requirements/REQ-123/
84
- git branch -D feature/REQ-123-*
85
- /flow-new "REQ-123|Title|URLs"
57
+ /flow:init "REQ-123|Title|URLs"
58
+ /flow:spec "REQ-123"
59
+ /flow:dev "REQ-123"
60
+ /flow:verify "REQ-123" --strict
86
61
  ```
87
62
 
88
- ### Partial Resume (从特定任务继续)
63
+ ### Resume From Current Stage
89
64
  ```bash
90
- # 检查任务状态
91
- bash .claude/scripts/check-task-status.sh --verbose
92
-
93
- # 从特定任务继续
94
- /flow-dev "REQ-123" --task T008
65
+ /flow:status "REQ-123"
66
+ /flow:dev "REQ-123" --resume
95
67
  ```
96
68
 
97
- ### State File Rebuild
69
+ ### State File Rebuild (Minimal)
98
70
  ```bash
99
71
  REQ_DIR="devflow/requirements/REQ-123"
100
- HAS_PRD=$([ -f "$REQ_DIR/PRD.md" ] && echo true || echo false)
101
- HAS_TECH=$([ -f "$REQ_DIR/TECH_DESIGN.md" ] && echo true || echo false)
102
-
103
- # 重建状态文件
104
- cat > $REQ_DIR/orchestration_status.json <<EOF
72
+ cat > "$REQ_DIR/orchestration_status.json" <<EOF_JSON
105
73
  {
106
74
  "reqId": "REQ-123",
107
- "status": "$( [ "$HAS_TECH" = "true" ] && echo "tech_complete" || echo "prd_complete" )",
108
- "prd_complete": $HAS_PRD,
109
- "tech_design_complete": $HAS_TECH,
110
- "epic_complete": false,
111
- "dev_complete": false
75
+ "status": "spec_complete",
76
+ "phase": "planning",
77
+ "spec_complete": true,
78
+ "development_complete": false,
79
+ "quality_complete": false,
80
+ "release_complete": false
112
81
  }
113
- EOF
114
-
115
- jq . $REQ_DIR/orchestration_status.json # 验证
116
- /flow-restart "REQ-123"
117
- ```
82
+ EOF_JSON
118
83
 
119
- ---
120
-
121
- ## Configuration
122
-
123
- ### Environment Variables
124
- | Variable | Default | Purpose |
125
- |----------|---------|---------|
126
- | `SKIP_UI_DETECTION` | `false` | 强制跳过 UI 生成 |
127
- | `COVERAGE_THRESHOLD` | `80` | 代码覆盖率要求 |
128
- | `FLOW_DEBUG` | `false` | 启用调试日志 |
129
-
130
- ### Command-Line Flags
131
- ```bash
132
- /flow-new "REQ-123|..." --skip-ui # 跳过 UI
133
- /flow-new "REQ-123|..." --resume # 恢复执行
84
+ jq . "$REQ_DIR/orchestration_status.json"
85
+ /flow:status "REQ-123"
134
86
  ```
135
87
 
136
88
  ---
137
89
 
138
90
  ## FAQ
139
91
 
140
- **Q: 可以在 flow-new 执行中暂停吗?**
141
- A: Ctrl+C 中断 `/flow-status REQ-123` 查看状态 `/flow-restart "REQ-123"` 恢复
142
-
143
- **Q: 如何从特定阶段重新开始?**
144
- A: 使用对应阶段命令重新执行,如 `/flow-prd "REQ-123"` 或 `/flow-epic "REQ-123"`
92
+ **Q: 如何从特定阶段重启?**
93
+ A: `/flow:status` 先确认状态,然后执行对应阶段命令(通常是 `/flow:dev --resume` `/flow:verify --strict`)。
145
94
 
146
- **Q: flow-new 支持 BUG 修复吗?**
147
- A: 不支持,BUG 使用 `/flow-fix "BUG-456|描述"`
148
-
149
- ---
95
+ **Q: 什么时候需要重跑 `/flow:spec`?**
96
+ A: `TASKS.md` 缺失、规格有重大变更、或 manifest 与实现明显漂移时。
150
97
 
151
- **Last Updated**: 2025-12-19
98
+ **Q: 可以继续使用 `/flow-new` 吗?**
99
+ A: 不建议。`/flow-new` 仅兼容保留,主链是 `/flow:init -> /flow:spec -> /flow:dev -> /flow:verify -> /flow:release`。
@@ -46,7 +46,7 @@
46
46
  ```bash
47
47
  ⚠️ WARNING: RM-005 依赖 REQ-008 但该需求未完成
48
48
  ```
49
- **Fix**: `/flow-status REQ-008` → 确认状态 → 继续但标记风险 或 移除该依赖
49
+ **Fix**: `/flow:status REQ-008` → 确认状态 → 继续但标记风险 或 移除该依赖
50
50
 
51
51
  ---
52
52
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 问题描述
4
4
 
5
- 在执行 `/flow-dev` 时,主代理完成了代码实现,但没有同步更新 TASKS.md 中的待办事项复选框。这导致:
5
+ 在执行 `/flow:dev` 时,主代理完成了代码实现,但没有同步更新 TASKS.md 中的待办事项复选框。这导致:
6
6
 
7
7
  - ❌ TASKS.md 显示任务未完成 `[ ]`,但代码已经实现
8
8
  - ❌ 进度追踪不准确,无法知道真实进度
@@ -13,7 +13,7 @@
13
13
 
14
14
  ### 1. 强制执行标记流程
15
15
 
16
- 在 `/flow-dev` 命令文档中,已经强化了任务完成标记的要求:
16
+ 在 `/flow:dev` 命令文档中,已经强化了任务完成标记的要求:
17
17
 
18
18
  ```bash
19
19
  # 每完成一个任务后,必须立即执行
@@ -73,7 +73,7 @@ bash .claude/scripts/sync-task-marks.sh --dry-run
73
73
 
74
74
  ```bash
75
75
  # 1. 开始开发
76
- /flow-dev "REQ-123"
76
+ /flow:dev "REQ-123"
77
77
 
78
78
  # 2. Claude 完成任务 T001
79
79
  # (写代码、运行测试等)
@@ -223,7 +223,7 @@ bash .claude/scripts/sync-task-marks.sh --auto-mark
223
223
  2. **使用脚本**: 始终用脚本,不要手动编辑 TASKS.md
224
224
  3. **验证输出**: 检查脚本输出确认标记成功
225
225
  4. **定期检查**: 在开发过程中定期运行 `sync-task-marks.sh --dry-run`
226
- 5. **Exit Gate**: 在 `/flow-dev` 结束前验证所有任务已标记
226
+ 5. **Exit Gate**: 在 `/flow:dev` 结束前验证所有任务已标记
227
227
 
228
228
  ### DON'T ❌
229
229
 
@@ -333,6 +333,6 @@ bash .claude/tests/scripts/test_sync_task_marks.sh
333
333
 
334
334
  - [mark-task-complete.sh 源码](.claude/scripts/mark-task-complete.sh)
335
335
  - [sync-task-marks.sh 源码](.claude/scripts/sync-task-marks.sh)
336
- - [/flow-dev 命令文档](.claude/commands/flow-dev.md)
336
+ - [/flow:dev 命令文档](.claude/commands/flow/dev.md)
337
337
  - [TASKS_TEMPLATE.md 模板](.claude/docs/templates/TASKS_TEMPLATE.md)
338
338
  - [测试框架](.claude/tests/test-framework.sh)
@@ -146,7 +146,7 @@ LIMIT 20 OFFSET 40
146
146
 
147
147
  | | research/attempts/ | ERROR_LOG.md |
148
148
  |--|-------------------|--------------|
149
- | 阶段 | 研究阶段(Phase 0) | 执行阶段(flow-dev, flow-qa) |
149
+ | 阶段 | 研究阶段(Phase 0) | 执行阶段(flow:dev, flow:verify) |
150
150
  | 内容 | 方案尝试与放弃 | 代码错误与修复 |
151
151
  | 格式 | Markdown 文件 | 结构化错误日志 |
152
152
  | 目的 | 避免重复研究 | 避免重复错误 |
@@ -201,7 +201,7 @@ _说明: 此矩阵用于快速识别需求间的依赖关系,避免优先级
201
201
 
202
202
  ### 准入标准 (Definition of Ready)
203
203
 
204
- 一个 backlog item 准备好进入开发 (运行 /flow-init) 的标准:
204
+ 一个 backlog item 准备好进入开发 (运行 /flow:init) 的标准:
205
205
  - [ ] Description 清晰明确
206
206
  - [ ] Business Value 已明确
207
207
  - [ ] Effort 已评估
@@ -213,9 +213,9 @@ _说明: 此矩阵用于快速识别需求间的依赖关系,避免优先级
213
213
  ### 完成标准 (Definition of Done)
214
214
 
215
215
  一个 backlog item 被认为完成的标准:
216
- - [ ] 通过 /flow-prd, /flow-tech, /flow-epic, /flow-dev 流程
216
+ - [ ] 通过 /flow:init, /flow:spec, /flow:dev 流程
217
217
  - [ ] 所有 TASKS.md 中的任务完成
218
- - [ ] 通过 /flow-qa (测试 + 安全审查)
218
+ - [ ] 通过 /flow:verify (测试 + 安全审查)
219
219
  - [ ] 代码已合并到主分支
220
220
  - [ ] 文档已更新
221
221
  - [ ] 用户验收通过
@@ -162,15 +162,15 @@ No outstanding items.
162
162
  {{#ALL_RESOLVED}}
163
163
  ✅ **Clarification complete**. All critical ambiguities have been resolved.
164
164
 
165
- Recommended next command: `/flow-prd {{REQ_ID}}`
165
+ Recommended next command: `/flow:spec {{REQ_ID}}`
166
166
  {{/ALL_RESOLVED}}
167
167
 
168
168
  {{#HAS_OUTSTANDING}}
169
169
  ⚠️ **Clarification partially complete**. Some low-impact items remain.
170
170
 
171
171
  Options:
172
- 1. Proceed with `/flow-prd {{REQ_ID}}` (acceptable risk)
173
- 2. Re-run `/flow-clarify {{REQ_ID}}` after planning phase
172
+ 1. Proceed with `/flow:spec {{REQ_ID}}` (acceptable risk)
173
+ 2. Re-run `/flow:spec {{REQ_ID}} --overwrite` after planning phase
174
174
  {{/HAS_OUTSTANDING}}
175
175
 
176
176
  {{#HAS_DEFERRED}}
@@ -179,13 +179,13 @@ Options:
179
179
  - {{ITEM}}
180
180
  {{/DEFERRED_SUMMARY}}
181
181
 
182
- These will be addressed during `/flow-tech` or `/flow-epic`.
182
+ These will be addressed during `/flow:spec` task planning or `/flow:dev` implementation.
183
183
  {{/HAS_DEFERRED}}
184
184
 
185
185
  {{#NO_QUESTIONS}}
186
186
  ✅ **No critical ambiguities detected**. research.md is sufficiently specified.
187
187
 
188
- Recommended next command: `/flow-prd {{REQ_ID}}`
188
+ Recommended next command: `/flow:spec {{REQ_ID}}`
189
189
  {{/NO_QUESTIONS}}
190
190
 
191
191
  ---
@@ -12,7 +12,7 @@
12
12
  ```markdown
13
13
  ## [TIMESTAMP] E###: TITLE
14
14
 
15
- **Phase**: flow-dev / T### 或 flow-qa / 测试名
15
+ **Phase**: flow:dev / T### 或 flow:verify / 测试名
16
16
  **Error Type**: Test Failure | Build Error | Runtime Error | Type Error | Lint Error
17
17
  **Error Message**:
18
18
  \`\`\`
@@ -30,7 +30,7 @@
30
30
 
31
31
  ## [2026-01-08T10:30:00] E001: Test Failure - Email Validation
32
32
 
33
- **Phase**: flow-dev / T003
33
+ **Phase**: flow:dev / T003
34
34
  **Error Type**: Test Failure
35
35
  **Error Message**:
36
36
  ```
@@ -1,16 +1,16 @@
1
1
  # Flow-Init Execution Flow Template
2
2
 
3
- > Detailed stages for `/flow-init` requirement initialization
3
+ > Detailed stages for `/flow:init` requirement initialization
4
4
 
5
5
  <!-- ============================================================
6
6
  调用上下文声明 (Invocation Context Declaration)
7
7
  ============================================================
8
8
 
9
- 本模板由 `/flow-init` 命令通过 {TEMPLATE:flow} 引用加载。
9
+ 本模板由 `/flow:init` 命令通过 {TEMPLATE:flow} 引用加载。
10
10
 
11
11
  模板中的 {SCRIPT:xxx} 占位符引用 flow-init.md 头文件中的 scripts 定义:
12
12
  ```yaml
13
- # 来源: .claude/commands/flow-init.md 头文件
13
+ # 来源: .claude/commands/flow/init.md 头文件
14
14
  scripts:
15
15
  create: .claude/scripts/create-requirement.sh
16
16
  prereq: .claude/scripts/check-prerequisites.sh
@@ -1,107 +1,76 @@
1
- # Flow-New Orchestration Template
1
+ # Mainline Orchestration Template
2
2
 
3
- > Execution flow for `/flow-new` one-shot requirement development (v4.1)
3
+ > Canonical execution flow for requirement delivery (`/flow:init -> /flow:spec -> /flow:dev -> /flow:verify -> /flow:release`)
4
4
 
5
5
  ---
6
6
 
7
7
  ## Stage Execution Skeleton
8
8
 
9
- ### [1/6] /flow-init
10
- - 创建需求目录 + Git 分支
11
- - 研究材料收集 + `BRAINSTORM.md` 初始化
12
- - Exit Gate: `orchestration_status.status == initialized`
9
+ ### [1/5] /flow:init
10
+ - 创建需求目录 + 运行时上下文
11
+ - Exit Gate: `status in {initialized, context_packed}`
13
12
 
14
- ### [2/6] /flow-clarify (可选)
15
- - 触发条件: 需求歧义、边界冲突、验收标准不明确
16
- - 输出: `clarifications/*.md`
17
- - 若跳过: 标记 `clarify_skipped: true`
13
+ ### [2/5] /flow:spec
14
+ - 统一规格阶段(PRD/Tech/UI/Task Manifest)
15
+ - Exit Gate: `status = spec_complete` 或 `phase = planning`
18
16
 
19
- ### [3/6] /flow-spec
20
- - 统一规格阶段: PRD Tech+UI(并行) → Epic/TASKS
21
- - 支持模式: `--skip-tech` / `--skip-ui`
22
- - Exit Gate: 规格产物完整,`status = spec_complete`
17
+ ### [3/5] /flow:dev
18
+ - manifest 执行开发,支持 `--resume`
19
+ - Exit Gate: `status in {development_complete, development_in_progress}`
23
20
 
24
- ### [4/6] /flow-dev
25
- **TDD 执行模式**:
26
- ```
27
- Phase 1: 分析现有代码
28
- Phase 2: 编写测试 (Tests First)
29
-
30
- TDD CHECKPOINT → 测试必须先失败
31
-
32
- Phase 3: 实现代码
33
- Phase 4: 测试验证 → 测试必须通过
34
- ```
35
- - 输出: 实现代码 + 测试代码 + `TASKS.md` 勾选更新
21
+ ### [4/5] /flow:verify
22
+ - 快速/严格质量闸
23
+ - 严格模式输出 `report-card.json` 作为发布准入依据
36
24
 
37
- ### [5/6] /flow-quality --full
38
- **统一质量验证**:
39
- - 规格合规审查
40
- - 代码质量审查
41
- - 安全扫描与测试门禁
42
- - 输出: `SPEC_REVIEW.md`, `CODE_QUALITY_REVIEW.md`, `SECURITY_REPORT.md`
43
-
44
- ### [6/6] /flow-release
45
- - 生成 `RELEASE_PLAN.md`
46
- - 执行发布分支策略(PR/merge/squash 等)
47
- - 必要时更新 `CLAUDE.md`
25
+ ### [5/5] /flow:release
26
+ - 读取 verify 结果并完成发布收口
27
+ - 生成发布计划并清理运行时噪音
48
28
 
49
29
  ---
50
30
 
51
31
  ## Progress Display Format
52
32
 
53
- ```
54
- 🎯 CC-DevFlow 完整需求开发流程
33
+ ```text
34
+ 🎯 CC-DevFlow 主链交付
55
35
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
56
36
 
57
37
  需求: REQ-123 | 支持用户下单
58
38
 
59
- [1/6] ✅ 初始化完成
60
- [2/6] ✅ 澄清完成 (可选)
61
- [3/6] 统一规格完成
62
- [4/6] 🔄 开发执行中... (8/18 已完成)
63
- [5/6] ⏳ 等待质量验证...
64
- [6/6] ⏳ 等待发布管理...
39
+ [1/5] ✅ 初始化完成
40
+ [2/5] ✅ 规格完成
41
+ [3/5] 🔄 开发执行中... (8/18 已完成)
42
+ [4/5] 等待质量闸...
43
+ [5/5] ⏳ 等待发布...
65
44
  ```
66
45
 
67
46
  ---
68
47
 
69
48
  ## Output Structure
70
49
 
71
- ```
50
+ ```text
72
51
  devflow/requirements/${REQ_ID}/
73
- ├── BRAINSTORM.md
74
- ├── research/
75
- ├── clarifications/ # 可选
76
52
  ├── PRD.md
77
- ├── TECH_DESIGN.md # 若未跳过 tech
78
- ├── UI_PROTOTYPE.html # 若未跳过 ui 且识别到 UI 需求
53
+ ├── TECH_DESIGN.md
54
+ ├── UI_PROTOTYPE.html # 条件生成
79
55
  ├── EPIC.md
80
56
  ├── TASKS.md
81
- ├── SPEC_REVIEW.md # flow-quality --full
82
- ├── CODE_QUALITY_REVIEW.md # flow-quality --full
83
- ├── SECURITY_REPORT.md # flow-quality --full
57
+ ├── report-card.json # /flow:verify 产物
58
+ ├── SECURITY_REPORT.md
84
59
  └── RELEASE_PLAN.md
85
60
  ```
86
61
 
87
62
  ---
88
63
 
89
- ## Status Tracking
64
+ ## Status Tracking (Suggested)
90
65
 
91
- **orchestration_status.json 推荐字段**:
92
66
  ```json
93
67
  {
94
- "status": "dev_complete",
95
- "phase": "execution",
68
+ "status": "development_in_progress",
69
+ "phase": "development",
96
70
  "initialized": true,
97
- "clarify_complete": true,
98
71
  "spec_complete": true,
99
- "dev_complete": true,
72
+ "development_complete": false,
100
73
  "quality_complete": false,
101
74
  "release_complete": false
102
75
  }
103
76
  ```
104
-
105
- ---
106
-
107
- **Last Updated**: 2026-02-07
@@ -124,7 +124,7 @@ Generated: {GENERATED_AT}
124
124
  1. **Manual Research Workflow**:
125
125
  ```bash
126
126
  # 1. Run flow-init (generates tasks.json)
127
- /flow-init "REQ-123|Feature Name"
127
+ /flow:init "REQ-123|Feature Name"
128
128
 
129
129
  # 2. Research each task
130
130
  # - Check existing codebase
@@ -145,7 +145,7 @@ Generated: {GENERATED_AT}
145
145
  2. **Direct Editing**:
146
146
  - Copy this template to `research/research.md`
147
147
  - Fill in decisions based on your research
148
- - Run validation script before proceeding to /flow-prd
148
+ - Run validation script before proceeding to /flow:spec
149
149
 
150
150
  ---
151
151
 
@@ -271,6 +271,6 @@ Generated: {GENERATED_AT}
271
271
  **Maintained By**: CC-DevFlow Team
272
272
  **Last Updated**: 2025-01-26
273
273
  **Related Docs**:
274
- - [flow-init.md](../../commands/flow-init.md) - 需求初始化流程
274
+ - [flow/init.md](../../commands/flow/init.md) - 需求初始化流程
275
275
  - [validate-research.sh](../../scripts/validate-research.sh) - 验证脚本
276
276
  - [flow-init-optimization-plan.md](../../../flow-init-optimization-plan.md) - 优化方案
@@ -177,9 +177,9 @@ Prompt: "Generate ARCHITECTURE.md with 4 diagrams..."
177
177
 
178
178
  下一步建议:
179
179
  1. 审查路线图
180
- 2. 开始首个需求: /flow-init "REQ-XXX|{RM-title}"
180
+ 2. 开始首个需求: /flow:init "REQ-XXX|{RM-title}"
181
181
  3. 定期更新: /core-roadmap --regenerate
182
- 4. 监控进度: /flow-status --all
182
+ 4. 监控进度: /flow:status --all
183
183
  ```
184
184
 
185
185
  ---
@@ -234,7 +234,7 @@ _填充规则:_
234
234
  - Feature: 功能简短标题
235
235
  - Derived From: 来源需求 ID (REQ-001) 或其他来源 (Tech Stack, User Feedback)
236
236
  - Status: Planned | In Progress | Completed | Blocked | Cancelled
237
- - Mapped REQ: 关联的正式需求 ID(初始为 "-",运行 /flow-init 后填充)
237
+ - Mapped REQ: 关联的正式需求 ID(初始为 "-",运行 /flow:init 后填充)
238
238
  - Progress: 完成百分比 (0%, 20%, 80%, 100%)
239
239
 
240
240
  _说明: 此表用于追踪路线图项到正式需求的映射,以及进度同步_
@@ -295,7 +295,7 @@ _填充规则:_
295
295
  - **RM-ID**: Roadmap Item ID,路线图意向项标识符(如 RM-001)
296
296
  - **REQ-ID**: Requirement ID,正式需求标识符(如 REQ-010)
297
297
  - **Derived From**: 来源,标注该意向项从哪个已有需求或来源延伸而来
298
- - **Mapped REQ**: 映射需求,当意向项通过 /flow-init 正式创建为需求后,记录其 REQ-ID
298
+ - **Mapped REQ**: 映射需求,当意向项通过 /flow:init 正式创建为需求后,记录其 REQ-ID
299
299
  - **Feature Cluster**: 功能集群,将相关的意向项分组便于理解和管理
300
300
  - **Milestone**: 里程碑,一个季度内要完成的一组功能集群
301
301
  - **Velocity**: 速度,团队完成需求的平均速率(天数/需求)
@@ -1225,17 +1225,17 @@ module.exports = {
1225
1225
  - 如需新增变体,确保与现有变体一致
1226
1226
 
1227
1227
  3. **生成 UI 原型时**:
1228
- - `/flow-ui` 命令会自动引用本指南
1228
+ - `/flow:spec` 阶段会自动引用本指南
1229
1229
  - 确保原型中的所有样式符合本指南
1230
1230
 
1231
1231
  4. **前端开发时**:
1232
- - `/flow-dev` 命令会自动引用本指南
1232
+ - `/flow:dev` 命令会自动引用本指南
1233
1233
  - 所有组件实现必须遵循本指南的样式定义
1234
1234
 
1235
1235
  ### 更新本指南
1236
1236
 
1237
1237
  - **何时更新**: 新增组件、调整设计系统、发现不一致
1238
- - **如何更新**: 使用 `/flow-style --update` 命令
1238
+ - **如何更新**: 使用 `/core-style --update` 命令
1239
1239
  - **版本控制**: 每次更新增加版本号,记录变更内容
1240
1240
 
1241
1241
  ---
@@ -1254,7 +1254,7 @@ Found keywords: 0 matches for "用户界面|前端|Web页面|UI"
1254
1254
  Recommendation:
1255
1255
  1. This appears to be a backend-only requirement
1256
1256
  2. Skipping UI prototype generation
1257
- 3. Continuing to /flow-epic
1257
+ 3. Continuing within /flow:spec
1258
1258
 
1259
1259
  Action: EXIT with status "ui_skipped"
1260
1260
  ```
@@ -1310,17 +1310,17 @@ Recovery:
1310
1310
 
1311
1311
  ### Workflow Position:
1312
1312
  ```text
1313
- /flow-prd → PRD.md 生成完成
1313
+ /flow:spec → PRD.md 生成完成
1314
1314
 
1315
- /flow-ui → 检测UI需求 → 生成UI_PROTOTYPE.html ← YOU ARE HERE
1315
+ /flow:spec → 检测UI需求 → 生成UI_PROTOTYPE.html ← YOU ARE HERE
1316
1316
 
1317
- /flow-epic → 参考UI原型生成EPIC.md和TASKS.md
1317
+ /flow:spec → 参考UI原型生成EPIC.md和TASKS.md
1318
1318
 
1319
- /flow-dev → 基于UI原型实现代码
1319
+ /flow:dev → 基于UI原型实现代码
1320
1320
  ```
1321
1321
 
1322
1322
  ### Conditional Trigger Logic:
1323
- 在 `/flow-new` 或 `/flow-prd` 完成后自动执行:
1323
+ 在 `/flow:spec` 执行期间自动触发:
1324
1324
 
1325
1325
  ```bash
1326
1326
  # 检测是否需要UI原型
@@ -1328,11 +1328,10 @@ has_ui_keywords=$(grep -iE "用户界面|前端|Web页面|UI|界面设计|交互
1328
1328
  has_frontend_stack=$(ls -d src/components 2>/dev/null || ls package.json 2>/dev/null)
1329
1329
 
1330
1330
  if [[ -n "$has_ui_keywords" || -n "$has_frontend_stack" ]]; then
1331
- echo "✅ UI requirements detected, triggering /flow-ui"
1332
- /flow-ui "$REQ_ID"
1331
+ echo "✅ UI requirements detected, continue UI prototype generation in /flow:spec"
1333
1332
  else
1334
1333
  echo "ℹ️ No UI requirements detected, skipping UI prototype"
1335
- # 直接进入 /flow-epic
1334
+ # 继续 /flow:spec 后续任务规划
1336
1335
  fi
1337
1336
  ```
1338
1337