cc-devflow 4.1.5 → 4.2.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 (112) hide show
  1. package/.claude/CLAUDE.md +87 -1091
  2. package/.claude/commands/core/architecture.md +32 -2
  3. package/.claude/commands/core/guidelines.md +27 -2
  4. package/.claude/commands/core/roadmap.md +33 -4
  5. package/.claude/commands/core/style.md +53 -263
  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 +113 -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 +58 -60
  61. package/.claude/skills/workflow/flow-dev/context.jsonl +4 -8
  62. package/.claude/skills/workflow/flow-init/SKILL.md +46 -144
  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 +40 -511
  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 +72 -0
  77. package/README.md +96 -69
  78. package/README.zh-CN.md +95 -67
  79. package/bin/cc-devflow-cli.js +154 -0
  80. package/bin/harness.js +22 -0
  81. package/docs/commands/README.md +34 -38
  82. package/docs/commands/README.zh-CN.md +34 -36
  83. package/docs/commands/core-roadmap.md +2 -2
  84. package/docs/commands/core-roadmap.zh-CN.md +2 -2
  85. package/docs/commands/core-style.md +29 -381
  86. package/docs/commands/core-style.zh-CN.md +29 -381
  87. package/docs/commands/flow-init.md +10 -10
  88. package/docs/commands/flow-init.zh-CN.md +11 -11
  89. package/docs/commands/flow-new.md +25 -260
  90. package/docs/commands/flow-new.zh-CN.md +26 -257
  91. package/docs/guides/getting-started.md +16 -15
  92. package/docs/guides/getting-started.zh-CN.md +10 -12
  93. package/lib/compiler/__tests__/manifest.test.js +156 -0
  94. package/lib/compiler/__tests__/parser.test.js +21 -0
  95. package/lib/compiler/index.js +17 -1
  96. package/lib/compiler/manifest.js +68 -6
  97. package/lib/compiler/parser.js +5 -0
  98. package/lib/harness/CLAUDE.md +21 -0
  99. package/lib/harness/cli.js +208 -0
  100. package/lib/harness/index.js +16 -0
  101. package/lib/harness/operations/dispatch.js +285 -0
  102. package/lib/harness/operations/init.js +48 -0
  103. package/lib/harness/operations/janitor.js +74 -0
  104. package/lib/harness/operations/pack.js +100 -0
  105. package/lib/harness/operations/plan.js +29 -0
  106. package/lib/harness/operations/release.js +83 -0
  107. package/lib/harness/operations/resume.js +44 -0
  108. package/lib/harness/operations/verify.js +163 -0
  109. package/lib/harness/planner.js +141 -0
  110. package/lib/harness/schemas.js +108 -0
  111. package/lib/harness/store.js +240 -0
  112. package/package.json +9 -1
@@ -1,274 +1,39 @@
1
- # `/flow-new` - Start New Requirement Development
1
+ # `/flow-new` - Deprecated Alias
2
2
 
3
3
  [中文文档](./flow-new.zh-CN.md) | [English](./flow-new.md)
4
4
 
5
- ---
5
+ `/flow-new` is retained only for backward compatibility and should not be used for new workflows.
6
6
 
7
- ## 📋 Overview
7
+ ## Canonical Mainline
8
8
 
9
- One-command launch of complete requirement development flow, from PRD generation to code delivery automated workflow.
10
-
11
- ## 🎯 Syntax
12
-
13
- ```bash
14
- /flow-new "REQ-ID|Feature Title|Plan URLs"
15
- ```
16
-
17
- ## 📖 Parameters
18
-
19
- | Parameter | Description | Required | Example | Notes |
20
- |-----------|-------------|----------|---------|-------|
21
- | **REQ-ID** | Requirement number | ✅ | `REQ-123` | Must be unique, format REQ-NNN |
22
- | **Feature Title** | Brief description | ✅ | `User Authentication Feature` | Used for Git branch naming and document titles |
23
- | **Plan URLs** | External reference links | ❌ | `https://docs.example.com/auth` | Optional, separate multiple with `\|` |
24
-
25
- ## 🎬 Use Cases
26
-
27
- ### ✅ Recommended Scenarios
28
-
29
- | Scenario | Description |
30
- |----------|-------------|
31
- | Launch brand new feature development | New feature from scratch |
32
- | First-time requirement document creation | Need to generate PRD, EPIC, TASKS documents |
33
- | Long-term project launch | Projects lasting > 1 week |
34
-
35
- ### ❌ Not Recommended Scenarios
36
-
37
- | Scenario | Alternative |
38
- |----------|------------|
39
- | Resume interrupted development | Use `/flow-restart "REQ-123"` |
40
- | Fix bugs | Use `/flow-fix "BUG-001\|Description"` |
41
- | Only initialize directory structure | Use `/flow-init "REQ-123\|Title"` |
42
- | Quick prototype validation | Use `/flow-ideate "Idea description"` |
43
-
44
- ## 🔄 Execution Flow
45
-
46
- ```text
47
- /flow-new "REQ-123|User Authentication|https://docs.example.com/auth"
48
-
49
- Stage 1: Initialize (flow-init)
50
- ├─ Create requirement directory structure
51
- ├─ Load roadmap and architecture context (if exists)
52
- ├─ Create Git branch feature/REQ-123-user-auth
53
- └─ Initialize orchestration_status.json
54
-
55
- Stage 2: PRD Generation (prd-writer agent)
56
- ├─ Analyze external reference links
57
- ├─ Research existing codebase
58
- ├─ Generate PRD.md using PRD_TEMPLATE
59
- └─ Record to EXECUTION_LOG.md
60
-
61
- Stage 3: UI Prototype Generation (ui-designer agent, conditional)
62
- ├─ Detect if PRD contains UI requirements
63
- ├─ If UI requirements exist, generate UI_PROTOTYPE.html
64
- ├─ Responsive design (320px/768px/1024px)
65
- └─ Complete interaction states and real images
66
-
67
- Stage 4: Technical Design (tech-architect agent)
68
- ├─ Analyze PRD + existing codebase
69
- ├─ Design technical solution (avoid over-engineering)
70
- ├─ Generate TECH_DESIGN.md
71
- └─ Anti-Tech-Creep enforcement
72
-
73
- Stage 4.5: Requirement Quality Check (checklist-agent, optional) ⭐ NEW
74
- ├─ Generate type-specific checklists (ux, api, security, etc.)
75
- ├─ Validate 5 quality dimensions
76
- ├─ Calculate completion percentage
77
- └─ 80% threshold gate before EPIC
78
-
79
- Stage 5: EPIC & TASKS Generation (planner agent)
80
- ├─ Analyze PRD + TECH_DESIGN
81
- ├─ Generate EPIC.md using EPIC_TEMPLATE
82
- ├─ Generate TASKS.md using TASKS_TEMPLATE
83
- └─ Tasks ordered in TDD sequence (Phase 1-5)
84
-
85
- Stage 6: Development (dev-implementer agent + main agent execution)
86
- ├─ dev-implementer generates IMPLEMENTATION_PLAN.md
87
- ├─ Main agent executes code implementation
88
- ├─ Follow TDD: tests first, then implementation
89
- └─ Real-time update TASKS.md progress
90
-
91
- Stage 7: QA (qa-tester agent)
92
- ├─ Generate TEST_PLAN.md
93
- ├─ Execute tests (unit tests, integration tests)
94
- ├─ Generate TEST_REPORT.md
95
- └─ Security scan (security-reviewer agent)
96
-
97
- Stage 8: Release (release-manager agent)
98
- ├─ Generate RELEASE_PLAN.md
99
- ├─ Check release readiness
100
- ├─ Create Pull Request
101
- └─ Create Git Tag (optional)
102
- ```
103
-
104
- ## 💡 Examples
105
-
106
- ### Example 1: Basic Usage
107
-
108
- ```bash
109
- /flow-new "REQ-001|User Login Feature"
110
- ```
111
-
112
- **Output**:
113
- ```
114
- devflow/requirements/REQ-001/
115
- ├── orchestration_status.json
116
- ├── EXECUTION_LOG.md
117
- ├── PRD.md
118
- ├── EPIC.md
119
- ├── TASKS.md
120
- └── ... (other documents)
121
- ```
122
-
123
- **Git Branch**: `feature/REQ-001-user-login`
124
-
125
- ### Example 2: With External Reference
126
-
127
- ```bash
128
- /flow-new "REQ-002|Payment Integration|https://stripe.com/docs/api"
129
- ```
130
-
131
- **Effect**:
132
- - PRD will reference Stripe API documentation
133
- - Technical design will consider Stripe integration solution
134
- - Task breakdown will include Stripe SDK integration tasks
135
-
136
- ### Example 3: Multiple Reference Links
137
-
138
- ```bash
139
- /flow-new "REQ-003|Data Analytics|https://doc1.com|https://doc2.com"
140
- ```
141
-
142
- **Effect**:
143
- - System will fetch content from both external links
144
- - PRD will reference both documents comprehensively
145
- - `research/` directory will save fetched content
146
-
147
- ## 📂 Output File Structure
148
-
149
- After executing `/flow-new`, complete requirement directory is generated:
150
-
151
- ```
152
- devflow/requirements/REQ-XXX/
153
- ├── orchestration_status.json # State management (stage, progress, timestamps)
154
- ├── EXECUTION_LOG.md # Complete audit trail
155
- ├── PRD.md # Product Requirements Document
156
- ├── UI_PROTOTYPE.html # UI Prototype (conditional generation)
157
- ├── TECH_DESIGN.md # Technical Design Document
158
- ├── checklists/ # Requirement quality checklists ⭐ NEW
159
- │ ├── ux.md # UX checklist
160
- │ ├── api.md # API checklist
161
- │ └── security.md # Security checklist
162
- ├── EPIC.md # Epic planning and breakdown
163
- ├── TASKS.md # Single unified task list
164
- ├── tasks/ # Task execution artifacts
165
- │ ├── TASK_001.completed
166
- │ ├── TASK_002.completed
167
- │ └── IMPLEMENTATION_PLAN.md
168
- ├── research/ # External research materials (MCP fetched)
169
- ├── TEST_PLAN.md # QA testing strategy
170
- ├── TEST_REPORT.md # QA testing results
171
- ├── SECURITY_PLAN.md # Security review plan
172
- ├── SECURITY_REPORT.md # Security scan results
173
- └── RELEASE_PLAN.md # Release checklist
174
- ```
175
-
176
- ## 🔗 Related Commands
177
-
178
- - [`/flow-init`](./flow-init.md) - Only initialize requirement structure (no subsequent stages)
179
- - [`/flow-checklist`](../../.claude/commands/flow-checklist.md) - Requirement quality check (80% gate before EPIC) ⭐ NEW
180
- - [`/flow-restart`](./flow-restart.md) - Resume interrupted development
181
- - [`/flow-status`](./flow-status.md) - View requirement development progress
182
- - [`/flow-verify`](./flow-verify.md) - Verify document consistency
183
- - [`/flow-fix`](./flow-fix.md) - Bug fix workflow (alternative to flow-new)
184
-
185
- ## ⚙️ Configuration Options
186
-
187
- ### Environment Variables
9
+ Use the explicit 5-stage chain:
188
10
 
189
11
  ```bash
190
- # Quality gate configuration
191
- export MIN_TEST_COVERAGE=80 # Minimum test coverage threshold
192
- export STRICT_TYPE_CHECKING=true # Enforce strict TypeScript checking
193
-
194
- # Flow control
195
- export FLOW_AUTO_APPROVE=false # Whether quality gates require manual approval
196
- export FLOW_SKIP_BACKGROUND=false # Whether to skip background process startup
197
-
198
- # MCP integration
199
- export WEBFETCH_TIMEOUT=30 # External link fetch timeout (seconds)
200
- export ALLOWED_DOMAINS="" # Allowed domains whitelist
12
+ /flow:init "REQ-123|Feature Title|https://plan.example.com"
13
+ /flow:spec "REQ-123"
14
+ /flow:dev "REQ-123"
15
+ /flow:verify "REQ-123" --strict
16
+ /flow:release "REQ-123"
201
17
  ```
202
18
 
203
- ### Hooks Configuration
204
-
205
- Hooks in `.claude/settings.json` will be triggered during flow-new execution:
206
-
207
- - **PreToolUse**: Block non-compliant operations (e.g., violating TDD order)
208
- - **PostToolUse**: Auto-record file changes to EXECUTION_LOG.md
209
- - **Constitution Compliance**: Enforce Constitution v2.0.0 at every stage
210
-
211
- ## 🚨 Common Issues
212
-
213
- ### Q1: What if flow-new gets interrupted halfway?
19
+ ## Why `/flow-new` Is Deprecated
214
20
 
215
- **A**: Use `/flow-restart "REQ-123"` to auto-detect restart point and continue execution.
21
+ - Hidden one-shot behavior made failure recovery hard.
22
+ - Stage boundaries were unclear for long-running agent execution.
23
+ - Quality gate and resume behavior are now standardized in `/flow:verify` and `/flow:dev --resume`.
216
24
 
217
- ### Q2: How to skip certain stages (e.g., UI prototype)?
218
-
219
- **A**: UI prototype is conditionally triggered. If PRD doesn't contain UI requirements, it will be automatically skipped. Other stages don't support skipping yet.
220
-
221
- ### Q3: What if external link fetch fails?
222
-
223
- **A**:
224
- 1. Check network connection
225
- 2. Check `ALLOWED_DOMAINS` configuration
226
- 3. Increase `WEBFETCH_TIMEOUT` timeout
227
- 4. Manually save reference content to `research/` directory
228
-
229
- ### Q4: Generated PRD doesn't meet expectations?
230
-
231
- **A**:
232
- 1. Provide more detailed external reference links
233
- 2. Manually edit PRD.md after execution
234
- 3. Use `/flow-restart "REQ-123" --from=prd` to regenerate
235
-
236
- ### Q5: Task order doesn't meet TDD requirements?
237
-
238
- **A**: This is a bug. TASKS.md must follow Phase 1-5 TDD order:
239
- - Phase 1: Test infrastructure
240
- - Phase 2: Unit test writing
241
- - Phase 3: Integration test writing
242
- - **Phase 3.5: TEST VERIFICATION CHECKPOINT** (blocking point)
243
- - Phase 4: Feature implementation
244
- - Phase 5: Documentation and cleanup
245
-
246
- If order is incorrect, please report a bug.
247
-
248
- ## 📊 Performance Estimates
249
-
250
- | Requirement Complexity | Estimated Time | File Count | Token Usage |
251
- |------------------------|----------------|------------|-------------|
252
- | Simple (CRUD) | 5-10 minutes | 10-15 files | ~20K tokens |
253
- | Medium (API Integration) | 15-30 minutes | 15-20 files | ~50K tokens |
254
- | Complex (Multi-module) | 30-60 minutes | 20-30 files | ~100K tokens |
255
-
256
- **Note**: Actual time depends on codebase size, number of external links, agent response speed, etc.
257
-
258
- ## 🔍 Debug Mode
259
-
260
- Enable verbose logging to view execution details:
261
-
262
- ```bash
263
- export FLOW_DEBUG=1
264
- /flow-new "REQ-123|Test Feature"
265
- ```
25
+ ## Legacy to Current Mapping
266
26
 
267
- Log file location: `.claude/logs/flow-*.log`
27
+ | Legacy | Current |
28
+ |--------|---------|
29
+ | `/flow-new` | `/flow:init -> /flow:spec -> /flow:dev -> /flow:verify -> /flow:release` |
30
+ | `/flow-restart` | `/flow:dev --resume` or `/flow:status` guided recovery |
31
+ | `/flow-quality` | `/flow:verify` |
268
32
 
269
- ## 📚 Deep Reading
33
+ ## Related Commands
270
34
 
271
- - [Execution Model Details](../architecture/execution-model.md)
272
- - [Sub-Agent Workflow](../architecture/agent-workflow.md)
273
- - [Quality Gates System](../architecture/quality-gates.md)
274
- - [Constitution v2.0.0](../architecture/constitution.md)
35
+ - [`/flow:init`](./flow-init.md)
36
+ - [`/flow:spec`](../../.claude/commands/flow/spec.md)
37
+ - [`/flow:dev`](../../.claude/commands/flow/dev.md)
38
+ - [`/flow:verify`](../../.claude/commands/flow/verify.md)
39
+ - [`/flow:release`](../../.claude/commands/flow/release.md)
@@ -1,270 +1,39 @@
1
- # `/flow-new` - 启动新需求开发
1
+ # `/flow-new` - 已废弃别名
2
2
 
3
- ## 📋 概述
3
+ [English](./flow-new.md) | [中文文档](./flow-new.zh-CN.md)
4
4
 
5
- 一键启动完整的需求开发流程,从 PRD 生成到代码交付的完整自动化工作流。
5
+ `/flow-new` 仅为兼容保留,不再作为主流程入口。
6
6
 
7
- ## 🎯 语法
7
+ ## 当前主链
8
8
 
9
- ```bash
10
- /flow-new "REQ-ID|功能标题|计划URLs"
11
- ```
12
-
13
- ## 📖 参数详解
14
-
15
- | 参数 | 说明 | 必填 | 示例 | 备注 |
16
- |------|------|------|------|------|
17
- | **REQ-ID** | 需求编号 | ✅ | `REQ-123` | 必须唯一,格式为 REQ-NNN |
18
- | **功能标题** | 简短功能描述 | ✅ | `用户认证功能` | 用于 Git 分支命名和文档标题 |
19
- | **计划URLs** | 外部参考链接 | ❌ | `https://docs.example.com/auth` | 可选,多个 URL 用 `\|` 分隔 |
20
-
21
- ## 🎬 使用场景
22
-
23
- ### ✅ 推荐场景
24
-
25
- | 场景 | 说明 |
26
- |------|------|
27
- | 启动全新功能开发 | 从零开始的新功能需求 |
28
- | 首次创建需求文档 | 需要生成 PRD、EPIC、TASKS 等完整文档 |
29
- | 长期项目启动 | 持续时间超过 1 周的项目 |
30
-
31
- ### ❌ 不推荐场景
32
-
33
- | 场景 | 替代方案 |
34
- |------|----------|
35
- | 恢复中断的开发 | 使用 `/flow-restart "REQ-123"` |
36
- | 修复 Bug | 使用 `/flow-fix "BUG-001\|描述"` |
37
- | 仅初始化目录结构 | 使用 `/flow-init "REQ-123\|标题"` |
38
- | 快速原型验证 | 使用 `/flow-ideate "想法描述"` |
39
-
40
- ## 🔄 执行流程
41
-
42
- ```text
43
- /flow-new "REQ-123|用户认证|https://docs.example.com/auth"
44
-
45
- Stage 1: 初始化 (flow-init)
46
- ├─ 创建需求目录结构
47
- ├─ 加载路线图和架构上下文(如果存在)
48
- ├─ 创建 Git 分支 feature/REQ-123-user-auth
49
- └─ 初始化 orchestration_status.json
50
-
51
- Stage 2: PRD 生成 (prd-writer 代理)
52
- ├─ 分析外部参考链接
53
- ├─ 研究现有代码库
54
- ├─ 使用 PRD_TEMPLATE 生成 PRD.md
55
- └─ 记录到 EXECUTION_LOG.md
56
-
57
- Stage 3: UI 原型生成 (ui-designer 代理,条件触发)
58
- ├─ 检测 PRD 中是否有 UI 需求
59
- ├─ 如有 UI 需求,生成 UI_PROTOTYPE.html
60
- ├─ 响应式设计(320px/768px/1024px)
61
- └─ 完整交互状态和真实图片
62
-
63
- Stage 4: 技术设计 (tech-architect 代理)
64
- ├─ 分析 PRD + 现有代码库
65
- ├─ 设计技术方案(避免过度设计)
66
- ├─ 生成 TECH_DESIGN.md
67
- └─ Anti-Tech-Creep 强制执行
68
-
69
- Stage 4.5: 需求质量检查 (checklist-agent,可选) ⭐ 新增
70
- ├─ 生成类型特定检查清单 (ux, api, security 等)
71
- ├─ 验证 5 个质量维度
72
- ├─ 计算完成百分比
73
- └─ 80% 门禁阈值(进入 EPIC 前)
74
-
75
- Stage 5: EPIC & TASKS 生成 (planner 代理)
76
- ├─ 分析 PRD + TECH_DESIGN
77
- ├─ 使用 EPIC_TEMPLATE 生成 EPIC.md
78
- ├─ 使用 TASKS_TEMPLATE 生成 TASKS.md
79
- └─ 任务按 TDD 顺序排列(Phase 1-5)
80
-
81
- Stage 6: 开发 (dev-implementer 代理 + 主代理执行)
82
- ├─ dev-implementer 生成 IMPLEMENTATION_PLAN.md
83
- ├─ 主代理执行代码实现
84
- ├─ 遵循 TDD:先测试后实现
85
- └─ 实时更新 TASKS.md 进度
86
-
87
- Stage 7: QA (qa-tester 代理)
88
- ├─ 生成 TEST_PLAN.md
89
- ├─ 执行测试(单元测试、集成测试)
90
- ├─ 生成 TEST_REPORT.md
91
- └─ 安全扫描(security-reviewer 代理)
92
-
93
- Stage 8: Release (release-manager 代理)
94
- ├─ 生成 RELEASE_PLAN.md
95
- ├─ 检查发布准备度
96
- ├─ 创建 Pull Request
97
- └─ 创建 Git Tag(可选)
98
- ```
99
-
100
- ## 💡 示例
101
-
102
- ### 示例 1: 基础用法
103
-
104
- ```bash
105
- /flow-new "REQ-001|用户登录功能"
106
- ```
107
-
108
- **输出**:
109
- ```
110
- devflow/requirements/REQ-001/
111
- ├── orchestration_status.json
112
- ├── EXECUTION_LOG.md
113
- ├── PRD.md
114
- ├── EPIC.md
115
- ├── TASKS.md
116
- └── ... (其他文档)
117
- ```
118
-
119
- **Git 分支**: `feature/REQ-001-user-login`
120
-
121
- ### 示例 2: 带外部参考
122
-
123
- ```bash
124
- /flow-new "REQ-002|支付集成|https://stripe.com/docs/api"
125
- ```
126
-
127
- **效果**:
128
- - PRD 中会引用 Stripe API 文档
129
- - 技术设计会考虑 Stripe 集成方案
130
- - 任务分解会包含 Stripe SDK 集成任务
131
-
132
- ### 示例 3: 多个参考链接
133
-
134
- ```bash
135
- /flow-new "REQ-003|数据分析|https://doc1.com|https://doc2.com"
136
- ```
137
-
138
- **效果**:
139
- - 系统会抓取两个外部链接内容
140
- - PRD 中会综合参考两份文档
141
- - `research/` 目录会保存抓取的内容
142
-
143
- ## 📂 输出文件结构
144
-
145
- 执行 `/flow-new` 后会生成完整的需求目录:
146
-
147
- ```
148
- devflow/requirements/REQ-XXX/
149
- ├── orchestration_status.json # 状态管理(阶段、进度、时间戳)
150
- ├── EXECUTION_LOG.md # 完整审计轨迹
151
- ├── PRD.md # 产品需求文档
152
- ├── UI_PROTOTYPE.html # UI 原型(条件生成)
153
- ├── TECH_DESIGN.md # 技术设计文档
154
- ├── checklists/ # 需求质量检查清单 ⭐ 新增
155
- │ ├── ux.md # UX 检查清单
156
- │ ├── api.md # API 检查清单
157
- │ └── security.md # Security 检查清单
158
- ├── EPIC.md # Epic 规划和分解
159
- ├── TASKS.md # 单一统一任务列表
160
- ├── tasks/ # 任务执行产物
161
- │ ├── TASK_001.completed
162
- │ ├── TASK_002.completed
163
- │ └── IMPLEMENTATION_PLAN.md
164
- ├── research/ # 外部研究材料(MCP 抓取)
165
- ├── TEST_PLAN.md # QA 测试策略
166
- ├── TEST_REPORT.md # QA 测试结果
167
- ├── SECURITY_PLAN.md # 安全审查计划
168
- ├── SECURITY_REPORT.md # 安全扫描结果
169
- └── RELEASE_PLAN.md # 发布 checklist
170
- ```
171
-
172
- ## 🔗 相关命令
173
-
174
- - [`/flow-init`](./flow-init.md) - 仅初始化需求结构(不执行后续阶段)
175
- - [`/flow-checklist`](../../.claude/commands/flow-checklist.md) - 需求质量检查(EPIC 前 80% 门禁)⭐ 新增
176
- - [`/flow-restart`](./flow-restart.md) - 恢复中断的开发
177
- - [`/flow-status`](./flow-status.md) - 查看需求开发进度
178
- - [`/flow-verify`](./flow-verify.md) - 验证文档一致性
179
- - [`/flow-fix`](./flow-fix.md) - Bug 修复工作流(替代 flow-new)
180
-
181
- ## ⚙️ 配置选项
182
-
183
- ### 环境变量
9
+ 请使用显式的 5 阶段主链:
184
10
 
185
11
  ```bash
186
- # 质量闸配置
187
- export MIN_TEST_COVERAGE=80 # 最小测试覆盖率
188
- export STRICT_TYPE_CHECKING=true # 严格类型检查
189
-
190
- # 流程控制
191
- export FLOW_AUTO_APPROVE=false # 质量闸是否需要手动批准
192
- export FLOW_SKIP_BACKGROUND=false # 是否跳过后台进程启动
193
-
194
- # MCP 集成
195
- export WEBFETCH_TIMEOUT=30 # 外部链接抓取超时(秒)
196
- export ALLOWED_DOMAINS="" # 允许抓取的域名白名单
12
+ /flow:init "REQ-123|功能标题|https://plan.example.com"
13
+ /flow:spec "REQ-123"
14
+ /flow:dev "REQ-123"
15
+ /flow:verify "REQ-123" --strict
16
+ /flow:release "REQ-123"
197
17
  ```
198
18
 
199
- ### Hooks 配置
200
-
201
- `.claude/settings.json` 中的 Hooks 会在 flow-new 执行过程中触发:
202
-
203
- - **PreToolUse**: 阻止不合规操作(如违反 TDD 顺序)
204
- - **PostToolUse**: 自动记录文件变更到 EXECUTION_LOG.md
205
- - **Constitution Compliance**: 每个阶段强制执行 Constitution v2.0.0
206
-
207
- ## 🚨 常见问题
208
-
209
- ### Q1: flow-new 执行到一半中断了怎么办?
210
-
211
- **A**: 使用 `/flow-restart "REQ-123"` 自动检测重启点并继续执行。
19
+ ## 废弃原因
212
20
 
213
- ### Q2: 如何跳过某些阶段(如 UI 原型)?
21
+ - 一键黑盒执行不利于中断恢复。
22
+ - 长时运行时阶段边界不清晰。
23
+ - 质量闸与恢复策略已统一到 `/flow:verify` 与 `/flow:dev --resume`。
214
24
 
215
- **A**: UI 原型是条件触发的。如果 PRD 中没有 UI 需求,会自动跳过。其他阶段暂不支持跳过。
216
-
217
- ### Q3: 外部链接抓取失败怎么办?
218
-
219
- **A**:
220
- 1. 检查网络连接
221
- 2. 检查 `ALLOWED_DOMAINS` 配置
222
- 3. 增加 `WEBFETCH_TIMEOUT` 超时时间
223
- 4. 手动将参考内容保存到 `research/` 目录
224
-
225
- ### Q4: 生成的 PRD 不符合预期?
226
-
227
- **A**:
228
- 1. 提供更详细的外部参考链接
229
- 2. 执行后手动编辑 PRD.md
230
- 3. 使用 `/flow-restart "REQ-123" --from=prd` 重新生成
231
-
232
- ### Q5: 任务顺序不符合 TDD 要求?
233
-
234
- **A**: 这是 Bug。TASKS.md 必须按照 Phase 1-5 TDD 顺序排列:
235
- - Phase 1: 测试基础设施
236
- - Phase 2: 单元测试编写
237
- - Phase 3: 集成测试编写
238
- - **Phase 3.5: TEST VERIFICATION CHECKPOINT** (阻塞点)
239
- - Phase 4: 功能实现
240
- - Phase 5: 文档和清理
241
-
242
- 如果发现顺序错误,请报告 Bug。
243
-
244
- ## 📊 性能预估
245
-
246
- | 需求复杂度 | 预估执行时间 | 生成文件数 | Token 消耗 |
247
- |-----------|-------------|-----------|-----------|
248
- | 简单(CRUD) | 5-10 分钟 | 10-15 个 | ~20K tokens |
249
- | 中等(API 集成) | 15-30 分钟 | 15-20 个 | ~50K tokens |
250
- | 复杂(多模块) | 30-60 分钟 | 20-30 个 | ~100K tokens |
251
-
252
- **注**: 实际时间取决于代码库大小、外部链接数量、代理响应速度等因素。
253
-
254
- ## 🔍 调试模式
255
-
256
- 启用详细日志查看执行细节:
257
-
258
- ```bash
259
- export FLOW_DEBUG=1
260
- /flow-new "REQ-123|测试功能"
261
- ```
25
+ ## 旧命令映射
262
26
 
263
- 日志文件位置:`.claude/logs/flow-*.log`
27
+ | 旧命令 | 新命令 |
28
+ |--------|--------|
29
+ | `/flow-new` | `/flow:init -> /flow:spec -> /flow:dev -> /flow:verify -> /flow:release` |
30
+ | `/flow-restart` | `/flow:dev --resume` 或结合 `/flow:status` 恢复 |
31
+ | `/flow-quality` | `/flow:verify` |
264
32
 
265
- ## 📚 深度阅读
33
+ ## 相关命令
266
34
 
267
- - [执行模型详解](../architecture/execution-model.md)
268
- - [子代理工作流](../architecture/agent-workflow.md)
269
- - [质量闸系统](../architecture/quality-gates.md)
270
- - [Constitution v2.0.0](../architecture/constitution.md)
35
+ - [`/flow:init`](./flow-init.zh-CN.md)
36
+ - [`/flow:spec`](../../.claude/commands/flow/spec.md)
37
+ - [`/flow:dev`](../../.claude/commands/flow/dev.md)
38
+ - [`/flow:verify`](../../.claude/commands/flow/verify.md)
39
+ - [`/flow:release`](../../.claude/commands/flow/release.md)
@@ -48,32 +48,33 @@ This script will check:
48
48
 
49
49
  ## 🎯 Your First Requirement
50
50
 
51
- ### Step 1: Start Development Flow
51
+ ### Step 1: Run the Mainline Flow
52
52
 
53
53
  ```bash
54
- /flow-new "REQ-001|User Authentication|https://docs.example.com/auth"
54
+ /flow:init "REQ-001|User Authentication|https://docs.example.com/auth"
55
+ /flow:spec "REQ-001"
56
+ /flow:dev "REQ-001"
57
+ /flow:verify "REQ-001" --strict
58
+ /flow:release "REQ-001"
55
59
  ```
56
60
 
57
61
  This will:
58
- 1. Initialize requirement structure
59
- 2. Generate PRD
60
- 3. Generate UI prototype (if needed)
61
- 4. Create technical design
62
- 5. Generate EPIC and TASKS
63
- 6. Execute development
64
- 7. Run QA tests
65
- 8. Prepare release
62
+ 1. Initialize requirement context package
63
+ 2. Generate executable task-manifest
64
+ 3. Dispatch task execution with checkpoints
65
+ 4. Run quick/strict quality gates
66
+ 5. Generate release note and cleanup runtime logs
66
67
 
67
68
  ### Step 2: Check Progress
68
69
 
69
70
  ```bash
70
- /flow-status REQ-001
71
+ /flow:status REQ-001
71
72
  ```
72
73
 
73
74
  ### Step 3: Resume If Interrupted
74
75
 
75
76
  ```bash
76
- /flow-restart "REQ-001"
77
+ /flow:dev "REQ-001" --resume
77
78
  ```
78
79
 
79
80
  ## 🛠️ Core Scripts
@@ -184,8 +185,8 @@ VERBOSE=true bash .claude/tests/run-all-tests.sh --scripts
184
185
 
185
186
  ## 💡 Tips
186
187
 
187
- 1. **Always check progress** with `/flow-status` before continuing work
188
- 2. **Use `/flow-verify`** to check document consistency
188
+ 1. **Always check progress** with `/flow:status` before continuing work
189
+ 2. **Use `/flow:verify`** to check quality gates and consistency
189
190
  3. **Enable debug mode** if you encounter issues: `export FLOW_DEBUG=1`
190
191
  4. **Read the Constitution** to understand quality standards
191
192
 
@@ -200,5 +201,5 @@ VERBOSE=true bash .claude/tests/run-all-tests.sh --scripts
200
201
  **Ready to start? Run your first command:**
201
202
 
202
203
  ```bash
203
- /flow-new "REQ-001|My First Feature"
204
+ /flow:init "REQ-001|My First Feature"
204
205
  ```