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.
- package/.claude/CLAUDE.md +87 -1091
- package/.claude/commands/core/architecture.md +32 -2
- package/.claude/commands/core/guidelines.md +27 -2
- package/.claude/commands/core/roadmap.md +33 -4
- package/.claude/commands/core/style.md +53 -263
- package/.claude/commands/flow/CLAUDE.md +28 -0
- package/.claude/commands/flow/archive.md +2 -2
- package/.claude/commands/flow/checklist.md +9 -251
- package/.claude/commands/flow/clarify.md +9 -127
- package/.claude/commands/flow/constitution.md +1 -1
- package/.claude/commands/flow/context.md +1 -1
- package/.claude/commands/flow/dev.md +19 -395
- package/.claude/commands/flow/ideate.md +13 -13
- package/.claude/commands/flow/init.md +19 -30
- package/.claude/commands/flow/new.md +12 -268
- package/.claude/commands/flow/quality.md +10 -153
- package/.claude/commands/flow/release.md +18 -81
- package/.claude/commands/flow/restart.md +15 -16
- package/.claude/commands/flow/spec.md +14 -164
- package/.claude/commands/flow/status.md +12 -12
- package/.claude/commands/flow/update.md +4 -4
- package/.claude/commands/flow/upgrade.md +6 -6
- package/.claude/commands/flow/verify.md +19 -78
- package/.claude/commands/flow/workspace.md +1 -1
- package/.claude/docs/guides/INIT_TROUBLESHOOTING.md +7 -7
- package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +44 -96
- package/.claude/docs/guides/ROADMAP_TROUBLESHOOTING.md +1 -1
- package/.claude/docs/guides/TASK_COMPLETION_MARKING.md +5 -5
- package/.claude/docs/templates/ATTEMPT_TEMPLATE.md +1 -1
- package/.claude/docs/templates/BACKLOG_TEMPLATE.md +3 -3
- package/.claude/docs/templates/CLARIFICATION_REPORT_TEMPLATE.md +5 -5
- package/.claude/docs/templates/ERROR_LOG_TEMPLATE.md +2 -2
- package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +3 -3
- package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +33 -64
- package/.claude/docs/templates/RESEARCH_TEMPLATE.md +3 -3
- package/.claude/docs/templates/ROADMAP_DIALOGUE_TEMPLATE.md +2 -2
- package/.claude/docs/templates/ROADMAP_TEMPLATE.md +2 -2
- package/.claude/docs/templates/STYLE_TEMPLATE.md +3 -3
- package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +8 -9
- package/.claude/guides/workflow-guides/flow-orchestrator.md +31 -265
- package/.claude/hooks/CLAUDE.md +1 -1
- package/.claude/hooks/checklist-gate.js +4 -4
- package/.claude/hooks/inject-agent-context.ts +2 -2
- package/.claude/scripts/calculate-checklist-completion.sh +2 -2
- package/.claude/scripts/check-prerequisites.sh +2 -2
- package/.claude/scripts/checklist-errors.sh +4 -4
- package/.claude/scripts/flow-quality-full.sh +5 -5
- package/.claude/scripts/flow-quality-quick.sh +4 -4
- package/.claude/scripts/flow-workspace-init.sh +2 -2
- package/.claude/scripts/generate-clarification-report.sh +4 -4
- package/.claude/scripts/recover-workflow.sh +70 -73
- package/.claude/scripts/run-quality-gates.sh +1 -1
- package/.claude/scripts/setup-epic.sh +2 -2
- package/.claude/scripts/setup-ralph-loop.sh +2 -2
- package/.claude/scripts/validate-research.sh +1 -1
- package/.claude/scripts/verify-setup.sh +1 -1
- package/.claude/skills/cc-devflow-orchestrator/SKILL.md +113 -108
- package/.claude/skills/workflow/CLAUDE.md +24 -0
- package/.claude/skills/workflow/flow-dev/CLAUDE.md +14 -76
- package/.claude/skills/workflow/flow-dev/SKILL.md +58 -60
- package/.claude/skills/workflow/flow-dev/context.jsonl +4 -8
- package/.claude/skills/workflow/flow-init/SKILL.md +46 -144
- package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +1 -1
- package/.claude/skills/workflow/flow-init/context.jsonl +3 -3
- package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +1 -1
- package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +1 -1
- package/.claude/skills/workflow/flow-release/SKILL.md +23 -56
- package/.claude/skills/workflow/flow-release/context.jsonl +5 -7
- package/.claude/skills/workflow/flow-spec/CLAUDE.md +15 -101
- package/.claude/skills/workflow/flow-spec/SKILL.md +40 -511
- package/.claude/skills/workflow/flow-spec/context.jsonl +5 -7
- package/.claude/skills/workflow/flow-verify/CLAUDE.md +10 -0
- package/.claude/skills/workflow/flow-verify/SKILL.md +53 -0
- package/.claude/skills/workflow/flow-verify/context.jsonl +5 -0
- package/.claude/skills/workflow.yaml +72 -267
- package/CHANGELOG.md +72 -0
- package/README.md +96 -69
- package/README.zh-CN.md +95 -67
- package/bin/cc-devflow-cli.js +154 -0
- package/bin/harness.js +22 -0
- package/docs/commands/README.md +34 -38
- package/docs/commands/README.zh-CN.md +34 -36
- package/docs/commands/core-roadmap.md +2 -2
- package/docs/commands/core-roadmap.zh-CN.md +2 -2
- package/docs/commands/core-style.md +29 -381
- package/docs/commands/core-style.zh-CN.md +29 -381
- package/docs/commands/flow-init.md +10 -10
- package/docs/commands/flow-init.zh-CN.md +11 -11
- package/docs/commands/flow-new.md +25 -260
- package/docs/commands/flow-new.zh-CN.md +26 -257
- package/docs/guides/getting-started.md +16 -15
- package/docs/guides/getting-started.zh-CN.md +10 -12
- package/lib/compiler/__tests__/manifest.test.js +156 -0
- package/lib/compiler/__tests__/parser.test.js +21 -0
- package/lib/compiler/index.js +17 -1
- package/lib/compiler/manifest.js +68 -6
- package/lib/compiler/parser.js +5 -0
- package/lib/harness/CLAUDE.md +21 -0
- package/lib/harness/cli.js +208 -0
- package/lib/harness/index.js +16 -0
- package/lib/harness/operations/dispatch.js +285 -0
- package/lib/harness/operations/init.js +48 -0
- package/lib/harness/operations/janitor.js +74 -0
- package/lib/harness/operations/pack.js +100 -0
- package/lib/harness/operations/plan.js +29 -0
- package/lib/harness/operations/release.js +83 -0
- package/lib/harness/operations/resume.js +44 -0
- package/lib/harness/operations/verify.js +163 -0
- package/lib/harness/planner.js +141 -0
- package/lib/harness/schemas.js +108 -0
- package/lib/harness/store.js +240 -0
- package/package.json +9 -1
|
@@ -1,282 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-orchestrator-guide
|
|
3
|
-
description: Standard Operating Procedure for main agent when executing /flow
|
|
3
|
+
description: Standard Operating Procedure for main agent when executing canonical /flow:* delivery chain.
|
|
4
4
|
type: workflow-guide
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# 需求开发流程标准作业程序(主链版)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## 核心原则 (遵循 Claude Code 最佳实践)
|
|
12
|
-
|
|
13
|
-
### 主 Agent 职责
|
|
14
|
-
- **完整上下文管理**: 主 Agent 拥有项目全貌,负责所有代码实施
|
|
15
|
-
- **Sub-agent 协调**: 调用研究型 sub-agents 收集专业信息和制定计划
|
|
16
|
-
- **最终实施**: 基于所有研究报告和计划,主 Agent 直接执行代码修改
|
|
17
|
-
|
|
18
|
-
### Sub-agent 定位
|
|
19
|
-
- **研究员角色**: 仅提供研究报告、分析文档、实施计划
|
|
20
|
-
- **无代码执行**: 不直接修改项目文件,只输出 Markdown 文档
|
|
21
|
-
- **专业分工**: 各自在专业领域提供深度分析和建议
|
|
22
|
-
|
|
23
|
-
### 工作流原则
|
|
24
|
-
1. **顺序执行**: 避免并行代码修改,确保一致性
|
|
25
|
-
2. **上下文保持**: 主 Agent 保持完整项目上下文
|
|
26
|
-
3. **计划先行**: 充分规划后再执行实施
|
|
27
|
-
4. **质量保证**: 每个阶段都有相应的质量检查
|
|
28
|
-
5. **避免过度设计**: 在需求研究与规划分解阶段,坚持最小可行实现与核心价值,避免提前引入复杂架构、抽象或不必要的扩展点
|
|
29
|
-
|
|
30
|
-
## Rules Integration
|
|
31
|
-
You MUST follow these rules during orchestration:
|
|
32
|
-
|
|
33
|
-
0. **Constitution** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/project-constitution.md):
|
|
34
|
-
- **Project Constitution**: Follow all constitutional principles without exception
|
|
35
|
-
- **Quality Gates**: Enforce all quality gate requirements
|
|
36
|
-
- **Architecture Constraints**: Adhere to architectural consistency rules
|
|
37
|
-
- **Security Principles**: Apply security-first approach to all operations
|
|
38
|
-
|
|
39
|
-
1. **Standard Patterns**:
|
|
40
|
-
- Apply Fail Fast principle: validate inputs immediately
|
|
41
|
-
- Use Clear Errors with structured error messages
|
|
42
|
-
- Maintain Minimal Output approach in user communication
|
|
43
|
-
- Follow Trust System principle for sub-agent delegation
|
|
44
|
-
|
|
45
|
-
2. **DevFlow Patterns**:
|
|
46
|
-
- Enforce REQ-ID format validation: REQ-\d+
|
|
47
|
-
- Use standard branch naming: feature/${reqId}-${slug(BRANCH_TITLE_EN)} (模型意译生成,禁止拼音/音译)
|
|
48
|
-
- Apply commit message format: feat(${reqId}): ${taskTitle}
|
|
49
|
-
- Maintain complete document chain: PRD → EPIC → TASKS
|
|
50
|
-
|
|
51
|
-
3. **Agent Coordination**:
|
|
52
|
-
- Use file locks for concurrent access prevention
|
|
53
|
-
- Update status in LOG.md after each sub-agent call
|
|
54
|
-
- Implement proper error propagation between agents
|
|
55
|
-
- Follow the defined sub-agent call sequence
|
|
56
|
-
|
|
57
|
-
4. **Branch Operations** (${DEVFLOW_CLAUDE_DIR:-.claude}/guides/technical-guides/git-github-guide.md):
|
|
58
|
-
- Verify clean working directory before branch creation
|
|
59
|
-
- Use conventional commit messages with Co-authored-by
|
|
60
|
-
- Enforce quality gates before any push operations
|
|
61
|
-
- Clean up branches after successful merge
|
|
62
|
-
|
|
63
|
-
5. **GitHub Operations** (${DEVFLOW_CLAUDE_DIR:-.claude}/guides/technical-guides/git-github-guide.md):
|
|
64
|
-
- Check authentication status before PR operations
|
|
65
|
-
- Verify repository is not a template before modifications
|
|
66
|
-
- Use structured PR descriptions with links to documentation
|
|
67
|
-
- Handle permission errors gracefully
|
|
68
|
-
|
|
69
|
-
6. **Test Execution**:
|
|
70
|
-
- Delegate all testing to qa-tester sub-agent
|
|
71
|
-
- Capture verbose test output for audit trail
|
|
72
|
-
- Enforce minimum coverage thresholds
|
|
73
|
-
- Never mock external services in tests
|
|
74
|
-
|
|
75
|
-
7. **DateTime Handling**:
|
|
76
|
-
- Use real system time in ISO 8601 UTC format
|
|
77
|
-
- Include timestamps in all YAML frontmatter
|
|
78
|
-
- Handle timezone-aware operations correctly
|
|
79
|
-
- Support cross-platform datetime operations
|
|
80
|
-
|
|
81
|
-
8. **MCP Integration**:
|
|
82
|
-
- Use WebFetch tool for all external content retrieval
|
|
83
|
-
- Apply URL validation rules for security
|
|
84
|
-
- Implement retry logic with exponential backoff
|
|
85
|
-
- Cache content appropriately to reduce API calls
|
|
86
|
-
|
|
87
|
-
Steps:
|
|
88
|
-
0) Constitutional Validation
|
|
89
|
-
- Read and internalize ${DEVFLOW_CLAUDE_DIR:-.claude}/rules/project-constitution.md requirements
|
|
90
|
-
- Validate all inputs against constitutional principles
|
|
91
|
-
- Ensure current environment meets constitutional standards
|
|
92
|
-
- Apply constitutional constraints to the entire workflow
|
|
93
|
-
|
|
94
|
-
1) Context intake
|
|
95
|
-
- If planSources include URLs, first use MCP server "docs-web" (or WebFetch) to fetch HTML/MD/PDF and write them under devflow/requirements/${reqId}/research/${reqId}_*.md.
|
|
96
|
-
- Read local .claude/docs/plan/*.md and CLAUDE.md to learn codebase constraints.
|
|
97
|
-
|
|
98
|
-
2) Git branch
|
|
99
|
-
- git switch -c feature/${reqId}-${slug(BRANCH_TITLE_EN)}
|
|
100
|
-
|
|
101
|
-
## 标准作业流程
|
|
102
|
-
|
|
103
|
-
### 阶段1: 需求研究和分析
|
|
104
|
-
1. **外部资料研究**
|
|
105
|
-
```bash
|
|
106
|
-
Task: prd-writer "Analyze ${planSources} and generate comprehensive PRD for ${reqId}: ${title}"
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
- prd-writer 输出: `devflow/requirements/${reqId}/PRD.md`
|
|
110
|
-
- 主 Agent 读取并理解需求
|
|
111
|
-
|
|
112
|
-
2. **规划和分解**
|
|
113
|
-
```bash
|
|
114
|
-
Task: planner "Based on PRD, create Epic and detailed task breakdown for ${reqId}"
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
- planner 输出: `EPIC.md` 和 `tasks/TASK_*.md`
|
|
118
|
-
- 主 Agent 审查规划合理性
|
|
119
|
-
|
|
120
|
-
### 阶段2: 实施准备
|
|
121
|
-
3. **一致性初步验证**(计划阶段)
|
|
122
|
-
```bash
|
|
123
|
-
Task: consistency-checker "Verify document consistency and requirement traceability for ${reqId}"
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
- consistency-checker 输出: `CONSISTENCY_ANALYSIS.md`
|
|
127
|
-
- 包含: 文档一致性检查、需求可追溯性验证、潜在冲突识别
|
|
128
|
-
- **触发条件**: PRD 和 EPIC 生成完成后自动执行
|
|
129
|
-
|
|
130
|
-
4. **测试计划**(代码实现前)
|
|
131
|
-
```bash
|
|
132
|
-
Task: qa-tester "Create comprehensive test plan for ${reqId} based on EPIC and tasks"
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
- qa-tester 输出: `TEST_PLAN.md`
|
|
136
|
-
- 包含: 测试策略、用例设计、覆盖率要求
|
|
137
|
-
- **触发词**: 包含 "test plan" 的提示词
|
|
138
|
-
|
|
139
|
-
5. **安全评估计划**(代码实现前)
|
|
140
|
-
```bash
|
|
141
|
-
Task: security-reviewer "Create comprehensive security plan for ${reqId} based on requirements"
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
- security-reviewer 输出: `SECURITY_PLAN.md`
|
|
145
|
-
- 包含: 安全检查点、风险评估、缓解措施
|
|
146
|
-
- **触发词**: 包含 "security plan" 的提示词
|
|
147
|
-
|
|
148
|
-
### 阶段3: 主 Agent 代码实施
|
|
149
|
-
5. **代码实施**
|
|
150
|
-
- 主 Agent 基于详细的 TASK 文档直接编写代码
|
|
151
|
-
- 遵循现有项目模式和约定
|
|
152
|
-
- 实施所有 TASK 的功能要求
|
|
153
|
-
|
|
154
|
-
### 阶段4: 质量验证(代码实现后)
|
|
155
|
-
6. **测试执行和报告**
|
|
156
|
-
```bash
|
|
157
|
-
Task: qa-tester "Analyze implemented code and generate comprehensive test report for ${reqId}"
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
- 主 Agent 基于 TEST_PLAN.md 编写和执行测试
|
|
161
|
-
- qa-tester 分析测试结果,输出: `TEST_REPORT.md`
|
|
162
|
-
- 包含: 覆盖率分析、测试结果、质量评估
|
|
163
|
-
- **触发词**: 包含 "test report" 的提示词
|
|
164
|
-
|
|
165
|
-
7. **安全检查和报告**
|
|
166
|
-
```bash
|
|
167
|
-
Task: security-reviewer "Analyze implemented code and generate comprehensive security report for ${reqId}"
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
- security-reviewer 分析实际代码,输出: `SECURITY_REPORT.md`
|
|
171
|
-
- 包含: 漏洞扫描、安全风险、修复建议
|
|
172
|
-
- **触发词**: 包含 "security report" 的提示词
|
|
173
|
-
|
|
174
|
-
8. **最终一致性验证**(实施完成后)
|
|
175
|
-
```bash
|
|
176
|
-
Task: consistency-checker "Perform comprehensive consistency verification for completed ${reqId}"
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
- consistency-checker 输出: `FINAL_CONSISTENCY_REPORT.md`
|
|
180
|
-
- 包含: 实现与规格一致性、测试覆盖完整性、文档同步状态
|
|
181
|
-
- **触发条件**: 代码实现和质量报告完成后执行
|
|
182
|
-
|
|
183
|
-
9. **发布准备**
|
|
184
|
-
```bash
|
|
185
|
-
Task: release-manager "Create release plan for ${reqId} based on quality reports"
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
- release-manager 输出: `RELEASE_PLAN.md`
|
|
189
|
-
- 包含: 发布流程、回滚计划、部署策略
|
|
190
|
-
|
|
191
|
-
### 阶段5: 发布执行
|
|
192
|
-
10. **质量闸检查**
|
|
193
|
-
- **宪法合规检查**: 验证所有代码和流程符合项目宪法
|
|
194
|
-
- **质量闸验证**: 确保通过所有质量闸要求
|
|
195
|
-
- **架构一致性**: 验证架构约束得到遵循
|
|
196
|
-
- **安全原则**: 确保安全原则得到执行
|
|
197
|
-
- 修复 TEST_REPORT.md 和 SECURITY_REPORT.md 中发现的问题
|
|
198
|
-
|
|
199
|
-
11. **发布和合并**
|
|
200
|
-
- 主 Agent 基于 RELEASE_PLAN.md 创建 PR
|
|
201
|
-
- 执行最终质量闸检查
|
|
202
|
-
- 处理代码合并流程
|
|
203
|
-
|
|
204
|
-
### 阶段6: 总结和归档
|
|
205
|
-
12. **文档更新**
|
|
206
|
-
- 更新项目文档和说明
|
|
207
|
-
- 记录实施过程和决策
|
|
208
|
-
- 记录需求完成状态
|
|
209
|
-
|
|
210
|
-
13. **执行日志**
|
|
211
|
-
- 在 LOG.md 中记录完整执行过程
|
|
212
|
-
- 包含时间线、决策点、问题解决
|
|
9
|
+
当用户执行需求交付时,主 Agent 按显式主链推进:
|
|
213
10
|
|
|
214
11
|
```text
|
|
215
|
-
|
|
216
|
-
├── PRD.md # 产品需求文档
|
|
217
|
-
├── EPIC.md # Epic 规划
|
|
218
|
-
├── tasks/ # 任务分解
|
|
219
|
-
│ ├── TASK_001.md
|
|
220
|
-
│ ├── TASK_002.md
|
|
221
|
-
│ └── ...
|
|
222
|
-
├── research/ # 外部研究材料
|
|
223
|
-
│ ├── ${reqId}_plan_1.md
|
|
224
|
-
│ └── ${reqId}_plan_2.md
|
|
225
|
-
├── TEST_REPORT.md # 测试报告
|
|
226
|
-
└── LOG.md # 执行日志
|
|
12
|
+
/flow:init -> /flow:spec -> /flow:dev -> /flow:verify -> /flow:release
|
|
227
13
|
```
|
|
228
14
|
|
|
229
|
-
## Agent
|
|
15
|
+
## 主 Agent 职责
|
|
16
|
+
- 维护全局上下文与最终实现。
|
|
17
|
+
- 仅把研究/规划/审查任务分发给对应子代理。
|
|
18
|
+
- 在每个阶段结束后写入状态与审计日志。
|
|
230
19
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
"reqId": "${reqId}",
|
|
237
|
-
"currentPhase": "development",
|
|
238
|
-
"startTime": "2024-01-15T10:30:00Z",
|
|
239
|
-
"phaseStatus": {
|
|
240
|
-
"research": "completed",
|
|
241
|
-
"prd": "completed",
|
|
242
|
-
"planning": "completed",
|
|
243
|
-
"development": "in_progress",
|
|
244
|
-
"testing": "pending",
|
|
245
|
-
"security": "pending",
|
|
246
|
-
"release": "pending"
|
|
247
|
-
},
|
|
248
|
-
"activeAgents": [
|
|
249
|
-
{"agent": "qa-tester", "phase": "test_analysis", "status": "running", "startTime": "..."},
|
|
250
|
-
{"agent": "security-reviewer", "phase": "security_analysis", "status": "running", "startTime": "..."}
|
|
251
|
-
],
|
|
252
|
-
"completedTasks": ["TASK_003"],
|
|
253
|
-
"failedTasks": [],
|
|
254
|
-
"nextActions": ["wait_for_TASK_001", "wait_for_TASK_002"]
|
|
255
|
-
}
|
|
256
|
-
```
|
|
20
|
+
## 阶段作业
|
|
21
|
+
|
|
22
|
+
### 1) 初始化 `/flow:init`
|
|
23
|
+
- 创建需求目录与运行时上下文。
|
|
24
|
+
- 写入初始 `orchestration_status.json`。
|
|
257
25
|
|
|
258
|
-
###
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
2. **Sequential Launch**: Start agents one by one based on dependencies
|
|
262
|
-
3. **Monitor**: Check agent completion via file system
|
|
263
|
-
4. **Quality Check**: Validate each agent's output before proceeding
|
|
264
|
-
5. **Main Agent Execution**: Execute code implementation based on all plans
|
|
26
|
+
### 2) 规格与任务 `/flow:spec`
|
|
27
|
+
- 统一完成 PRD、技术方案、UI 约束(按模式可裁剪)。
|
|
28
|
+
- 产出可执行 `TASKS.md`,进入 `spec_complete`。
|
|
265
29
|
|
|
266
|
-
###
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
- Update status file with failure details
|
|
270
|
-
- Provide recovery options
|
|
30
|
+
### 3) 开发执行 `/flow:dev`
|
|
31
|
+
- 按 task manifest 执行并更新进度。
|
|
32
|
+
- 失败任务通过 `--resume` 增量恢复。
|
|
271
33
|
|
|
272
|
-
###
|
|
273
|
-
-
|
|
274
|
-
- `
|
|
275
|
-
- `dev_status.json` - Development phase specifics
|
|
276
|
-
- Individual task completion markers in tasks/ directory
|
|
34
|
+
### 4) 质量闸 `/flow:verify`
|
|
35
|
+
- 快速模式用于日常检查。
|
|
36
|
+
- `--strict` 作为发布前唯一准入门禁。
|
|
277
37
|
|
|
278
|
-
|
|
38
|
+
### 5) 发布收口 `/flow:release`
|
|
39
|
+
- 仅在 verify 通过后创建发布产物。
|
|
40
|
+
- 收尾清理 runtime/worktree 噪音。
|
|
279
41
|
|
|
280
|
-
##
|
|
42
|
+
## 失败恢复原则
|
|
43
|
+
- 不回退整条链,优先从失败阶段重试。
|
|
44
|
+
- 优先命令:`/flow:status`、`/flow:dev --resume`、`/flow:verify --strict`。
|
|
281
45
|
|
|
282
|
-
|
|
46
|
+
## 约束
|
|
47
|
+
- 必须遵循项目宪法与质量门禁。
|
|
48
|
+
- 禁止把旧链路命令(如 `/flow-new`)作为主流程推荐。
|
package/.claude/hooks/CLAUDE.md
CHANGED
|
@@ -86,7 +86,7 @@ Hook 检测到 Task 工具调用
|
|
|
86
86
|
| prd-writer | flow-spec | prd-writer.jsonl |
|
|
87
87
|
| tech-architect | flow-spec | tech-architect.jsonl |
|
|
88
88
|
| planner | flow-spec | planner.jsonl |
|
|
89
|
-
| qa-tester | flow-
|
|
89
|
+
| qa-tester | flow-verify | qa-tester.jsonl |
|
|
90
90
|
|
|
91
91
|
## ralph-loop.ts (v4.7 Team 模式)
|
|
92
92
|
|
|
@@ -228,7 +228,7 @@ function logGateSkip(reqDir, completion, threshold, reason) {
|
|
|
228
228
|
**Completion**: ${completion.percentage}%
|
|
229
229
|
**Threshold**: ${threshold}%
|
|
230
230
|
**Reason**: ${reason}
|
|
231
|
-
**Command**: /flow
|
|
231
|
+
**Command**: /flow:spec --skip-gate --reason "${reason}"
|
|
232
232
|
`;
|
|
233
233
|
|
|
234
234
|
try {
|
|
@@ -252,7 +252,7 @@ function outputText(result) {
|
|
|
252
252
|
console.log('❌ Checklist Gate: NO_CHECKLISTS');
|
|
253
253
|
console.log(' No checklist files found.');
|
|
254
254
|
console.log('');
|
|
255
|
-
console.log(' Run /flow
|
|
255
|
+
console.log(' Run /flow:verify --strict first.');
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -273,7 +273,7 @@ function outputText(result) {
|
|
|
273
273
|
console.log('');
|
|
274
274
|
console.log(' To continue:');
|
|
275
275
|
console.log(' 1. Review and complete checklist items');
|
|
276
|
-
console.log(' 2. Run /flow
|
|
276
|
+
console.log(' 2. Run /flow:verify --strict to re-check progress');
|
|
277
277
|
console.log(' 3. Or use --skip-gate --reason "your reason" to bypass');
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -382,7 +382,7 @@ function main() {
|
|
|
382
382
|
},
|
|
383
383
|
message: passed
|
|
384
384
|
? `Checklist completion ${completion.percentage}% >= ${threshold}% threshold`
|
|
385
|
-
: `Checklist completion ${completion.percentage}% < ${threshold}% threshold. Run /flow
|
|
385
|
+
: `Checklist completion ${completion.percentage}% < ${threshold}% threshold. Run /flow:verify --strict to review.`
|
|
386
386
|
};
|
|
387
387
|
|
|
388
388
|
if (options.json) {
|
|
@@ -50,8 +50,8 @@ const AGENT_SKILL_MAP: Record<string, string> = {
|
|
|
50
50
|
'ui-designer': 'flow-spec',
|
|
51
51
|
'planner': 'flow-spec',
|
|
52
52
|
'dev-implementer': 'flow-dev',
|
|
53
|
-
'qa-tester': 'flow-
|
|
54
|
-
'security-reviewer': 'flow-
|
|
53
|
+
'qa-tester': 'flow-verify',
|
|
54
|
+
'security-reviewer': 'flow-verify',
|
|
55
55
|
'release-manager': 'flow-release',
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -152,7 +152,7 @@ if [[ ! -d "$CHECKLISTS_DIR" ]]; then
|
|
|
152
152
|
echo "ERROR: NO_CHECKLISTS" >&2
|
|
153
153
|
echo "Checklists directory not found: $CHECKLISTS_DIR" >&2
|
|
154
154
|
echo "" >&2
|
|
155
|
-
echo "Run /flow
|
|
155
|
+
echo "Run /flow:verify --strict first." >&2
|
|
156
156
|
fi
|
|
157
157
|
exit 1
|
|
158
158
|
fi
|
|
@@ -171,7 +171,7 @@ if [[ ${#CHECKLIST_FILES[@]} -eq 0 ]]; then
|
|
|
171
171
|
echo "ERROR: NO_CHECKLISTS" >&2
|
|
172
172
|
echo "No checklist files found in $CHECKLISTS_DIR" >&2
|
|
173
173
|
echo "" >&2
|
|
174
|
-
echo "Run /flow
|
|
174
|
+
echo "Run /flow:verify --strict first." >&2
|
|
175
175
|
fi
|
|
176
176
|
exit 1
|
|
177
177
|
fi
|
|
@@ -126,7 +126,7 @@ fi
|
|
|
126
126
|
# Validate required directories and files
|
|
127
127
|
if [[ ! -d "$REQ_DIR" ]]; then
|
|
128
128
|
echo "ERROR: Requirement directory not found: $REQ_DIR" >&2
|
|
129
|
-
echo "Run /flow
|
|
129
|
+
echo "Run /flow:init first to create the requirement structure." >&2
|
|
130
130
|
exit 1
|
|
131
131
|
fi
|
|
132
132
|
|
|
@@ -229,4 +229,4 @@ else
|
|
|
229
229
|
check_file "$ANALYSIS_FILE" "ANALYSIS.md"
|
|
230
230
|
check_file "$PLAN_FILE" "PLAN.md"
|
|
231
231
|
fi
|
|
232
|
-
fi
|
|
232
|
+
fi
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# ============================================================================
|
|
3
3
|
# checklist-errors.sh
|
|
4
4
|
# ============================================================================
|
|
5
|
-
# Error codes and messages for
|
|
5
|
+
# Error codes and messages for checklist gate and related hooks
|
|
6
6
|
#
|
|
7
7
|
# Usage: source this file in scripts that need checklist error handling
|
|
8
8
|
#
|
|
@@ -51,7 +51,7 @@ print_checklist_error() {
|
|
|
51
51
|
echo "ERROR: $code" >&2
|
|
52
52
|
echo "PRD.md not found in requirement directory." >&2
|
|
53
53
|
echo "" >&2
|
|
54
|
-
echo "Run /flow
|
|
54
|
+
echo "Run /flow:spec first." >&2
|
|
55
55
|
;;
|
|
56
56
|
"$ERR_INVALID_TYPE")
|
|
57
57
|
echo "ERROR: $code" >&2
|
|
@@ -63,7 +63,7 @@ print_checklist_error() {
|
|
|
63
63
|
echo "ERROR: $code" >&2
|
|
64
64
|
echo "No checklists found in checklists/ directory." >&2
|
|
65
65
|
echo "" >&2
|
|
66
|
-
echo "Run /flow
|
|
66
|
+
echo "Run /flow:verify --strict first." >&2
|
|
67
67
|
;;
|
|
68
68
|
"$ERR_ITEM_NOT_FOUND")
|
|
69
69
|
echo "WARNING: $code" >&2
|
|
@@ -73,7 +73,7 @@ print_checklist_error() {
|
|
|
73
73
|
echo "ERROR: $code" >&2
|
|
74
74
|
echo "Checklist completion $extra" >&2
|
|
75
75
|
echo "" >&2
|
|
76
|
-
echo "Run /flow
|
|
76
|
+
echo "Run /flow:verify --strict to review incomplete items." >&2
|
|
77
77
|
echo "Or use --skip-gate --reason \"your reason\" to bypass." >&2
|
|
78
78
|
;;
|
|
79
79
|
"$ERR_SKIP_REASON_REQUIRED")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# [INPUT]: 依赖 run-quality-gates.sh, spec-reviewer, code-quality-reviewer, security-reviewer
|
|
3
3
|
# [OUTPUT]: 完整质量验证结果和报告
|
|
4
|
-
# [POS]: scripts 的完整质量验证脚本,被 /flow
|
|
4
|
+
# [POS]: scripts 的完整质量验证脚本,被 /flow:verify --strict 调用
|
|
5
5
|
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
6
|
|
|
7
7
|
set -e
|
|
@@ -72,7 +72,7 @@ echo " Output: $REQ_DIR/SPEC_REVIEW.md"
|
|
|
72
72
|
cat > "$REQ_DIR/SPEC_REVIEW.md" << EOF
|
|
73
73
|
# Spec Compliance Review
|
|
74
74
|
|
|
75
|
-
> Generated by /flow
|
|
75
|
+
> Generated by /flow:verify --strict
|
|
76
76
|
|
|
77
77
|
## Summary
|
|
78
78
|
|
|
@@ -103,7 +103,7 @@ echo " Output: $REQ_DIR/CODE_QUALITY_REVIEW.md"
|
|
|
103
103
|
cat > "$REQ_DIR/CODE_QUALITY_REVIEW.md" << EOF
|
|
104
104
|
# Code Quality Review
|
|
105
105
|
|
|
106
|
-
> Generated by /flow
|
|
106
|
+
> Generated by /flow:verify --strict
|
|
107
107
|
|
|
108
108
|
## Summary
|
|
109
109
|
|
|
@@ -139,7 +139,7 @@ fi
|
|
|
139
139
|
cat > "$REQ_DIR/SECURITY_REPORT.md" << EOF
|
|
140
140
|
# Security Report
|
|
141
141
|
|
|
142
|
-
> Generated by /flow
|
|
142
|
+
> Generated by /flow:verify --strict
|
|
143
143
|
|
|
144
144
|
## Summary
|
|
145
145
|
|
|
@@ -167,7 +167,7 @@ echo "--------------------"
|
|
|
167
167
|
cat > "$REQ_DIR/TEST_REPORT.md" << EOF
|
|
168
168
|
# Test Report
|
|
169
169
|
|
|
170
|
-
> Generated by /flow
|
|
170
|
+
> Generated by /flow:verify --strict
|
|
171
171
|
|
|
172
172
|
## Summary
|
|
173
173
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# [INPUT]: 依赖 run-quality-gates.sh
|
|
3
3
|
# [OUTPUT]: 快速质量验证结果
|
|
4
|
-
# [POS]: scripts 的快速质量验证脚本,被 /flow
|
|
4
|
+
# [POS]: scripts 的快速质量验证脚本,被 /flow:verify 调用
|
|
5
5
|
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
6
|
|
|
7
7
|
set -e
|
|
@@ -54,7 +54,7 @@ if [[ -n "$REQ_DIR" && -d "$REQ_DIR" ]]; then
|
|
|
54
54
|
cat > "$REQ_DIR/TEST_REPORT.md" << EOF
|
|
55
55
|
# Test Report
|
|
56
56
|
|
|
57
|
-
> Generated by /flow
|
|
57
|
+
> Generated by /flow:verify (quick mode)
|
|
58
58
|
|
|
59
59
|
## Summary
|
|
60
60
|
|
|
@@ -76,7 +76,7 @@ EOF
|
|
|
76
76
|
cat > "$REQ_DIR/SECURITY_REPORT.md" << EOF
|
|
77
77
|
# Security Report
|
|
78
78
|
|
|
79
|
-
> Generated by /flow
|
|
79
|
+
> Generated by /flow:verify (quick mode)
|
|
80
80
|
|
|
81
81
|
## Summary
|
|
82
82
|
|
|
@@ -87,7 +87,7 @@ EOF
|
|
|
87
87
|
## Checks Performed
|
|
88
88
|
|
|
89
89
|
- [x] Baseline quality gate security checks
|
|
90
|
-
- [ ] Deep security audit (use /flow
|
|
90
|
+
- [ ] Deep security audit (use /flow:verify --strict when needed)
|
|
91
91
|
|
|
92
92
|
## Quality Gate
|
|
93
93
|
|
|
@@ -88,7 +88,7 @@ Workspace created for $DEVELOPER.
|
|
|
88
88
|
|
|
89
89
|
### Next Steps
|
|
90
90
|
|
|
91
|
-
1. Start a requirement with \`/flow
|
|
91
|
+
1. Start a requirement with \`/flow:init "REQ-XXX|Title"\`
|
|
92
92
|
2. Use \`/flow-workspace record "message"\` to track progress
|
|
93
93
|
3. Use \`/flow-workspace start\` to recover context in new sessions
|
|
94
94
|
|
|
@@ -113,5 +113,5 @@ echo "Files created:"
|
|
|
113
113
|
ls -la "$DEV_WORKSPACE"
|
|
114
114
|
echo ""
|
|
115
115
|
echo "Next steps:"
|
|
116
|
-
echo " 1. Start a requirement: /flow
|
|
116
|
+
echo " 1. Start a requirement: /flow:init \"REQ-XXX|Title\""
|
|
117
117
|
echo " 2. Record progress: /flow-workspace record \"message\""
|
|
@@ -288,21 +288,21 @@ EOF
|
|
|
288
288
|
cat << EOF
|
|
289
289
|
✅ **Clarification complete**. All ${questions_answered} questions answered.
|
|
290
290
|
|
|
291
|
-
Recommended next command: \`/flow
|
|
291
|
+
Recommended next command: \`/flow:spec ${req_id}\`
|
|
292
292
|
EOF
|
|
293
293
|
elif [[ "$questions_count" -eq 0 ]]; then
|
|
294
294
|
cat << EOF
|
|
295
295
|
✅ **No critical ambiguities detected**. research.md is sufficiently specified.
|
|
296
296
|
|
|
297
|
-
Recommended next command: \`/flow
|
|
297
|
+
Recommended next command: \`/flow:spec ${req_id}\`
|
|
298
298
|
EOF
|
|
299
299
|
else
|
|
300
300
|
cat << EOF
|
|
301
301
|
⚠️ **Clarification incomplete**. ${questions_answered}/${questions_count} questions answered.
|
|
302
302
|
|
|
303
303
|
Options:
|
|
304
|
-
1. Continue with \`/flow
|
|
305
|
-
2. Proceed with \`/flow
|
|
304
|
+
1. Continue with \`/flow:spec ${req_id} --overwrite\` to complete remaining questions
|
|
305
|
+
2. Proceed with \`/flow:spec ${req_id}\` (acceptable risk if remaining items are low-impact)
|
|
306
306
|
EOF
|
|
307
307
|
fi
|
|
308
308
|
|