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,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-spec
|
|
3
|
-
description: '
|
|
3
|
+
description: 'Generate and refresh task-manifest for a requirement. Use when converting requirement context into dependency-aware executable tasks.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Flow-Spec Skill
|
|
@@ -9,537 +9,66 @@ description: 'Unified specification phase: PRD → Tech+UI (parallel) → Epic/T
|
|
|
9
9
|
|
|
10
10
|
## Purpose
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
将需求上下文转换为 `task-manifest.json`,作为后续执行唯一任务源。
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# Full Mode (默认)
|
|
18
|
-
/flow-spec "REQ_ID"
|
|
19
|
-
|
|
20
|
-
# Quick Mode (小需求)
|
|
21
|
-
/flow-spec "REQ_ID" --skip-tech --skip-ui
|
|
22
|
-
|
|
23
|
-
# Backend Only
|
|
24
|
-
/flow-spec "REQ_ID" --skip-ui
|
|
25
|
-
|
|
26
|
-
# Frontend Only
|
|
27
|
-
/flow-spec "REQ_ID" --skip-tech
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Mode Matrix
|
|
31
|
-
|
|
32
|
-
| Mode | Command | Agents | Execution |
|
|
33
|
-
|------|---------|--------|-----------|
|
|
34
|
-
| Full | `/flow-spec` | PRD + Tech + UI + Epic | **Team Mode** (v4.7) |
|
|
35
|
-
| Quick | `--skip-tech --skip-ui` | PRD + Epic | Subagent Mode |
|
|
36
|
-
| Backend | `--skip-ui` | PRD + Tech + Epic | Subagent Mode |
|
|
37
|
-
| Frontend | `--skip-tech` | PRD + UI + Epic | Subagent Mode |
|
|
38
|
-
|
|
39
|
-
## Execution Mode Detection (v4.7)
|
|
40
|
-
|
|
41
|
-
```yaml
|
|
42
|
-
Mode Detection:
|
|
43
|
-
if (--skip-tech OR --skip-ui):
|
|
44
|
-
mode: subagent # 简单模式,无需协商
|
|
45
|
-
else:
|
|
46
|
-
mode: team # Full Mode,需要协商
|
|
47
|
-
|
|
48
|
-
Team Mode Benefits:
|
|
49
|
-
- tech-architect 和 ui-designer 可实时协商
|
|
50
|
-
- 解决 API 格式、字段命名等共享决策
|
|
51
|
-
- 减少返工率 ~60%
|
|
52
|
-
|
|
53
|
-
Script: scripts/team-init.sh detect [skip_tech] [skip_ui]
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Entry Gate
|
|
57
|
-
|
|
58
|
-
```yaml
|
|
59
|
-
Prerequisites:
|
|
60
|
-
1. REQ_ID 解析:
|
|
61
|
-
- 从参数获取
|
|
62
|
-
- 或从当前分支推断 (feature/REQ-XXX-*)
|
|
63
|
-
- 或从 orchestration_status.json 获取
|
|
64
|
-
|
|
65
|
-
2. BRAINSTORM.md 存在:
|
|
66
|
-
- 路径: devflow/requirements/${REQ_ID}/BRAINSTORM.md
|
|
67
|
-
- 必须包含: 需求描述、目标用户、核心功能
|
|
68
|
-
|
|
69
|
-
3. Research 完成:
|
|
70
|
-
- 路径: devflow/requirements/${REQ_ID}/research/research.md
|
|
71
|
-
- 无 TODO/PLACEHOLDER
|
|
72
|
-
|
|
73
|
-
4. Status Check:
|
|
74
|
-
- orchestration_status.status ∈ {"initialized", "spec_failed"}
|
|
75
|
-
|
|
76
|
-
5. Constitution Gate:
|
|
77
|
-
- 读取 BRAINSTORM.md 验证需求边界
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Execution Flow
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
84
|
-
│ ENTRY GATE │
|
|
85
|
-
│ REQ_ID → BRAINSTORM.md → research.md → Status Check │
|
|
86
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
87
|
-
│
|
|
88
|
-
▼
|
|
89
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
90
|
-
│ STAGE 1: PRD Generation │
|
|
91
|
-
│ Agent: prd-writer │
|
|
92
|
-
│ Output: PRD.md │
|
|
93
|
-
│ Rules: ANTI-EXPANSION, INVEST, [NEEDS CLARIFICATION] │
|
|
94
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
95
|
-
│
|
|
96
|
-
▼
|
|
97
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
98
|
-
│ STAGE 2: Parallel Execution │
|
|
99
|
-
│ │
|
|
100
|
-
│ ┌─────────────────────┐ ┌─────────────────────┐ │
|
|
101
|
-
│ │ tech-architect │ │ ui-designer │ │
|
|
102
|
-
│ │ (if !--skip-tech) │ │ (if !--skip-ui) │ │
|
|
103
|
-
│ │ │ │ │ │
|
|
104
|
-
│ │ Output: │ │ Output: │ │
|
|
105
|
-
│ │ - TECH_DESIGN.md │ │ - UI_PROTOTYPE.html│ │
|
|
106
|
-
│ │ - data-model.md │ │ - ui_design_ │ │
|
|
107
|
-
│ │ - contracts/ │ │ strategy.md │ │
|
|
108
|
-
│ └─────────────────────┘ └─────────────────────┘ │
|
|
109
|
-
│ │
|
|
110
|
-
│ Parallel: Both agents run simultaneously via Task tool │
|
|
111
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
112
|
-
│
|
|
113
|
-
▼
|
|
114
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
115
|
-
│ STAGE 3: Epic Generation │
|
|
116
|
-
│ Agent: planner │
|
|
117
|
-
│ Input: PRD.md + TECH_DESIGN.md (optional) + UI_PROTOTYPE.html │
|
|
118
|
-
│ Output: EPIC.md + TASKS.md │
|
|
119
|
-
│ Rules: TDD Order, Bite-Sized Tasks, Phase -1 Gates │
|
|
120
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
121
|
-
│
|
|
122
|
-
▼
|
|
123
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
124
|
-
│ EXIT GATE │
|
|
125
|
-
│ 1. PRD.md exists, no {{PLACEHOLDER}} │
|
|
126
|
-
│ 2. TECH_DESIGN.md exists (if not skipped) │
|
|
127
|
-
│ 3. UI_PROTOTYPE.html exists (if not skipped) │
|
|
128
|
-
│ 4. EPIC.md exists │
|
|
129
|
-
│ 5. TASKS.md exists, TDD order correct │
|
|
130
|
-
│ 6. Status: spec_complete │
|
|
131
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## Stage Details
|
|
135
|
-
|
|
136
|
-
### Stage 1: PRD Generation
|
|
137
|
-
|
|
138
|
-
```yaml
|
|
139
|
-
Agent: prd-writer (research-type)
|
|
140
|
-
Input:
|
|
141
|
-
- BRAINSTORM.md
|
|
142
|
-
- research/research.md
|
|
143
|
-
- research/internal/codebase-overview.md
|
|
144
|
-
|
|
145
|
-
Output:
|
|
146
|
-
- PRD.md
|
|
147
|
-
|
|
148
|
-
Rules:
|
|
149
|
-
- ANTI-EXPANSION: 未提及 → [NEEDS CLARIFICATION]
|
|
150
|
-
- NO TECH DETAILS: 只关注 WHAT/WHY
|
|
151
|
-
- STORY INDEPENDENCE: 每个故事有独立测试
|
|
152
|
-
- PRIORITY MANDATORY: P1, P2, P3...
|
|
153
|
-
- MVP IDENTIFICATION: P1 = MVP
|
|
154
|
-
|
|
155
|
-
Validation:
|
|
156
|
-
- 无 {{PLACEHOLDER}}
|
|
157
|
-
- 所有故事有验收标准
|
|
158
|
-
- Constitution Check 通过
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Stage 2: Parallel Execution
|
|
162
|
-
|
|
163
|
-
```yaml
|
|
164
|
-
# =============================================================================
|
|
165
|
-
# Team Mode (Full Mode, v4.7)
|
|
166
|
-
# =============================================================================
|
|
167
|
-
Team Mode:
|
|
168
|
-
Condition: !--skip-tech AND !--skip-ui
|
|
169
|
-
|
|
170
|
-
Team: spec-design-team
|
|
171
|
-
Lead: spec-lead (main agent)
|
|
172
|
-
Teammates:
|
|
173
|
-
- tech-architect: 技术设计
|
|
174
|
-
- ui-designer: UI 原型
|
|
175
|
-
|
|
176
|
-
# ---------------------------------------------------------------------------
|
|
177
|
-
# Team Mode Execution Steps (详细)
|
|
178
|
-
# ---------------------------------------------------------------------------
|
|
179
|
-
Execution Steps:
|
|
180
|
-
|
|
181
|
-
Step 1 - 初始化 Team:
|
|
182
|
-
Action: 调用 scripts/team-init.sh init
|
|
183
|
-
Result: 创建 spec-design-team,设置 lead 为当前 agent
|
|
184
|
-
State Update: orchestration_status.team.mode = "parallel"
|
|
185
|
-
|
|
186
|
-
Step 2 - Spawn Teammates:
|
|
187
|
-
Action: 使用 Task tool 并行 spawn 两个 agent
|
|
188
|
-
Parallel:
|
|
189
|
-
- Task: tech-architect
|
|
190
|
-
Agent: flow-tech/references/tech-architect.md
|
|
191
|
-
Input: PRD.md, research/codebase-overview.md
|
|
192
|
-
Output: TECH_DESIGN.md, data-model.md, contracts/
|
|
193
|
-
|
|
194
|
-
- Task: ui-designer
|
|
195
|
-
Agent: flow-ui/references/ui-designer.md
|
|
196
|
-
Input: PRD.md, STYLE.md (optional)
|
|
197
|
-
Output: UI_PROTOTYPE.html, ui_design_strategy.md
|
|
198
|
-
|
|
199
|
-
Step 3 - 协商协议 (SendMessage):
|
|
200
|
-
Trigger: tech-architect 完成初稿后发起
|
|
201
|
-
Protocol: Direct Message via SendMessage tool
|
|
202
|
-
Topics:
|
|
203
|
-
- api_format: API 响应格式
|
|
204
|
-
- field_naming: 数据字段命名
|
|
205
|
-
- auth_strategy: 认证策略
|
|
206
|
-
- state_management: 前端状态管理
|
|
207
|
-
Output: design_decisions.md (协商结果记录)
|
|
208
|
-
|
|
209
|
-
Step 4 - 等待完成:
|
|
210
|
-
Mechanism: 监听 TeammateIdle 事件
|
|
211
|
-
Condition: 两者都完成后进入 Stage 3
|
|
212
|
-
Timeout: 30 minutes (可配置)
|
|
14
|
+
## Long-Running Harness Protocol(Initializer/Worker/Done Gate)
|
|
213
15
|
|
|
214
|
-
|
|
215
|
-
Action: 发送 shutdown_request 给 teammates
|
|
216
|
-
Cleanup: 调用 TeamDelete 清理 Team 状态
|
|
16
|
+
`/flow:spec` 必须以“可恢复、可验证”的增量方式生成计划,而不是一次性黑箱产出。
|
|
217
17
|
|
|
218
|
-
|
|
219
|
-
# SendMessage 协商协议 (v4.7)
|
|
220
|
-
# ---------------------------------------------------------------------------
|
|
221
|
-
Negotiate Protocol:
|
|
18
|
+
### Session Start(先同步上下文,再规划)
|
|
222
19
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
Decision Owner: tech-architect
|
|
20
|
+
每个窗口启动先读取:
|
|
21
|
+
- `devflow/requirements/${REQ_ID}/session-checklist.json`(若存在)
|
|
22
|
+
- `devflow/requirements/${REQ_ID}/session-progress.md`(若存在)
|
|
23
|
+
- `devflow/requirements/${REQ_ID}/session-handoff.md`(若存在)
|
|
24
|
+
- `devflow/requirements/${REQ_ID}/context-package.md`
|
|
25
|
+
- 旧版 `task-manifest.json`(若存在)
|
|
230
26
|
|
|
231
|
-
|
|
232
|
-
1. tech-architect → ui-designer:
|
|
233
|
-
SendMessage:
|
|
234
|
-
type: "message"
|
|
235
|
-
recipient: "ui-designer"
|
|
236
|
-
content: |
|
|
237
|
-
API 响应格式建议采用 REST + JSON。
|
|
238
|
-
- 分页: cursor-based (nextCursor 字段)
|
|
239
|
-
- 错误格式: { code, message, details }
|
|
240
|
-
- 时间格式: ISO 8601
|
|
241
|
-
请确认是否与前端需求一致。
|
|
242
|
-
summary: "API 格式协商请求"
|
|
27
|
+
### Worker Session(一次只收敛一个规划目标)
|
|
243
28
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
content: |
|
|
249
|
-
确认 REST + JSON 格式。
|
|
250
|
-
建议补充:
|
|
251
|
-
- 分页响应包含 hasMore 字段便于前端判断
|
|
252
|
-
- 列表接口支持 limit 参数 (默认 20)
|
|
253
|
-
summary: "API 格式确认 + 补充建议"
|
|
29
|
+
每轮只完成一个最小目标,例如:
|
|
30
|
+
- 修正一个依赖子图
|
|
31
|
+
- 补齐一组缺失的 `run` 指令
|
|
32
|
+
- 处理一次 `--overwrite` 下的清理重建
|
|
254
33
|
|
|
255
|
-
|
|
34
|
+
完成后必须:
|
|
35
|
+
1. 运行 `harness:plan` 生成/刷新 manifest
|
|
36
|
+
2. 校验 schema 与依赖无环
|
|
37
|
+
3. 更新 progress/handoff,写明下一轮唯一目标
|
|
256
38
|
|
|
257
|
-
|
|
258
|
-
# Topic 2: Field Naming 协商
|
|
259
|
-
# -------------------------------------------------------------------------
|
|
260
|
-
field_naming:
|
|
261
|
-
Initiator: tech-architect
|
|
262
|
-
Responder: ui-designer
|
|
263
|
-
Decision Owner: tech-architect
|
|
39
|
+
### Done Gate
|
|
264
40
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
recipient: "ui-designer"
|
|
270
|
-
content: |
|
|
271
|
-
数据模型字段命名规范建议:
|
|
272
|
-
- API 响应: camelCase (userId, createdAt)
|
|
273
|
-
- 数据库: snake_case (user_id, created_at)
|
|
274
|
-
- 前端 props: camelCase
|
|
275
|
-
核心实体字段: id, name, status, createdAt, updatedAt
|
|
276
|
-
请确认是否与 UI 组件 props 一致。
|
|
277
|
-
summary: "字段命名规范协商"
|
|
41
|
+
仅当以下条件满足才标记 `flow:spec` 完成:
|
|
42
|
+
- `task-manifest.json` 存在且 `tasks` 非空
|
|
43
|
+
- `id/dependsOn/run` 字段完整且无自循环
|
|
44
|
+
- `session-checklist.json` 中 `flow:spec.passes == true`
|
|
278
45
|
|
|
279
|
-
|
|
280
|
-
SendMessage:
|
|
281
|
-
type: "message"
|
|
282
|
-
recipient: "tech-architect"
|
|
283
|
-
content: |
|
|
284
|
-
确认 camelCase 命名。
|
|
285
|
-
UI 组件需要的额外字段:
|
|
286
|
-
- displayName (用于展示)
|
|
287
|
-
- isActive (布尔状态)
|
|
288
|
-
- avatarUrl (头像链接)
|
|
289
|
-
summary: "字段命名确认"
|
|
290
|
-
|
|
291
|
-
# -------------------------------------------------------------------------
|
|
292
|
-
# Topic 3: Auth Strategy 协商
|
|
293
|
-
# -------------------------------------------------------------------------
|
|
294
|
-
auth_strategy:
|
|
295
|
-
Initiator: tech-architect
|
|
296
|
-
Responder: ui-designer
|
|
297
|
-
Decision Owner: tech-architect
|
|
298
|
-
|
|
299
|
-
Message Flow:
|
|
300
|
-
1. tech-architect → ui-designer:
|
|
301
|
-
SendMessage:
|
|
302
|
-
type: "message"
|
|
303
|
-
recipient: "ui-designer"
|
|
304
|
-
content: |
|
|
305
|
-
认证策略建议采用 JWT:
|
|
306
|
-
- Access Token: 15 分钟过期
|
|
307
|
-
- Refresh Token: 7 天过期
|
|
308
|
-
- 存储: httpOnly cookie (推荐) 或 localStorage
|
|
309
|
-
前端需要处理 token 刷新逻辑。
|
|
310
|
-
summary: "认证策略协商"
|
|
311
|
-
|
|
312
|
-
2. ui-designer → tech-architect:
|
|
313
|
-
SendMessage:
|
|
314
|
-
type: "message"
|
|
315
|
-
recipient: "tech-architect"
|
|
316
|
-
content: |
|
|
317
|
-
确认 JWT 方案。
|
|
318
|
-
前端实现:
|
|
319
|
-
- 使用 axios interceptor 自动刷新
|
|
320
|
-
- 401 响应触发 refresh 流程
|
|
321
|
-
- refresh 失败跳转登录页
|
|
322
|
-
summary: "认证策略确认"
|
|
323
|
-
|
|
324
|
-
# -------------------------------------------------------------------------
|
|
325
|
-
# Topic 4: State Management 协商
|
|
326
|
-
# -------------------------------------------------------------------------
|
|
327
|
-
state_management:
|
|
328
|
-
Initiator: ui-designer
|
|
329
|
-
Responder: tech-architect
|
|
330
|
-
Decision Owner: ui-designer
|
|
331
|
-
|
|
332
|
-
Message Flow:
|
|
333
|
-
1. ui-designer → tech-architect:
|
|
334
|
-
SendMessage:
|
|
335
|
-
type: "message"
|
|
336
|
-
recipient: "tech-architect"
|
|
337
|
-
content: |
|
|
338
|
-
前端状态管理建议采用 Zustand:
|
|
339
|
-
- 全局状态: user, theme, notifications
|
|
340
|
-
- 服务端状态: 使用 React Query 管理
|
|
341
|
-
- 表单状态: 组件内部 useState
|
|
342
|
-
API 缓存策略需要后端支持 ETag 或 Last-Modified。
|
|
343
|
-
summary: "状态管理方案协商"
|
|
344
|
-
|
|
345
|
-
2. tech-architect → ui-designer:
|
|
346
|
-
SendMessage:
|
|
347
|
-
type: "message"
|
|
348
|
-
recipient: "ui-designer"
|
|
349
|
-
content: |
|
|
350
|
-
确认 Zustand + React Query 方案。
|
|
351
|
-
后端支持:
|
|
352
|
-
- 列表接口返回 ETag header
|
|
353
|
-
- 详情接口返回 Last-Modified
|
|
354
|
-
- 支持 If-None-Match 条件请求
|
|
355
|
-
summary: "状态管理确认"
|
|
356
|
-
|
|
357
|
-
# ---------------------------------------------------------------------------
|
|
358
|
-
# 协商结果记录
|
|
359
|
-
# ---------------------------------------------------------------------------
|
|
360
|
-
Decision Record:
|
|
361
|
-
Path: devflow/requirements/${REQ_ID}/research/design_decisions.md
|
|
362
|
-
Format: |
|
|
363
|
-
# Design Decisions
|
|
364
|
-
|
|
365
|
-
> 由 spec-design-team 协商生成
|
|
366
|
-
> 生成时间: ${TIMESTAMP}
|
|
367
|
-
|
|
368
|
-
## API Format
|
|
369
|
-
**决策**: REST + JSON, cursor-based pagination
|
|
370
|
-
**参与者**: tech-architect, ui-designer
|
|
371
|
-
**原因**: 前后端一致性,便于缓存
|
|
372
|
-
|
|
373
|
-
## Field Naming
|
|
374
|
-
**决策**: camelCase for API, snake_case for DB
|
|
375
|
-
**参与者**: tech-architect, ui-designer
|
|
376
|
-
**原因**: 行业标准,前端友好
|
|
377
|
-
|
|
378
|
-
## Auth Strategy
|
|
379
|
-
**决策**: JWT with refresh token
|
|
380
|
-
**参与者**: tech-architect, ui-designer
|
|
381
|
-
**原因**: 无状态,可扩展
|
|
382
|
-
|
|
383
|
-
## State Management
|
|
384
|
-
**决策**: Zustand + React Query
|
|
385
|
-
**参与者**: ui-designer, tech-architect
|
|
386
|
-
**原因**: 轻量级,服务端状态分离
|
|
387
|
-
|
|
388
|
-
Negotiate Topics:
|
|
389
|
-
- api_format: API 响应格式 (REST/GraphQL)
|
|
390
|
-
- field_naming: 数据字段命名规范
|
|
391
|
-
- auth_strategy: 认证策略
|
|
392
|
-
- state_management: 前端状态管理
|
|
393
|
-
|
|
394
|
-
# =============================================================================
|
|
395
|
-
# Subagent Mode (Simplified Modes)
|
|
396
|
-
# =============================================================================
|
|
397
|
-
Subagent Mode:
|
|
398
|
-
Condition: --skip-tech OR --skip-ui
|
|
399
|
-
|
|
400
|
-
Parallel Agents:
|
|
401
|
-
tech-architect:
|
|
402
|
-
Condition: !--skip-tech
|
|
403
|
-
Input: PRD.md, research/codebase-overview.md
|
|
404
|
-
Output: TECH_DESIGN.md, data-model.md, contracts/
|
|
405
|
-
Rules:
|
|
406
|
-
- ANTI-TECH-CREEP: 复用 baseline 技术栈
|
|
407
|
-
- Simplicity Gate: ≤3 栈层
|
|
408
|
-
- Integration-First: 契约先定义
|
|
409
|
-
|
|
410
|
-
ui-designer:
|
|
411
|
-
Condition: !--skip-ui AND PRD 含 UI 关键词
|
|
412
|
-
Input: PRD.md, STYLE.md (optional)
|
|
413
|
-
Output: UI_PROTOTYPE.html, ui_design_strategy.md
|
|
414
|
-
Rules:
|
|
415
|
-
- ANTI-GENERIC-DESIGN: 无占位图/AI紫蓝
|
|
416
|
-
- 响应式: 3 断点
|
|
417
|
-
- 交互完整: 所有状态
|
|
418
|
-
|
|
419
|
-
Execution:
|
|
420
|
-
- 使用 Task tool 并行调用 agent
|
|
421
|
-
- 等待完成后进入 Stage 3
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
### Stage 3: Epic Generation
|
|
425
|
-
|
|
426
|
-
```yaml
|
|
427
|
-
Agent: planner (research-type)
|
|
428
|
-
Input:
|
|
429
|
-
- PRD.md
|
|
430
|
-
- TECH_DESIGN.md (if exists)
|
|
431
|
-
- UI_PROTOTYPE.html (if exists)
|
|
432
|
-
|
|
433
|
-
Output:
|
|
434
|
-
- EPIC.md
|
|
435
|
-
- TASKS.md
|
|
436
|
-
|
|
437
|
-
Rules:
|
|
438
|
-
- TDD Order: Phase 2 (Tests) → Phase 3 (Implementation)
|
|
439
|
-
- Bite-Sized Tasks: 每个 step 2-5 分钟
|
|
440
|
-
- Phase -1 Gates: Simplicity, Anti-Abstraction, Integration-First
|
|
441
|
-
- UI Integration: 如有 UI_PROTOTYPE.html,提取组件清单
|
|
442
|
-
|
|
443
|
-
Validation:
|
|
444
|
-
- EPIC.md 无 {{PLACEHOLDER}}
|
|
445
|
-
- TASKS.md TDD 顺序正确
|
|
446
|
-
- Constitution Check 通过
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
## Exit Gate
|
|
450
|
-
|
|
451
|
-
```yaml
|
|
452
|
-
File Checks:
|
|
453
|
-
- [ ] PRD.md exists, no {{PLACEHOLDER}}
|
|
454
|
-
- [ ] TECH_DESIGN.md exists (if !--skip-tech)
|
|
455
|
-
- [ ] UI_PROTOTYPE.html exists (if !--skip-ui AND UI detected)
|
|
456
|
-
- [ ] EPIC.md exists, no {{PLACEHOLDER}}
|
|
457
|
-
- [ ] TASKS.md exists, TDD order correct
|
|
458
|
-
|
|
459
|
-
Quality Checks:
|
|
460
|
-
- [ ] PRD: ANTI-EXPANSION rules passed
|
|
461
|
-
- [ ] TECH: ANTI-TECH-CREEP rules passed (if applicable)
|
|
462
|
-
- [ ] UI: ANTI-GENERIC-DESIGN rules passed (if applicable)
|
|
463
|
-
- [ ] EPIC: Phase -1 Gates passed
|
|
464
|
-
|
|
465
|
-
Status Update:
|
|
466
|
-
- orchestration_status.status = "spec_complete"
|
|
467
|
-
- orchestration_status.phase = "spec"
|
|
468
|
-
- orchestration_status.outputs = [list of generated files]
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
## Output Structure
|
|
46
|
+
## Input Format
|
|
472
47
|
|
|
48
|
+
```bash
|
|
49
|
+
/flow:spec "REQ_ID" [--overwrite]
|
|
473
50
|
```
|
|
474
|
-
devflow/requirements/${REQ_ID}/
|
|
475
|
-
├── PRD.md # Always
|
|
476
|
-
├── TECH_DESIGN.md # If !--skip-tech
|
|
477
|
-
├── data-model.md # If !--skip-tech
|
|
478
|
-
├── contracts/ # If !--skip-tech
|
|
479
|
-
│ └── openapi.yaml
|
|
480
|
-
├── quickstart.md # If !--skip-tech
|
|
481
|
-
├── UI_PROTOTYPE.html # If !--skip-ui AND UI detected
|
|
482
|
-
├── EPIC.md # Always
|
|
483
|
-
├── TASKS.md # Always
|
|
484
|
-
├── research/
|
|
485
|
-
│ ├── research.md # Pre-existing
|
|
486
|
-
│ ├── codebase-tech-analysis.md # If !--skip-tech
|
|
487
|
-
│ └── ui_design_strategy.md # If !--skip-ui
|
|
488
|
-
└── orchestration_status.json # Updated
|
|
489
|
-
```
|
|
490
|
-
|
|
491
|
-
## Error Handling
|
|
492
51
|
|
|
493
|
-
|
|
494
|
-
Stage 1 Failure (PRD):
|
|
495
|
-
- Log error to EXECUTION_LOG.md
|
|
496
|
-
- Status: spec_failed
|
|
497
|
-
- Retry: /flow-spec --retry
|
|
52
|
+
## Execution Steps
|
|
498
53
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
- If ui-designer fails: Continue without UI, mark ui as skipped
|
|
502
|
-
- Log partial completion
|
|
54
|
+
1. 解析 `REQ_ID` 和可选 `--overwrite`。
|
|
55
|
+
2. 运行计划生成:
|
|
503
56
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
- Status: spec_failed
|
|
507
|
-
- Retry: /flow-spec --retry --from=epic
|
|
57
|
+
```bash
|
|
58
|
+
npm run harness:plan -- --change-id "${REQ_ID}" [--overwrite]
|
|
508
59
|
```
|
|
509
60
|
|
|
510
|
-
|
|
61
|
+
3. 校验输出:
|
|
62
|
+
- `devflow/requirements/${REQ_ID}/task-manifest.json`
|
|
63
|
+
- `tasks` 数组非空,`id/dependsOn/run` 字段完整
|
|
511
64
|
|
|
512
|
-
|
|
65
|
+
## Exit Criteria
|
|
513
66
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
/flow-tech "REQ-123" # ⚠️ Deprecated: Use /flow-spec instead
|
|
517
|
-
/flow-ui "REQ-123" # ⚠️ Deprecated: Use /flow-spec instead
|
|
518
|
-
/flow-epic "REQ-123" # ⚠️ Deprecated: Use /flow-spec instead
|
|
519
|
-
```
|
|
67
|
+
- `task-manifest.json` 可通过 schema 校验
|
|
68
|
+
- 任务依赖图无自循环(由 planner 保障)
|
|
520
69
|
|
|
521
70
|
## Next Step
|
|
522
71
|
|
|
523
72
|
```bash
|
|
524
|
-
/flow
|
|
73
|
+
/flow:dev "${REQ_ID}"
|
|
525
74
|
```
|
|
526
|
-
|
|
527
|
-
## Agent References
|
|
528
|
-
|
|
529
|
-
| Agent | Purpose | Location |
|
|
530
|
-
|-------|---------|----------|
|
|
531
|
-
| prd-writer | PRD 生成 | `flow-prd/references/prd-writer.md` |
|
|
532
|
-
| tech-architect | 技术设计 | `flow-tech/references/tech-architect.md` |
|
|
533
|
-
| ui-designer | UI 原型 | `flow-ui/references/ui-designer.md` |
|
|
534
|
-
| planner | Epic/Tasks | `flow-epic/references/planner.md` |
|
|
535
|
-
|
|
536
|
-
## Constitution Compliance
|
|
537
|
-
|
|
538
|
-
- **Article I**: Complete implementation, no placeholders
|
|
539
|
-
- **Article II**: Reuse existing components
|
|
540
|
-
- **Article III**: No hardcoded secrets
|
|
541
|
-
- **Article VI**: TDD order enforced
|
|
542
|
-
- **Article VII**: Simplicity Gate
|
|
543
|
-
- **Article VIII**: Anti-Abstraction Gate
|
|
544
|
-
- **Article IX**: Integration-First Gate
|
|
545
|
-
- **Article X**: Requirement boundary enforced
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
{"file": "devflow/requirements/{REQ}/
|
|
2
|
-
{"file": "devflow/requirements/{REQ}/
|
|
3
|
-
{"file": "devflow/requirements/{REQ}/
|
|
4
|
-
{"file": "devflow/
|
|
5
|
-
{"file": "
|
|
6
|
-
{"file": "devflow/STYLE.md", "reason": "Design style guide", "optional": true}
|
|
7
|
-
{"file": "CLAUDE.md", "reason": "Tech stack baseline"}
|
|
1
|
+
{"file": "devflow/requirements/{REQ}/context-package.md", "reason": "Execution context package"}
|
|
2
|
+
{"file": "devflow/requirements/{REQ}/TASKS.md", "reason": "Task source", "optional": true}
|
|
3
|
+
{"file": "devflow/requirements/{REQ}/task-manifest.json", "reason": "Previous manifest", "optional": true}
|
|
4
|
+
{"file": "devflow/requirements/{REQ}/harness-state.json", "reason": "Lifecycle status", "optional": true}
|
|
5
|
+
{"file": ".claude/rules/project-constitution.md", "reason": "Quality rules and constraints"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# flow-verify/
|
|
2
|
+
> L2 | 父级: /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/.claude/skills/workflow/CLAUDE.md
|
|
3
|
+
|
|
4
|
+
成员清单
|
|
5
|
+
SKILL.md: flow:verify 的核心指令,定义 quick/strict gate 与 release 前准入规则。
|
|
6
|
+
context.jsonl: flow-verify 上下文注入定义(task-manifest/report-card/harness-state)。
|
|
7
|
+
|
|
8
|
+
法则: 成员完整·一行一文件·父级链接·技术词前置
|
|
9
|
+
|
|
10
|
+
[PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-verify
|
|
3
|
+
description: 'Run layered quick/strict gates and emit report-card for a requirement. Use before release and after major dev changes.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flow-Verify Skill
|
|
7
|
+
|
|
8
|
+
> [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
执行质量门禁并输出 `report-card.json`,作为发布前唯一准入依据。
|
|
13
|
+
|
|
14
|
+
## Input Format
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
/flow:verify "REQ_ID" [--strict] [--skip-review]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Execution Steps
|
|
21
|
+
|
|
22
|
+
1. 解析参数。
|
|
23
|
+
2. 调用验证引擎:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run harness:verify -- --change-id "${REQ_ID}" [--strict] [--skip-review]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. 读取并检查输出:
|
|
30
|
+
- `devflow/requirements/${REQ_ID}/report-card.json`
|
|
31
|
+
- `overall == "pass"` 才能进入 release
|
|
32
|
+
|
|
33
|
+
## Gate Model
|
|
34
|
+
|
|
35
|
+
- Quick Gate(默认):
|
|
36
|
+
- lint
|
|
37
|
+
- typecheck
|
|
38
|
+
- test
|
|
39
|
+
- Strict Gate(`--strict`):
|
|
40
|
+
- test:integration(如存在)
|
|
41
|
+
- npm audit
|
|
42
|
+
- codex review(可 `--skip-review`)
|
|
43
|
+
|
|
44
|
+
## Exit Criteria
|
|
45
|
+
|
|
46
|
+
- `report-card.json` 生成成功
|
|
47
|
+
- 若 `overall=fail`,停止发布并修复失败项
|
|
48
|
+
|
|
49
|
+
## Next Step
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
/flow:release "${REQ_ID}"
|
|
53
|
+
```
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{"file": "devflow/requirements/{REQ}/task-manifest.json", "reason": "Task status baseline"}
|
|
2
|
+
{"file": "devflow/requirements/{REQ}/report-card.json", "reason": "Previous verification result", "optional": true}
|
|
3
|
+
{"file": "devflow/requirements/{REQ}/harness-state.json", "reason": "Lifecycle status", "optional": true}
|
|
4
|
+
{"file": "devflow/requirements/{REQ}/context-package.md", "reason": "Constraints and next commands", "optional": true}
|
|
5
|
+
{"file": ".claude/rules/project-constitution.md", "reason": "Quality rules and constraints"}
|