cc-devflow 4.1.6 → 4.3.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 (128) hide show
  1. package/.claude/commands/core/architecture.md +30 -0
  2. package/.claude/commands/core/guidelines.md +25 -0
  3. package/.claude/commands/core/roadmap.md +29 -0
  4. package/.claude/commands/core/style.md +18 -0
  5. package/.claude/commands/flow/CLAUDE.md +0 -4
  6. package/.claude/docs/examples/design-inspiration-pool.md +59 -0
  7. package/.claude/docs/examples/ui-prototype-constitution-checklist.md +75 -0
  8. package/.claude/docs/implementation-summary-v7.md +449 -0
  9. package/.claude/docs/spec-format-guide.md +349 -0
  10. package/.claude/docs/state-consolidation-design.md +323 -0
  11. package/.claude/docs/templates/ARCHITECTURE_TEMPLATE.md +85 -386
  12. package/.claude/docs/templates/DESIGN_TEMPLATE.md +157 -0
  13. package/.claude/docs/templates/PROPOSAL_TEMPLATE.md +91 -0
  14. package/.claude/docs/templates/SPEC_TEMPLATE_DELTA.md +139 -0
  15. package/.claude/docs/templates/SPEC_TEMPLATE_PROJECT.md +93 -0
  16. package/.claude/docs/templates/STYLE_TEMPLATE.md +114 -901
  17. package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +143 -1205
  18. package/.claude/hooks/inject-agent-context.ts +9 -9
  19. package/.claude/scripts/.claude/commands/flow/export-openspec.md +221 -0
  20. package/.claude/scripts/.claude/commands/flow/import-openspec.md +171 -0
  21. package/.claude/scripts/__tests__/openspec.test.js +212 -0
  22. package/.claude/scripts/delta-parser.ts +112 -2
  23. package/.claude/scripts/export-openspec.js +222 -0
  24. package/.claude/scripts/import-openspec.js +272 -0
  25. package/.claude/scripts/validate-scope.sh +200 -0
  26. package/.claude/skills/cc-devflow-orchestrator/SKILL.md +25 -0
  27. package/.claude/skills/flow-dev/SKILL.md +94 -0
  28. package/.claude/skills/flow-init/SKILL.md +105 -0
  29. package/.claude/skills/{workflow/flow-release → flow-release}/SKILL.md +14 -3
  30. package/.claude/skills/flow-spec/SKILL.md +102 -0
  31. package/.claude/skills/utility/npm-release/CLAUDE.md +55 -0
  32. package/.claude/skills/utility/npm-release/SKILL.md +111 -46
  33. package/.claude/skills/utility/npm-release/references/version-decision-guide.md +134 -0
  34. package/.claude/skills/utility/npm-release/scripts/atomic-version-bump.sh +95 -0
  35. package/.claude/skills/utility/npm-release/scripts/validate-version-sync.sh +82 -0
  36. package/.claude/skills/utility/npm-release/scripts/version-decision-tree.sh +44 -0
  37. package/.claude/tsc-cache/70d2fc6d-2936-429b-b529-429f1aae8c88/affected-repos.txt +1 -0
  38. package/.claude/tsc-cache/70d2fc6d-2936-429b-b529-429f1aae8c88/edited-files.log +2 -0
  39. package/CHANGELOG.md +81 -0
  40. package/README.md +7 -1
  41. package/README.zh-CN.md +7 -1
  42. package/bin/cc-devflow-cli.js +154 -0
  43. package/docs/v4.3.0-migration-guide.md +276 -0
  44. package/lib/harness/CLAUDE.md +5 -4
  45. package/lib/harness/__tests__/planner.tdd.test.js +125 -0
  46. package/lib/harness/index.js +4 -2
  47. package/lib/harness/operations/dispatch.js +13 -0
  48. package/lib/harness/operations/plan.js +55 -1
  49. package/lib/harness/operations/release.js +87 -0
  50. package/lib/harness/operations/verify.js +14 -0
  51. package/lib/harness/planner.js +131 -0
  52. package/lib/harness/query.js +126 -0
  53. package/lib/harness/schemas.js +22 -1
  54. package/package.json +1 -1
  55. package/.claude/commands/flow/checklist.md +0 -18
  56. package/.claude/commands/flow/clarify.md +0 -18
  57. package/.claude/commands/flow/new.md +0 -23
  58. package/.claude/commands/flow/quality.md +0 -21
  59. package/.claude/docs/templates/EPIC_TEMPLATE.md +0 -805
  60. package/.claude/docs/templates/PRD_TEMPLATE.md +0 -562
  61. package/.claude/docs/templates/TASKS_TEMPLATE.md +0 -523
  62. package/.claude/docs/templates/TECH_DESIGN_TEMPLATE.md +0 -1019
  63. package/.claude/skills/workflow/CLAUDE.md +0 -24
  64. package/.claude/skills/workflow/flow-dev/SKILL.md +0 -58
  65. package/.claude/skills/workflow/flow-init/SKILL.md +0 -55
  66. package/.claude/skills/workflow/flow-spec/SKILL.md +0 -42
  67. /package/.claude/skills/{domain/attention-refresh → attention-refresh}/SKILL.md +0 -0
  68. /package/.claude/skills/{domain/brainstorming → brainstorming}/SKILL.md +0 -0
  69. /package/.claude/skills/{guardrail/constitution-guardian → constitution-guardian}/SKILL.md +0 -0
  70. /package/.claude/skills/{utility/constitution-quick-ref → constitution-quick-ref}/SKILL.md +0 -0
  71. /package/.claude/skills/{domain/debugging → debugging}/SKILL.md +0 -0
  72. /package/.claude/skills/{utility/file-standards → file-standards}/SKILL.md +0 -0
  73. /package/.claude/skills/{domain/finishing-branch → finishing-branch}/SKILL.md +0 -0
  74. /package/.claude/skills/{workflow/flow-dev → flow-dev}/CLAUDE.md +0 -0
  75. /package/.claude/skills/{workflow/flow-dev → flow-dev}/assets/IMPLEMENTATION_PLAN_TEMPLATE.md +0 -0
  76. /package/.claude/skills/{workflow/flow-dev → flow-dev}/context.jsonl +0 -0
  77. /package/.claude/skills/{workflow/flow-dev → flow-dev}/dev-implementer.jsonl +0 -0
  78. /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/entry-gate.sh +0 -0
  79. /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/exit-gate.sh +0 -0
  80. /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/task-orchestrator.sh +0 -0
  81. /package/.claude/skills/{workflow/flow-fix → flow-fix}/SKILL.md +0 -0
  82. /package/.claude/skills/{workflow/flow-fix → flow-fix}/context.jsonl +0 -0
  83. /package/.claude/skills/{workflow/flow-fix → flow-fix}/references/bug-analyzer.md +0 -0
  84. /package/.claude/skills/{workflow/flow-init → flow-init}/assets/BRAINSTORM_TEMPLATE.md +0 -0
  85. /package/.claude/skills/{workflow/flow-init → flow-init}/assets/INIT_FLOW_TEMPLATE.md +0 -0
  86. /package/.claude/skills/{workflow/flow-init → flow-init}/assets/RESEARCH_TEMPLATE.md +0 -0
  87. /package/.claude/skills/{workflow/flow-init → flow-init}/context.jsonl +0 -0
  88. /package/.claude/skills/{workflow/flow-init → flow-init}/references/flow-researcher.md +0 -0
  89. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/check-prerequisites.sh +0 -0
  90. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/consolidate-research.sh +0 -0
  91. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/create-requirement.sh +0 -0
  92. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/generate-research-tasks.sh +0 -0
  93. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/populate-research-tasks.sh +0 -0
  94. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/validate-research.sh +0 -0
  95. /package/.claude/skills/{workflow/flow-quality → flow-quality}/SKILL.md +0 -0
  96. /package/.claude/skills/{workflow/flow-quality → flow-quality}/context.jsonl +0 -0
  97. /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/code-quality-reviewer.md +0 -0
  98. /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/qa-tester.md +0 -0
  99. /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/security-reviewer.md +0 -0
  100. /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/spec-reviewer.md +0 -0
  101. /package/.claude/skills/{workflow/flow-release → flow-release}/context.jsonl +0 -0
  102. /package/.claude/skills/{workflow/flow-release → flow-release}/references/release-manager.md +0 -0
  103. /package/.claude/skills/{workflow/flow-spec → flow-spec}/CLAUDE.md +0 -0
  104. /package/.claude/skills/{workflow/flow-spec → flow-spec}/context.jsonl +0 -0
  105. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/entry-gate.sh +0 -0
  106. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/exit-gate.sh +0 -0
  107. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/parallel-orchestrator.sh +0 -0
  108. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/team-communication.sh +0 -0
  109. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/team-init.sh +0 -0
  110. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/test-team-mode.sh +0 -0
  111. /package/.claude/skills/{workflow/flow-spec → flow-spec}/team-config.json +0 -0
  112. /package/.claude/skills/{workflow/flow-verify → flow-verify}/CLAUDE.md +0 -0
  113. /package/.claude/skills/{workflow/flow-verify → flow-verify}/SKILL.md +0 -0
  114. /package/.claude/skills/{workflow/flow-verify → flow-verify}/context.jsonl +0 -0
  115. /package/.claude/skills/{utility/fractal-docs → fractal-docs}/SKILL.md +0 -0
  116. /package/.claude/skills/{utility/journey-checker → journey-checker}/SKILL.md +0 -0
  117. /package/.claude/skills/{utility/journey-checker → journey-checker}/pressure-scenarios.md +0 -0
  118. /package/.claude/skills/{domain/receiving-review → receiving-review}/SKILL.md +0 -0
  119. /package/.claude/skills/{utility/skill-creator → skill-creator}/LICENSE.txt +0 -0
  120. /package/.claude/skills/{utility/skill-creator → skill-creator}/SKILL.md +0 -0
  121. /package/.claude/skills/{utility/skill-creator → skill-creator}/references/output-patterns.md +0 -0
  122. /package/.claude/skills/{utility/skill-creator → skill-creator}/references/workflows.md +0 -0
  123. /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/init_skill.py +0 -0
  124. /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/package_skill.py +0 -0
  125. /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/quick_validate.py +0 -0
  126. /package/.claude/skills/{domain/tdd → tdd}/SKILL.md +0 -0
  127. /package/.claude/skills/{guardrail/tdd-enforcer → tdd-enforcer}/SKILL.md +0 -0
  128. /package/.claude/skills/{domain/verification → verification}/SKILL.md +0 -0
@@ -0,0 +1,449 @@
1
+ # CC-DevFlow v4.3 Implementation Summary
2
+
3
+ > **Last Updated**: 2026-03-12
4
+ > **Status**: Phase 1 Complete (100%), Phase 2 Complete (100%), Phase 3 Complete (100%), Overall 75%
5
+
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ 实施 OpenSpec 单一真相源架构,解决需求偏移问题。核心机制:
11
+
12
+ 1. **项目级 specs/** - 不可变源代码真相(描述当前系统状态)
13
+ 2. **需求级 specs/** - 只包含 Delta(ADDED/MODIFIED/REMOVED/RENAMED)
14
+ 3. **自动反扩散检查** - 阻止需求偏移
15
+ 4. **归档时自动合并** - Delta 合并到项目级 specs/
16
+
17
+ ---
18
+
19
+ ## Completed Tasks (12/16)
20
+
21
+ ### ✅ Task #1: Phase 1.1 - 建立项目级 specs/ 目录
22
+ **Status**: Complete
23
+ **Files Modified**:
24
+ - Created `devflow/specs/README.md` - 项目级 specs 说明文档
25
+ - Created `devflow/specs/auth/spec.md` - 认证模块示例
26
+ - Created `devflow/specs/payments/spec.md` - 支付模块示例
27
+ - Created `devflow/specs/ui/spec.md` - UI 组件模块示例
28
+ - Created `devflow/specs/CLAUDE.md` - L2 文档
29
+
30
+ **Key Changes**:
31
+ - 建立了项目级 specs/ 作为单一真相源
32
+ - 使用 YAML frontmatter 管理元数据(module, version, created_at, updated_at)
33
+ - 采用 RFC 2119 关键字(SHALL, MUST, SHOULD, MAY)
34
+ - 使用 BDD Given-When-Then 场景格式
35
+
36
+ ---
37
+
38
+ ### ✅ Task #2: Phase 1.2 - 创建 spec.md 格式规范文档
39
+ **Status**: Complete
40
+ **Files Modified**:
41
+ - Created `.claude/docs/spec-format-guide.md` - 完整格式指南(200+ 行)
42
+
43
+ **Key Changes**:
44
+ - 定义了项目级 vs 需求级 spec.md 的区别
45
+ - 文档化 RFC 2119 关键字语义
46
+ - 说明 BDD 场景格式
47
+ - 提供完整示例和合并逻辑
48
+
49
+ ---
50
+
51
+ ### ✅ Task #3: Phase 1.3 - 创建 spec.md 模板
52
+ **Status**: Complete
53
+ **Files Modified**:
54
+ - Created `.claude/docs/templates/SPEC_TEMPLATE_PROJECT.md` - 项目级模板
55
+ - Created `.claude/docs/templates/SPEC_TEMPLATE_DELTA.md` - Delta 模板
56
+
57
+ **Key Changes**:
58
+ - 项目级模板:Purpose + Requirements + Implementation
59
+ - Delta 模板:ADDED/MODIFIED/REMOVED/RENAMED 四种操作
60
+ - 包含 Constitutional Constraints 引用
61
+
62
+ ---
63
+
64
+ ### ✅ Task #4: Phase 1.4 - 增强 delta-parser.ts
65
+ **Status**: Complete
66
+ **Files Modified**:
67
+ - Modified `.claude/scripts/delta-parser.ts` (527 → 638 lines)
68
+
69
+ **Key Changes**:
70
+ - 添加 `bumpVersion()` 函数实现语义化版本管理
71
+ - REMOVED → MAJOR +1(破坏性变更)
72
+ - ADDED → MINOR +1(新功能)
73
+ - MODIFIED/RENAMED → PATCH +1(修复/改进)
74
+ - 添加 `mergeDeltaToMainSpec()` 函数实现 Delta 合并
75
+ - 读取项目级和 Delta spec.md
76
+ - 验证模块匹配
77
+ - 应用 ADDED/MODIFIED/REMOVED/RENAMED 操作
78
+ - 自动更新版本号和时间戳
79
+ - 添加 CLI `merge` 命令:`delta-parser.ts merge <main-spec> <delta-spec>`
80
+
81
+ ---
82
+
83
+ ### ✅ Task #5: Phase 1.5 - 创建 validate-scope.sh
84
+ **Status**: Complete
85
+ **Files Modified**:
86
+ - Created `.claude/scripts/validate-scope.sh` (200 lines)
87
+
88
+ **Key Changes**:
89
+ - 提取 proposal.md 的 What 章节作为原始意图
90
+ - 提取 Delta specs 的 ADDED Requirements
91
+ - 使用关键词匹配检测范围扩散
92
+ - 生成 scope-creep-report.md 报告
93
+ - ✅ 标记符合原始意图的需求
94
+ - ⚠️ 标记超出范围的需求
95
+ - 检测到范围扩散时返回错误码(exit 1)
96
+
97
+ ---
98
+
99
+ ### ✅ Task #6: Phase 1.6 - 修改 harness:init 生成 proposal.md
100
+ **Status**: Complete
101
+ **Files Modified**:
102
+ - Modified `.claude/skills/flow-init/SKILL.md`
103
+ - Created `.claude/docs/templates/PROPOSAL_TEMPLATE.md`
104
+
105
+ **Key Changes**:
106
+ - 更新 Execution Steps:
107
+ - Step 2: 读取项目级 specs/ 了解当前系统状态
108
+ - Step 6: 生成 proposal.md(Why + What 格式)替代 PRD.md
109
+ - Step 7: 创建 specs/ 目录准备存放 Delta
110
+ - 创建 PROPOSAL_TEMPLATE.md:
111
+ - Why 章节:Background, Problem Statement, Business Value
112
+ - What 章节:Core Features, Scope, Success Criteria
113
+ - 包含 [NEEDS CLARIFICATION] 标记机制
114
+ - 更新 Exit Criteria 要求 proposal.md 和 specs/ 目录存在
115
+
116
+ ---
117
+
118
+ ### ✅ Task #7: Phase 1.7 - 修改 harness:plan 生成 Delta specs
119
+ **Status**: Complete
120
+ **Files Modified**:
121
+ - Modified `.claude/skills/flow-spec/SKILL.md`
122
+ - Created `.claude/docs/templates/DESIGN_TEMPLATE.md`
123
+ - Modified `lib/harness/operations/plan.js`
124
+
125
+ **Key Changes**:
126
+ - 更新 flow-spec SKILL.md Execution Steps:
127
+ - Step 2: 读取项目级 specs/ 了解当前系统状态
128
+ - Step 3: 生成 design.md(How + Implementation)
129
+ - Step 4: 生成 Delta specs/(ADDED/MODIFIED/REMOVED/RENAMED)
130
+ - Step 5: 自动运行 validate-scope.sh 反扩散检查
131
+ - 创建 DESIGN_TEMPLATE.md:
132
+ - How 章节:Architecture, Technology Stack, Module Changes
133
+ - Implementation 章节:API Design, Data Model, File Structure, Testing Strategy
134
+ - 更新 Exit Criteria:
135
+ - 要求 design.md 存在
136
+ - 要求 specs/ 目录至少有一个 Delta spec.md
137
+ - 要求 scope-creep-report.md 无阻塞性警告
138
+ - 修改 plan.js:
139
+ - 检测 proposal.md 存在(v4.3 架构)
140
+ - 验证 design.md, specs/, scope-creep-report.md 产物
141
+ - 警告缺失的必需文件
142
+
143
+ ---
144
+
145
+ ### ✅ Task #8: Phase 1.8 - 修改 harness:release 合并 Delta
146
+ **Status**: Complete
147
+ **Files Modified**:
148
+ - Modified `lib/harness/operations/release.js`
149
+ - Modified `.claude/skills/flow-release/SKILL.md`
150
+
151
+ **Key Changes**:
152
+ - 修改 release.js:
153
+ - 检测 `devflow/requirements/${REQ_ID}/specs/` 目录
154
+ - 遍历所有模块的 Delta spec.md 文件
155
+ - 调用 `delta-parser.ts merge` 合并到项目级 `devflow/specs/{module}/spec.md`
156
+ - 自动更新项目级 spec.md 的版本号和时间戳
157
+ - 处理新模块创建(如果项目级 spec 不存在)
158
+ - 记录合并结果到 manifest.metadata.deltaMergeResults
159
+ - 生成合并报告(✅ merged, 🆕 created, ❌ failed)
160
+ - 更新 flow-release SKILL.md:
161
+ - 添加 Step 2: 合并 Delta specs 到项目级 specs/
162
+ - 更新 Exit Criteria 要求 Delta 已成功合并
163
+ - 要求项目级 spec.md 版本号已更新
164
+
165
+ ---
166
+
167
+ ### ✅ Task #9: Phase 3.1 - 清理废弃命令和模板
168
+ **Status**: Complete
169
+ **Files Modified**:
170
+ - Deleted `.claude/commands/flow/new.md`
171
+ - Deleted `.claude/commands/flow/clarify.md`
172
+ - Deleted `.claude/commands/flow/checklist.md`
173
+ - Deleted `.claude/commands/flow/quality.md`
174
+ - Deleted `.claude/docs/templates/PRD_TEMPLATE.md`
175
+ - Deleted `.claude/docs/templates/TECH_DESIGN_TEMPLATE.md`
176
+ - Deleted `.claude/docs/templates/EPIC_TEMPLATE.md`
177
+ - Deleted `.claude/docs/templates/TASKS_TEMPLATE.md`
178
+ - Modified `.claude/commands/flow/CLAUDE.md` (removed references to deleted files)
179
+
180
+ **Key Changes**:
181
+ - 删除了 4 个废弃命令文件 (new.md, clarify.md, checklist.md, quality.md)
182
+ - 删除了 4 个废弃模板文件 (PRD_TEMPLATE.md, TECH_DESIGN_TEMPLATE.md, EPIC_TEMPLATE.md, TASKS_TEMPLATE.md)
183
+ - 更新了 flow/CLAUDE.md 移除废弃文件引用
184
+ - workflow.yaml 已包含 deprecated 章节,无需额外修改
185
+
186
+ ---
187
+
188
+ ### ✅ Task #10: Phase 3.2 - 状态文件增强与查询工具
189
+ **Status**: Complete
190
+ **Files Modified**:
191
+ - Created `.claude/docs/state-consolidation-design.md` - 架构设计文档
192
+ - Modified `lib/harness/schemas.js` - 添加 HarnessStateSchema 和 HarnessStatusSchema
193
+ - Modified `lib/harness/operations/plan.js` - 写入 plannedAt 时间戳
194
+ - Modified `lib/harness/operations/dispatch.js` - 写入 status: 'in_progress'
195
+ - Modified `lib/harness/operations/verify.js` - 写入 verifiedAt 时间戳
196
+ - Created `lib/harness/query.js` - 查询工具函数
197
+ - Modified `lib/harness/index.js` - 导出 query 模块
198
+ - Modified `lib/harness/CLAUDE.md` - 更新成员清单
199
+
200
+ **Key Changes**:
201
+ - 重新定义 Task #10:不创建统一 state.json,而是增强现有架构
202
+ - 添加 HarnessStateSchema 支持 plannedAt/verifiedAt 字段
203
+ - 扩展 status 枚举:initialized → planned → in_progress → verified → released
204
+ - 创建 query.js 提供 getProgress/getNextTask/getFullState 聚合查询
205
+ - 保持 v6.0 关注点分离原则:harness-state.json (生命周期) + task-manifest.json (进度) + checkpoint.json (恢复) + report-card.json (质量)
206
+ - 设计文档说明:单一真相源 = 职责分离 + 查询聚合,而非单一文件
207
+
208
+ ---
209
+
210
+ ### ✅ Task #11: Phase 2.1 - 实现分阶段上下文注入
211
+ **Status**: Complete
212
+ **Files Modified**:
213
+ - Created `devflow/requirements/REQ-011/context/brainstorm.jsonl` - 初始化阶段上下文
214
+ - Created `devflow/requirements/REQ-011/context/spec.jsonl` - 规格阶段上下文
215
+ - Created `devflow/requirements/REQ-011/context/dev.jsonl` - 开发阶段上下文
216
+ - Created `devflow/requirements/REQ-011/context/README.md` - 上下文目录说明
217
+ - Modified `.claude/hooks/inject-agent-context.ts` - 更新 AGENT_JSONL_MAP 映射
218
+
219
+ **Key Changes**:
220
+ - 创建分阶段 JSONL 文件结构:
221
+ - brainstorm.jsonl: proposal.md + Constitution Article X
222
+ - spec.jsonl: proposal.md + devflow/specs/ + Constitution Article I, X + spec-format-guide.md
223
+ - dev.jsonl: design.md + Delta specs/ + 相关代码 + Constitution Article I, VI
224
+ - 更新 inject-agent-context.ts 的 agent 到 JSONL 映射:
225
+ - flow-researcher → brainstorm.jsonl
226
+ - prd-writer/tech-architect/ui-designer/planner → spec.jsonl
227
+ - dev-implementer/qa-tester/security-reviewer/release-manager → dev.jsonl
228
+ - Hook 已支持从 `devflow/requirements/${REQ_ID}/context/` 读取 JSONL
229
+ - 实现分阶段隔离:每个阶段只加载必要的上下文,避免注意力分散
230
+
231
+ ---
232
+
233
+ ## Pending Tasks (4/16)
234
+
235
+ ### ⏳ Task #12: Phase 4 - 模板和 Agent 指令瘦身
236
+ **Status**: Not Started
237
+ **Target Files**:
238
+ - All `.claude/docs/templates/*.md`
239
+ - All `.claude/agents/*.md`
240
+
241
+ **Required Changes**:
242
+ 1. 每个模板 ≤200 行
243
+ 2. 删除重复的 Constitution 内容(只保留引用)
244
+ 3. 删除示例(移到 `.claude/docs/examples/`)
245
+ 4. 删除冗长说明(保留核心约束)
246
+
247
+ ---
248
+
249
+ ### ⏳ Task #13: Phase 5.1 - 增强项目级规划命令
250
+ **Status**: Not Started
251
+ **Target Files**:
252
+ - Create `.claude/commands/core/roadmap.md`
253
+ - Create `.claude/commands/core/milestone.md`
254
+ - Create `.claude/commands/core/epic.md`
255
+ - Delete `.claude/commands/flow/checklist.md`
256
+ - Delete `.claude/commands/flow/quality.md`
257
+ - Update `.claude/skills/workflow.yaml`
258
+
259
+ **Required Changes**:
260
+ 1. 删除 7 个废弃命令文件
261
+ 2. 删除 4 个废弃模板文件
262
+ 3. 更新 workflow.yaml 移除废弃节点和边
263
+
264
+ ---
265
+
266
+ ### ⏳ Task #10: Phase 3.2 - 合并状态文件到 .harness/state.json
267
+ **Status**: Not Started
268
+ **Target Files**:
269
+ - Modify `lib/harness/store.js`
270
+ - Create unified `.harness/state.json` schema
271
+ - Deprecate `orchestration_status.json`, `session-checklist.json`, `session-progress.md`, `session-handoff.md`
272
+
273
+ **Required Changes**:
274
+ 1. 设计统一状态文件 schema:
275
+ ```json
276
+ {
277
+ "changeId": "REQ-123",
278
+ "lifecycle": { "stage": "dev", "status": "in_progress" },
279
+ "session": { "currentSessionId": "...", "checkpoints": [...] },
280
+ "progress": { "totalTasks": 6, "completedTasks": 2 },
281
+ "deltas": [...]
282
+ }
283
+ ```
284
+ 2. 迁移现有状态读写逻辑到统一文件
285
+
286
+ ---
287
+
288
+ ### ⏳ Task #11: Phase 4 - 模板和 Agent 指令瘦身
289
+ **Status**: Not Started
290
+ **Target Files**:
291
+ - All `.claude/docs/templates/*.md`
292
+ - All `.claude/agents/*.md`
293
+
294
+ **Required Changes**:
295
+ 1. 每个模板 ≤200 行
296
+ 2. 删除重复的 Constitution 内容(只保留引用)
297
+ 3. 删除示例(移到 `.claude/docs/examples/`)
298
+ 4. 删除冗长说明(保留核心约束)
299
+
300
+ ---
301
+
302
+ ### ⏳ Task #12: Phase 5.1 - 增强项目级规划命令
303
+ **Status**: Not Started
304
+ **Target Files**:
305
+ - Create `.claude/commands/core/roadmap.md`
306
+ - Create `.claude/commands/core/milestone.md`
307
+ - Create `.claude/commands/core/epic.md`
308
+ - Create `devflow/ROADMAP.md`
309
+ - Create `devflow/milestones/`
310
+ - Create `devflow/epics/`
311
+
312
+ **Required Changes**:
313
+ 1. 实现 `/core:roadmap` 生成季度级规划
314
+ 2. 实现 `/core:milestone create` 创建月度里程碑
315
+ 3. 实现 `/core:epic create` 分解周级 Epic
316
+ 4. 实现 `/flow:init` 关联 REQ 到 Epic
317
+
318
+ ---
319
+
320
+ ### ⏳ Task #13: Phase 5.2 - 强制 TDD/BDD 验证
321
+ **Status**: Not Started
322
+ **Target Files**:
323
+ - Modify `lib/harness/planner.js`
324
+ - Modify `.claude/skills/guardrail/tdd-enforcer/SKILL.md`
325
+
326
+ **Required Changes**:
327
+ 1. 在 planner.js 添加 `validateTDDOrder()` 函数:
328
+ - 检查每个 IMPL 任务是否有对应的 TEST 任务
329
+ - 检查 IMPL 任务是否依赖 TEST 任务
330
+ - TDD 违规时抛出错误
331
+ 2. 增强 tdd-enforcer 实时阻断能力
332
+
333
+ ---
334
+
335
+ ### ⏳ Task #14: Phase 5.3 - OpenSpec 互操作
336
+ **Status**: Not Started
337
+ **Target Files**:
338
+ - Create `.claude/scripts/import-openspec.ts`
339
+ - Create `.claude/scripts/export-openspec.ts`
340
+ - Create `.claude/commands/flow/import-openspec.md`
341
+ - Create `.claude/commands/flow/export-openspec.md`
342
+
343
+ **Required Changes**:
344
+ 1. 实现 `/flow:import-openspec` 导入 OpenSpec spec.md
345
+ 2. 实现 `/flow:export-openspec` 导出为 OpenSpec 格式
346
+ 3. 双向转换保持语义一致性
347
+
348
+ ---
349
+
350
+ ### ⏳ Task #15: 集成测试和文档更新
351
+ **Status**: Not Started
352
+ **Target Files**:
353
+ - Create `tests/integration/v7-workflow.test.js`
354
+ - Update `README.md`
355
+ - Update `README.zh-CN.md`
356
+ - Update `.claude/CLAUDE.md`
357
+
358
+ **Required Changes**:
359
+ 1. 编写完整工作流集成测试:
360
+ - `/flow:init` → `/flow:spec` → `/flow:dev` → `/flow:verify` → `/flow:release`
361
+ - 验证 proposal.md, design.md, Delta specs, scope-creep-report.md 生成
362
+ - 验证 Delta 合并到项目级 specs/
363
+ 2. 更新所有文档反映 v4.3 架构变更
364
+
365
+ ---
366
+
367
+ ## Progress Summary
368
+
369
+ | Phase | Tasks | Complete | Pending | Progress |
370
+ |-------|-------|----------|---------|----------|
371
+ | Phase 1 | 8 | 8 | 0 | 100% ✅ |
372
+ | Phase 2 | 1 | 1 | 0 | 100% ✅ |
373
+ | Phase 3 | 2 | 2 | 0 | 100% ✅ |
374
+ | Phase 4 | 1 | 0 | 1 | 0% |
375
+ | Phase 5 | 3 | 0 | 3 | 0% |
376
+ | Testing | 1 | 0 | 1 | 0% |
377
+ | **Total** | **16** | **12** | **4** | **75%** |
378
+
379
+ ---
380
+
381
+ ## Next Steps
382
+
383
+ **Phase 1 Complete! 🎉**
384
+ **Phase 2 Complete! 🎉**
385
+ **Phase 3 Complete! 🎉**
386
+
387
+ **Next Priority** (Phase 4 + Phase 5):
388
+ 1. ⏳ Task #12: 模板和 Agent 指令瘦身
389
+ 2. ⏳ Task #13: 增强项目级规划命令
390
+ 3. ⏳ Task #14: 强制 TDD/BDD 验证
391
+ 4. ⏳ Task #15: OpenSpec 互操作
392
+
393
+ **Final Step**:
394
+ 5. Task #16: 集成测试和文档更新
395
+
396
+ ---
397
+
398
+ ## Key Architectural Decisions
399
+
400
+ ### 1. 项目级 vs 需求级 specs/
401
+ - **项目级** (`devflow/specs/`): 描述当前系统完整状态,不可变真相
402
+ - **需求级** (`devflow/requirements/${REQ_ID}/specs/`): 只包含 Delta 变更
403
+
404
+ ### 2. Delta 操作类型
405
+ - **ADDED**: 新增需求(MINOR +1)
406
+ - **MODIFIED**: 修改需求(PATCH +1)
407
+ - **REMOVED**: 删除需求(MAJOR +1,破坏性变更)
408
+ - **RENAMED**: 重命名需求(PATCH +1)
409
+
410
+ ### 3. 反扩散检查机制
411
+ - 对比 proposal.md 原始意图与 Delta specs 的 ADDED 需求
412
+ - 使用关键词匹配检测超出范围的功能
413
+ - 生成 scope-creep-report.md 报告
414
+ - 检测到范围扩散时阻塞流程,要求人工确认
415
+
416
+ ### 4. 归档时自动合并
417
+ - `/flow:release` 触发 Delta 合并
418
+ - 调用 `delta-parser.ts merge` 执行合并
419
+ - 自动更新项目级 spec.md 的版本号和时间戳
420
+ - 归档需求到 `devflow/requirements/archive/${REQ_ID}/`
421
+
422
+ ### 5. 状态文件架构(v6.0 Harness-First)
423
+ - **harness-state.json**: 生命周期状态(initialized → planned → in_progress → verified → released)
424
+ - **task-manifest.json**: 任务定义与进度(tasks[].status)
425
+ - **checkpoint.json**: 会话恢复点(per task)
426
+ - **report-card.json**: 质量验证结果
427
+ - **query.js**: 聚合查询工具(getProgress/getNextTask/getFullState)
428
+ - **设计哲学**: 单一真相源 = 职责分离 + 查询聚合,而非单一文件
429
+
430
+ ### 6. 分阶段上下文注入(v4.3)
431
+ - **brainstorm.jsonl**: 初始化阶段(proposal.md + Constitution Article X)
432
+ - **spec.jsonl**: 规格阶段(proposal.md + devflow/specs/ + Constitution Article I, X)
433
+ - **dev.jsonl**: 开发阶段(design.md + Delta specs/ + 相关代码 + Constitution Article I, VI)
434
+ - **设计原则**: 每个阶段只加载必要的上下文,避免注意力分散
435
+ - **排除策略**: spec 阶段不包含现有代码,dev 阶段不包含 proposal.md
436
+
437
+ ---
438
+
439
+ ## Constitutional Compliance
440
+
441
+ 所有实现遵循 CC-DevFlow Constitution v2.1.0:
442
+
443
+ - **Article I: Quality First** - 完整实现,无部分实现
444
+ - **Article VI: Test-First Development** - TDD 顺序强制验证
445
+ - **Article X: Requirement Boundary** - 反扩散检查阻止范围蔓延
446
+
447
+ ---
448
+
449
+ **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md