cc-devflow 2.5.0 → 4.1.1

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 (192) hide show
  1. package/.claude/CLAUDE.md +1065 -53
  2. package/.claude/agents/dev-implementer.md +195 -0
  3. package/.claude/commands/{flow-archive.md → flow/archive.md} +46 -11
  4. package/.claude/commands/flow/context.md +150 -0
  5. package/.claude/commands/flow/delta.md +245 -0
  6. package/.claude/commands/{flow-dev.md → flow/dev.md} +112 -11
  7. package/.claude/commands/flow/init.md +45 -0
  8. package/.claude/commands/flow/new.md +279 -0
  9. package/.claude/commands/flow/quality.md +159 -0
  10. package/.claude/commands/flow/spec.md +186 -0
  11. package/.claude/commands/flow/workspace.md +146 -0
  12. package/.claude/commands/{cancel-ralph.md → util/cancel-ralph.md} +1 -0
  13. package/.claude/config/quality-gates.yml +305 -0
  14. package/.claude/docs/guides/TEAM_MODE_GUIDE.md +313 -0
  15. package/.claude/docs/templates/DELTA_SPEC_TEMPLATE.md +91 -0
  16. package/.claude/docs/templates/DESIGN_DECISIONS_TEMPLATE.md +151 -0
  17. package/.claude/docs/templates/JOURNAL_TEMPLATE.md +75 -0
  18. package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +51 -91
  19. package/.claude/docs/templates/_shared/CLAUDE.md +36 -0
  20. package/.claude/docs/templates/_shared/CONSTITUTION_CHECK.md +125 -0
  21. package/.claude/docs/templates/_shared/VALIDATION_CHECKLIST.md +187 -0
  22. package/.claude/docs/templates/_shared/YAML_FRONTMATTER.md +164 -0
  23. package/.claude/docs/templates/context/dev.jsonl.template +6 -0
  24. package/.claude/docs/templates/context/epic.jsonl.template +5 -0
  25. package/.claude/docs/templates/context/prd.jsonl.template +4 -0
  26. package/.claude/docs/templates/context/research.jsonl.template +4 -0
  27. package/.claude/docs/templates/context/review.jsonl.template +5 -0
  28. package/.claude/docs/templates/context/tech.jsonl.template +5 -0
  29. package/.claude/hooks/CLAUDE.md +342 -0
  30. package/.claude/hooks/inject-agent-context.ts +480 -0
  31. package/.claude/hooks/inject-skill-context.ts +359 -0
  32. package/.claude/hooks/ralph-loop.ts +931 -0
  33. package/.claude/hooks/task-completed-hook.ts +593 -0
  34. package/.claude/hooks/teammate-idle-hook.ts +690 -0
  35. package/.claude/hooks/types/team-types.d.ts +238 -0
  36. package/.claude/rules/devflow-conventions.md +82 -9
  37. package/.claude/scripts/archive-requirement.sh +44 -1
  38. package/.claude/scripts/common.sh +670 -3
  39. package/.claude/scripts/delta-parser.ts +527 -0
  40. package/.claude/scripts/detect-file-conflicts.sh +151 -0
  41. package/.claude/scripts/flow-context-add.sh +134 -0
  42. package/.claude/scripts/flow-context-init.sh +133 -0
  43. package/.claude/scripts/flow-context-validate.sh +144 -0
  44. package/.claude/scripts/flow-delta-apply.sh +297 -0
  45. package/.claude/scripts/flow-delta-archive.sh +71 -0
  46. package/.claude/scripts/flow-delta-create.sh +202 -0
  47. package/.claude/scripts/flow-delta-list.sh +142 -0
  48. package/.claude/scripts/flow-delta-status.sh +235 -0
  49. package/.claude/scripts/flow-quality-full.sh +184 -0
  50. package/.claude/scripts/flow-quality-quick.sh +64 -0
  51. package/.claude/scripts/flow-workspace-init.sh +117 -0
  52. package/.claude/scripts/flow-workspace-record.sh +164 -0
  53. package/.claude/scripts/flow-workspace-start.sh +88 -0
  54. package/.claude/scripts/get-workflow-status.sh +415 -0
  55. package/.claude/scripts/parse-task-dependencies.js +334 -0
  56. package/.claude/scripts/record-quality-error.sh +165 -0
  57. package/.claude/scripts/run-quality-gates.sh +242 -0
  58. package/.claude/scripts/team-dev-init.sh +319 -0
  59. package/.claude/scripts/team-state-recovery.sh +229 -0
  60. package/.claude/scripts/workflow-status.ts +433 -0
  61. package/.claude/settings.json +19 -0
  62. package/.claude/skills/cc-devflow-orchestrator/SKILL.md +85 -200
  63. package/.claude/skills/domain/using-git-worktrees/SKILL.md +252 -0
  64. package/.claude/skills/domain/using-git-worktrees/assets/SHELL_ALIASES.md +133 -0
  65. package/.claude/skills/domain/using-git-worktrees/context.jsonl +4 -0
  66. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-cleanup.sh +218 -0
  67. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-create.sh +232 -0
  68. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-list.sh +130 -0
  69. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-status.sh +140 -0
  70. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-switch.sh +70 -0
  71. package/.claude/skills/utility/skill-creator/LICENSE.txt +202 -0
  72. package/.claude/skills/utility/skill-creator/SKILL.md +356 -0
  73. package/.claude/skills/utility/skill-creator/references/output-patterns.md +82 -0
  74. package/.claude/skills/utility/skill-creator/references/workflows.md +28 -0
  75. package/.claude/skills/utility/skill-creator/scripts/init_skill.py +303 -0
  76. package/.claude/skills/utility/skill-creator/scripts/package_skill.py +110 -0
  77. package/.claude/skills/utility/skill-creator/scripts/quick_validate.py +95 -0
  78. package/.claude/skills/workflow/flow-dev/CLAUDE.md +78 -0
  79. package/.claude/skills/workflow/flow-dev/SKILL.md +96 -0
  80. package/.claude/skills/workflow/flow-dev/assets/IMPLEMENTATION_PLAN_TEMPLATE.md +71 -0
  81. package/.claude/skills/workflow/flow-dev/context.jsonl +8 -0
  82. package/.claude/skills/workflow/flow-dev/dev-implementer.jsonl +8 -0
  83. package/.claude/skills/workflow/flow-dev/scripts/entry-gate.sh +116 -0
  84. package/.claude/skills/workflow/flow-dev/scripts/exit-gate.sh +101 -0
  85. package/.claude/skills/workflow/flow-dev/scripts/task-orchestrator.sh +106 -0
  86. package/.claude/skills/workflow/flow-fix/SKILL.md +105 -0
  87. package/.claude/skills/workflow/flow-fix/context.jsonl +6 -0
  88. package/.claude/skills/workflow/flow-fix/references/bug-analyzer.md +381 -0
  89. package/.claude/skills/workflow/flow-init/SKILL.md +211 -0
  90. package/.claude/skills/workflow/flow-init/assets/BRAINSTORM_TEMPLATE.md +148 -0
  91. package/.claude/skills/workflow/flow-init/assets/INIT_FLOW_TEMPLATE.md +198 -0
  92. package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +276 -0
  93. package/.claude/skills/workflow/flow-init/context.jsonl +5 -0
  94. package/.claude/skills/workflow/flow-init/references/flow-researcher.md +132 -0
  95. package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +240 -0
  96. package/.claude/skills/workflow/flow-init/scripts/consolidate-research.sh +182 -0
  97. package/.claude/skills/workflow/flow-init/scripts/create-requirement.sh +523 -0
  98. package/.claude/skills/workflow/flow-init/scripts/generate-research-tasks.sh +157 -0
  99. package/.claude/skills/workflow/flow-init/scripts/populate-research-tasks.sh +284 -0
  100. package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +340 -0
  101. package/.claude/skills/workflow/flow-quality/SKILL.md +94 -0
  102. package/.claude/skills/workflow/flow-quality/context.jsonl +6 -0
  103. package/.claude/skills/workflow/flow-quality/references/code-quality-reviewer.md +205 -0
  104. package/.claude/skills/workflow/flow-quality/references/qa-tester.md +313 -0
  105. package/.claude/skills/workflow/flow-quality/references/security-reviewer.md +314 -0
  106. package/.claude/skills/workflow/flow-quality/references/spec-reviewer.md +221 -0
  107. package/.claude/skills/workflow/flow-release/SKILL.md +126 -0
  108. package/.claude/skills/workflow/flow-release/context.jsonl +7 -0
  109. package/.claude/skills/workflow/flow-release/references/release-manager.md +295 -0
  110. package/.claude/skills/workflow/flow-spec/CLAUDE.md +103 -0
  111. package/.claude/skills/workflow/flow-spec/SKILL.md +545 -0
  112. package/.claude/skills/workflow/flow-spec/context.jsonl +7 -0
  113. package/.claude/skills/workflow/flow-spec/scripts/entry-gate.sh +194 -0
  114. package/.claude/skills/workflow/flow-spec/scripts/exit-gate.sh +244 -0
  115. package/.claude/skills/workflow/flow-spec/scripts/parallel-orchestrator.sh +205 -0
  116. package/.claude/skills/workflow/flow-spec/scripts/team-communication.sh +353 -0
  117. package/.claude/skills/workflow/flow-spec/scripts/team-init.sh +195 -0
  118. package/.claude/skills/workflow/flow-spec/scripts/test-team-mode.sh +496 -0
  119. package/.claude/skills/workflow/flow-spec/team-config.json +165 -0
  120. package/.claude/skills/workflow.yaml +417 -0
  121. package/CHANGELOG.md +268 -0
  122. package/README.md +206 -50
  123. package/README.zh-CN.md +219 -57
  124. package/lib/compiler/CLAUDE.md +77 -46
  125. package/lib/compiler/__tests__/multi-module-emitters.test.js +508 -0
  126. package/lib/compiler/context-expander.js +179 -0
  127. package/lib/compiler/emitters/antigravity-emitter.js +195 -5
  128. package/lib/compiler/emitters/base-emitter.js +217 -2
  129. package/lib/compiler/emitters/codex-emitter.js +200 -4
  130. package/lib/compiler/emitters/cursor-emitter.js +307 -3
  131. package/lib/compiler/emitters/qwen-emitter.js +196 -4
  132. package/lib/compiler/index.js +197 -2
  133. package/lib/compiler/platforms.js +270 -21
  134. package/package.json +2 -2
  135. package/.claude/commands/flow-epic.md +0 -183
  136. package/.claude/commands/flow-init.md +0 -370
  137. package/.claude/commands/flow-new.md +0 -442
  138. package/.claude/commands/flow-prd.md +0 -144
  139. package/.claude/commands/flow-qa.md +0 -93
  140. package/.claude/commands/flow-review.md +0 -257
  141. package/.claude/commands/flow-tech.md +0 -142
  142. package/.claude/commands/flow-ui.md +0 -189
  143. package/.claude/skills/file-header-guardian/SKILL.md +0 -56
  144. package/.claude/skills/skill-developer/ADVANCED.md +0 -197
  145. package/.claude/skills/skill-developer/HOOK_MECHANISMS.md +0 -306
  146. package/.claude/skills/skill-developer/PATTERNS_LIBRARY.md +0 -152
  147. package/.claude/skills/skill-developer/SKILL.md +0 -426
  148. package/.claude/skills/skill-developer/SKILL_RULES_REFERENCE.md +0 -315
  149. package/.claude/skills/skill-developer/TRIGGER_TYPES.md +0 -305
  150. package/.claude/skills/skill-developer/TROUBLESHOOTING.md +0 -514
  151. package/.claude/skills/writing-skills/SKILL.md +0 -655
  152. package/.claude/skills/writing-skills/anthropic-best-practices.md +0 -1150
  153. package/.claude/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
  154. package/.claude/skills/writing-skills/graphviz-conventions.dot +0 -172
  155. package/.claude/skills/writing-skills/persuasion-principles.md +0 -187
  156. package/.claude/skills/writing-skills/render-graphs.js +0 -168
  157. package/.claude/skills/writing-skills/testing-skills-with-subagents.md +0 -384
  158. package/.claude/tsc-cache/795ba6e3-b98a-423b-bab2-51aa62812569/affected-repos.txt +0 -1
  159. package/.claude/tsc-cache/ae335694-be5a-4ba4-a1a0-b676c09a7906/affected-repos.txt +0 -1
  160. /package/.claude/commands/{core-architecture.md → core/architecture.md} +0 -0
  161. /package/.claude/commands/{core-guidelines.md → core/guidelines.md} +0 -0
  162. /package/.claude/commands/{core-roadmap.md → core/roadmap.md} +0 -0
  163. /package/.claude/commands/{core-style.md → core/style.md} +0 -0
  164. /package/.claude/commands/{flow-checklist.md → flow/checklist.md} +0 -0
  165. /package/.claude/commands/{flow-clarify.md → flow/clarify.md} +0 -0
  166. /package/.claude/commands/{flow-constitution.md → flow/constitution.md} +0 -0
  167. /package/.claude/commands/{flow-fix.md → flow/fix.md} +0 -0
  168. /package/.claude/commands/{flow-ideate.md → flow/ideate.md} +0 -0
  169. /package/.claude/commands/{flow-release.md → flow/release.md} +0 -0
  170. /package/.claude/commands/{flow-restart.md → flow/restart.md} +0 -0
  171. /package/.claude/commands/{flow-status.md → flow/status.md} +0 -0
  172. /package/.claude/commands/{flow-update.md → flow/update.md} +0 -0
  173. /package/.claude/commands/{flow-upgrade.md → flow/upgrade.md} +0 -0
  174. /package/.claude/commands/{flow-verify.md → flow/verify.md} +0 -0
  175. /package/.claude/commands/{code-review-high.md → util/code-review.md} +0 -0
  176. /package/.claude/commands/{git-commit.md → util/git-commit.md} +0 -0
  177. /package/.claude/commands/{problem-analyzer.md → util/problem-analyzer.md} +0 -0
  178. /package/.claude/skills/{flow-attention-refresh → domain/attention-refresh}/SKILL.md +0 -0
  179. /package/.claude/skills/{flow-brainstorming → domain/brainstorming}/SKILL.md +0 -0
  180. /package/.claude/skills/{flow-debugging → domain/debugging}/SKILL.md +0 -0
  181. /package/.claude/skills/{flow-finishing-branch → domain/finishing-branch}/SKILL.md +0 -0
  182. /package/.claude/skills/{flow-receiving-review → domain/receiving-review}/SKILL.md +0 -0
  183. /package/.claude/skills/{flow-tdd → domain/tdd}/SKILL.md +0 -0
  184. /package/.claude/skills/{verification-before-completion → domain/verification}/SKILL.md +0 -0
  185. /package/.claude/skills/{constitution-guardian → guardrail/constitution-guardian}/SKILL.md +0 -0
  186. /package/.claude/skills/{devflow-tdd-enforcer → guardrail/tdd-enforcer}/SKILL.md +0 -0
  187. /package/.claude/skills/{devflow-constitution-quick-ref → utility/constitution-quick-ref}/SKILL.md +0 -0
  188. /package/.claude/skills/{devflow-file-standards → utility/file-standards}/SKILL.md +0 -0
  189. /package/.claude/skills/{fractal-docs-generator → utility/fractal-docs}/SKILL.md +0 -0
  190. /package/.claude/skills/{journey-coherence-checker → utility/journey-checker}/SKILL.md +0 -0
  191. /package/.claude/skills/{journey-coherence-checker → utility/journey-checker}/pressure-scenarios.md +0 -0
  192. /package/.claude/skills/{npm-release → utility/npm-release}/SKILL.md +0 -0
@@ -1,77 +1,50 @@
1
1
  # Flow-New Orchestration Template
2
2
 
3
- > Execution flow for `/flow-new` one-shot requirement development
3
+ > Execution flow for `/flow-new` one-shot requirement development (v4.1)
4
4
 
5
5
  ---
6
6
 
7
7
  ## Stage Execution Skeleton
8
8
 
9
- ### [1/8] /flow-init
9
+ ### [1/6] /flow-init
10
10
  - 创建需求目录 + Git 分支
11
- - MCP 研究材料收集 (mandatory)
12
- - Exit Gate: 5-level quality check (research.md 完整性)
13
-
14
- ### [2/8] /flow-prd
15
- - 生成 PRD.md (用户故事 + GWT 验收标准)
16
- - Constitution 符合性检查
17
-
18
- ### [2.3/8] /flow-checklist (可选, 80% 门禁)
19
- - 触发条件: `quality-rules.yml` 中 `checklist_gate_enabled: true`
20
- - 生成 checklists/*.md (5 维度质量验证)
21
- - 闸门: 完成度 ≥ 80%
22
-
23
- ### [2.5/8] /flow-ui (条件触发)
24
- **UI Detection Logic** (JavaScript):
25
- ```javascript
26
- function detectUIRequirement(prdContent, projectRoot) {
27
- const uiKeywords = ['用户界面', '前端', 'Web页面', 'UI', '界面设计', '交互',
28
- '页面', '表单', '按钮', '导航', '布局', '组件'];
29
- const hasUIKeywords = uiKeywords.some(kw => prdContent.includes(kw));
30
- const hasFrontendStack = fs.existsSync(`${projectRoot}/package.json`);
31
- const isBackendOnly = prdContent.includes('纯后端');
32
- return (hasUIKeywords || hasFrontendStack) && !isBackendOnly;
33
- }
34
- ```
35
- - 输出: UI_PROTOTYPE.html + research/ui_design_strategy.md
36
- - 跳过: orchestration_status.json.ui_skipped = true
11
+ - 研究材料收集 + `BRAINSTORM.md` 初始化
12
+ - Exit Gate: `orchestration_status.status == initialized`
37
13
 
38
- ### [2.7/8] /flow-tech (必需)
39
- - 生成 TECH_DESIGN.md (7 sections: 架构/技术栈/数据模型/API/安全/性能/部署)
40
- - 输出: data-model.md + contracts/openapi.yaml + quickstart.md
41
- - Exit Gate: 所有 Section 1-7 完整
14
+ ### [2/6] /flow-clarify (可选)
15
+ - 触发条件: 需求歧义、边界冲突、验收标准不明确
16
+ - 输出: `clarifications/*.md`
17
+ - 若跳过: 标记 `clarify_skipped: true`
42
18
 
43
- ### [3/8] /flow-epic
44
- - Entry Gate: Checklist 完成度 80% (如果启用)
45
- - 生成 EPIC.md + TASKS.md
46
- - 验证: TASKS 覆盖 TECH_DESIGN.md 所有技术层
19
+ ### [3/6] /flow-spec
20
+ - 统一规格阶段: PRD Tech+UI(并行) Epic/TASKS
21
+ - 支持模式: `--skip-tech` / `--skip-ui`
22
+ - Exit Gate: 规格产物完整,`status = spec_complete`
47
23
 
48
- ### [4/8] /flow-dev
24
+ ### [4/6] /flow-dev
49
25
  **TDD 执行模式**:
50
26
  ```
51
27
  Phase 1: 分析现有代码
52
28
  Phase 2: 编写测试 (Tests First)
53
29
 
54
- TEST VERIFICATION CHECKPOINT → 测试必须先失败
30
+ TDD CHECKPOINT → 测试必须先失败
55
31
 
56
32
  Phase 3: 实现代码
57
33
  Phase 4: 测试验证 → 测试必须通过
58
- Phase 5: Git 提交并标记完成
59
34
  ```
60
- - 输出: 实现代码 + 测试代码 + TASKS.md 更新 (checkbox 标记)
61
-
62
- ### [5/8] /flow-qa --full
63
- **Exit Gate 检查**:
64
- - ✅ 所有测试通过
65
- - ✅ 代码覆盖率 ≥ 80%
66
- - ✅ 无高危安全问题
67
- - TypeScript 类型检查通过
68
- - 输出: TEST_REPORT.md + SECURITY_REPORT.md
69
-
70
- ### [6/8] /flow-release
71
- - 生成 RELEASE_PLAN.md
72
- - 更新 CLAUDE.md (如有架构变更)
73
- - 最终构建
74
- - 创建 GitHub Pull Request
35
+ - 输出: 实现代码 + 测试代码 + `TASKS.md` 勾选更新
36
+
37
+ ### [5/6] /flow-quality --full
38
+ **统一质量验证**:
39
+ - 规格合规审查
40
+ - 代码质量审查
41
+ - 安全扫描与测试门禁
42
+ - 输出: `SPEC_REVIEW.md`, `CODE_QUALITY_REVIEW.md`, `SECURITY_REPORT.md`
43
+
44
+ ### [6/6] /flow-release
45
+ - 生成 `RELEASE_PLAN.md`
46
+ - 执行发布分支策略(PR/merge/squash 等)
47
+ - 必要时更新 `CLAUDE.md`
75
48
 
76
49
  ---
77
50
 
@@ -83,65 +56,52 @@ Phase 5: Git 提交并标记完成
83
56
 
84
57
  需求: REQ-123 | 支持用户下单
85
58
 
86
- [1/8] ✅ 初始化完成
87
- [2/8] ✅ PRD生成完成
88
- [2.5/8] ✅ UI原型生成完成 ⚡️
89
- [2.7/8] 技术方案设计完成 🔧
90
- [3/8] Epic规划完成
91
- [4/8] 🔄 开发执行中... (8/18 已完成)
92
- [5/8] ⏳ 等待质量保证...
93
- [6/8] ⏳ 等待发布管理...
59
+ [1/6] ✅ 初始化完成
60
+ [2/6] ✅ 澄清完成 (可选)
61
+ [3/6] ✅ 统一规格完成
62
+ [4/6] 🔄 开发执行中... (8/18 已完成)
63
+ [5/6] 等待质量验证...
64
+ [6/6] 等待发布管理...
94
65
  ```
95
66
 
96
- **状态图标**:
97
- - ✅ 已完成
98
- - 🔄 执行中
99
- - ⏳ 等待执行
100
- - ⚡️ 条件触发已执行
101
- - 🔧 必需步骤已完成
102
-
103
67
  ---
104
68
 
105
69
  ## Output Structure
106
70
 
107
71
  ```
108
72
  devflow/requirements/${REQ_ID}/
109
- ├── research/ # [1/8]
110
- ├── PRD.md # [2/8]
111
- ├── checklists/*.md # [2.3/8] (可选)
112
- ├── UI_PROTOTYPE.html # [2.5/8] (条件)
113
- ├── TECH_DESIGN.md # [2.7/8]
114
- ├── data-model.md
115
- ├── contracts/openapi.yaml
116
- ├── quickstart.md
117
- ├── EPIC.md # [3/8]
118
- ├── TASKS.md # [4/8] (checkbox 标记任务完成状态)
119
- ├── TEST_REPORT.md # [5/8]
120
- ├── SECURITY_REPORT.md
121
- └── RELEASE_PLAN.md # [6/8]
73
+ ├── BRAINSTORM.md
74
+ ├── research/
75
+ ├── clarifications/ # 可选
76
+ ├── PRD.md
77
+ ├── TECH_DESIGN.md # 若未跳过 tech
78
+ ├── UI_PROTOTYPE.html # 若未跳过 ui 且识别到 UI 需求
79
+ ├── EPIC.md
80
+ ├── TASKS.md
81
+ ├── SPEC_REVIEW.md # flow-quality --full
82
+ ├── CODE_QUALITY_REVIEW.md # flow-quality --full
83
+ ├── SECURITY_REPORT.md # flow-quality --full
84
+ └── RELEASE_PLAN.md
122
85
  ```
123
86
 
124
87
  ---
125
88
 
126
89
  ## Status Tracking
127
90
 
128
- **orchestration_status.json 关键字段**:
91
+ **orchestration_status.json 推荐字段**:
129
92
  ```json
130
93
  {
131
94
  "status": "dev_complete",
132
95
  "phase": "execution",
133
- "phase0_complete": true,
134
- "prd_complete": true,
135
- "checklist_complete": true, // 如果启用
136
- "ui_skipped": false, // 或 ui_complete: true
137
- "tech_design_complete": true,
138
- "epic_complete": true,
96
+ "initialized": true,
97
+ "clarify_complete": true,
98
+ "spec_complete": true,
139
99
  "dev_complete": true,
140
- "qa_complete": false,
100
+ "quality_complete": false,
141
101
  "release_complete": false
142
102
  }
143
103
  ```
144
104
 
145
105
  ---
146
106
 
147
- **Last Updated**: 2025-12-19
107
+ **Last Updated**: 2026-02-07
@@ -0,0 +1,36 @@
1
+ # _shared/ - Shared Template Components
2
+
3
+ > L2 | 父级: `.claude/docs/templates/CLAUDE.md`
4
+
5
+ ## Purpose
6
+
7
+ Reusable template components extracted from PRD/EPIC/TECH_DESIGN/UI_PROTOTYPE templates to reduce duplication and ensure consistency.
8
+
9
+ ## Members
10
+
11
+ | File | Purpose | Lines | Used By |
12
+ |------|---------|-------|---------|
13
+ | `CONSTITUTION_CHECK.md` | Constitution compliance check section | ~150 | PRD, EPIC, TECH_DESIGN |
14
+ | `VALIDATION_CHECKLIST.md` | Validation checklist patterns | ~100 | All templates |
15
+ | `YAML_FRONTMATTER.md` | YAML frontmatter patterns | ~50 | All templates |
16
+
17
+ ## Usage Pattern
18
+
19
+ Templates reference these components via include syntax:
20
+ ```markdown
21
+ {{INCLUDE: _shared/CONSTITUTION_CHECK.md}}
22
+ {{INCLUDE: _shared/VALIDATION_CHECKLIST.md#prd}}
23
+ ```
24
+
25
+ Or copy relevant sections based on document type.
26
+
27
+ ## Design Principles
28
+
29
+ 1. **DRY**: Extract repeated content once, reference everywhere
30
+ 2. **Consistency**: Single source of truth for Constitution checks
31
+ 3. **Modularity**: Each component is self-contained
32
+ 4. **Versioned**: Components track Constitution version
33
+
34
+ ---
35
+
36
+ [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
@@ -0,0 +1,125 @@
1
+ # Constitution Check Template Component
2
+
3
+ > **Purpose**: Shared Constitution compliance check section for PRD/EPIC/TECH_DESIGN templates
4
+ > **Version**: 1.0.0
5
+ > **Reference**: `.claude/rules/project-constitution.md` (v2.1.0)
6
+
7
+ ---
8
+
9
+ ## Usage
10
+
11
+ Include this component in templates via reference:
12
+ ```markdown
13
+ {{INCLUDE: _shared/CONSTITUTION_CHECK.md}}
14
+ ```
15
+
16
+ Or copy relevant sections based on document type.
17
+
18
+ ---
19
+
20
+ ## Constitution Check (宪法符合性检查)
21
+
22
+ *GATE: 必须在下一阶段前通过*
23
+
24
+ ### Article I: Quality First (质量至上)
25
+
26
+ - [ ] **I.1 - NO PARTIAL IMPLEMENTATION**: 内容完整且明确?无占位符和模糊表述?
27
+ - [ ] **I.2 - Testing Mandate**: 测试策略明确?覆盖率目标 ≥80%?
28
+ - [ ] **I.3 - No Simplification**: 避免"暂时简化,后续完善"的描述?
29
+ - [ ] **I.4 - Quality Gates**: 验收标准具体、可测试、可衡量?
30
+
31
+ ### Article II: Architectural Consistency (架构一致性)
32
+
33
+ - [ ] **II.1 - NO CODE DUPLICATION**: 识别可复用的现有系统和组件?
34
+ - [ ] **II.2 - Consistent Naming**: 命名约定遵循现有代码库模式?
35
+ - [ ] **II.3 - Anti-Over-Engineering**: 解决方案适合问题规模?无过度设计?
36
+ - [ ] **II.4 - Single Responsibility**: 清晰的边界和职责划分?
37
+
38
+ ### Article III: Security First (安全优先)
39
+
40
+ - [ ] **III.1 - NO HARDCODED SECRETS**: 定义了密钥管理策略(环境变量/密钥服务)?
41
+ - [ ] **III.2 - Input Validation**: 输入验证需求明确?
42
+ - [ ] **III.3 - Least Privilege**: 身份验证/授权机制清晰?
43
+ - [ ] **III.4 - Secure by Default**: 数据加密策略定义?
44
+
45
+ ### Article IV: Performance Accountability (性能责任)
46
+
47
+ - [ ] **IV.1 - NO RESOURCE LEAKS**: 考虑了资源管理(连接、文件句柄等)?
48
+ - [ ] **IV.2 - Algorithm Efficiency**: 性能目标现实且可测量?
49
+ - [ ] **IV.3 - Lazy Loading**: 按需加载策略规划?
50
+ - [ ] **IV.4 - Caching Strategy**: 规划了监控和缓存策略?
51
+
52
+ ### Article V: Maintainability (可维护性)
53
+
54
+ - [ ] **V.1 - NO DEAD CODE**: 避免不必要的功能?仅实现明确需求?
55
+ - [ ] **V.2 - Separation of Concerns**: 代码易于理解和修改?
56
+ - [ ] **V.3 - Documentation**: 文档完整(架构、API、配置)?
57
+ - [ ] **V.4 - File Size Limits**: 遵循单一职责原则?单文件 ≤500行?
58
+
59
+ ### Article VI: Test-First Development (测试优先开发)
60
+
61
+ - [ ] **VI.1 - TDD Mandate**: TDD 流程明确定义?
62
+ - [ ] **VI.2 - Test Independence**: 测试隔离策略定义?
63
+ - [ ] **VI.3 - Meaningful Tests**: 测试质量标准明确?
64
+
65
+ ### Article X: Requirement Boundary (需求边界)
66
+
67
+ - [ ] **X.1 - Forced Clarification**: 所有不明确之处标记 `[NEEDS CLARIFICATION]`?
68
+ - [ ] **X.2 - No Speculative Features**: 无"可能需要"、"未来会"、"建议添加"的功能?
69
+ - [ ] **X.3 - User Story Independence**: 每个故事有明确优先级和独立测试标准?
70
+
71
+ ---
72
+
73
+ ## Phase -1 Gates (前置闸门)
74
+
75
+ *仅适用于 EPIC/TECH_DESIGN*
76
+
77
+ ### Simplicity Gate (Article VII)
78
+
79
+ - [ ] **项目数量**: 使用 ≤3 个项目/模块?
80
+ - [ ] **NO FUTURE-PROOFING**: 没有为"未来可能需要"的功能做准备?
81
+ - [ ] **Minimal Dependencies**: 只使用必需的依赖库?
82
+
83
+ ### Anti-Abstraction Gate (Article VIII)
84
+
85
+ - [ ] **Framework Trust**: 直接使用框架功能,没有封装?
86
+ - [ ] **Single Model Representation**: 实体只有一种数据表示?
87
+ - [ ] **No Unnecessary Interfaces**: 没有单一实现的接口?
88
+
89
+ ### Integration-First Gate (Article IX)
90
+
91
+ - [ ] **Contracts Defined First**: API contracts 在实现前定义?
92
+ - [ ] **Contract Tests Planned**: Contract tests 在 Phase 2 计划?
93
+ - [ ] **Real Environment**: 使用真实数据库而非 mocks?
94
+
95
+ ---
96
+
97
+ ## Constitutional Violations (宪法违规记录)
98
+
99
+ *仅在有需要说明的宪法违规时填写*
100
+
101
+ **重要**: 任何违规都必须有充分理由,否则文档不通过
102
+
103
+ | 违规的 Article | 具体违规内容 | 为何需要 | 缓解措施 |
104
+ |----------------|-------------|----------|----------|
105
+ | {{ARTICLE_NUM}} | {{VIOLATION_DETAIL}} | {{JUSTIFICATION}} | {{MITIGATION}} |
106
+
107
+ ---
108
+
109
+ ## Gate Status Summary
110
+
111
+ | Gate | Status | Notes |
112
+ |------|--------|-------|
113
+ | Article I-V Core | {{PASS/FAIL}} | {{NOTES}} |
114
+ | Article VI TDD | {{PASS/FAIL}} | {{NOTES}} |
115
+ | Article VII Simplicity | {{PASS/FAIL}} | {{NOTES}} |
116
+ | Article VIII Anti-Abstraction | {{PASS/FAIL}} | {{NOTES}} |
117
+ | Article IX Integration-First | {{PASS/FAIL}} | {{NOTES}} |
118
+ | Article X Boundary | {{PASS/FAIL}} | {{NOTES}} |
119
+
120
+ **Overall Status**: {{PASS/FAIL}}
121
+ **Ready for Next Phase**: {{YES/NO}}
122
+
123
+ ---
124
+
125
+ [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
@@ -0,0 +1,187 @@
1
+ # Validation Checklist Template Component
2
+
3
+ > **Purpose**: Shared validation checklist section for all spec templates
4
+ > **Version**: 1.0.0
5
+ > **Usage**: Include relevant sections based on document type
6
+
7
+ ---
8
+
9
+ ## Usage
10
+
11
+ Include this component in templates via reference:
12
+ ```markdown
13
+ {{INCLUDE: _shared/VALIDATION_CHECKLIST.md#prd}}
14
+ {{INCLUDE: _shared/VALIDATION_CHECKLIST.md#epic}}
15
+ {{INCLUDE: _shared/VALIDATION_CHECKLIST.md#tech}}
16
+ {{INCLUDE: _shared/VALIDATION_CHECKLIST.md#ui}}
17
+ ```
18
+
19
+ ---
20
+
21
+ ## Common Validation Items
22
+
23
+ ### Content Completeness
24
+
25
+ - [ ] 所有必需章节已填写
26
+ - [ ] 没有 {{PLACEHOLDER}} 未替换
27
+ - [ ] 没有 TODO 或 TBD 标记
28
+ - [ ] 所有引用的文件存在
29
+
30
+ ### Quality Standards
31
+
32
+ - [ ] 语言清晰、无歧义
33
+ - [ ] 格式一致、结构清晰
34
+ - [ ] 无重复内容
35
+ - [ ] 无矛盾描述
36
+
37
+ ### Constitution Compliance
38
+
39
+ - [ ] 通过所有宪法检查
40
+ - [ ] 违规已文档化并说明理由
41
+ - [ ] 安全要求符合 NO HARDCODED SECRETS
42
+ - [ ] 质量要求符合 NO PARTIAL IMPLEMENTATION
43
+
44
+ ---
45
+
46
+ ## PRD-Specific Validation {#prd}
47
+
48
+ ### 需求不扩散验证
49
+
50
+ - [ ] **NO SPECULATION**: 所有功能都由用户明确提出或必需
51
+ - [ ] **ALL CLARIFIED**: 没有未解决的 [NEEDS CLARIFICATION] 标记
52
+ - [ ] **NO TECH DETAILS**: 没有技术实现细节(API, 数据库, 框架等)
53
+ - [ ] **STORY INDEPENDENCE**: 每个故事都有 Independent Test 标准
54
+ - [ ] **PRIORITY ASSIGNED**: 所有故事都有明确优先级 (P1, P2, P3...)
55
+ - [ ] **MVP IDENTIFIED**: P1 故事能够作为独立 MVP 交付
56
+
57
+ ### 用户故事质量 (INVEST 原则)
58
+
59
+ - [ ] **Independent**: 每个故事可独立交付和测试
60
+ - [ ] **Negotiable**: 细节可以讨论,实现方式灵活
61
+ - [ ] **Valuable**: 有明确的用户/业务价值
62
+ - [ ] **Estimable**: 可以估算工作量
63
+ - [ ] **Small**: 可在一个迭代内完成
64
+ - [ ] **Testable**: 有明确的验收标准和测试方法
65
+
66
+ ### 验收标准质量
67
+
68
+ - [ ] 使用 Given-When-Then 格式
69
+ - [ ] 包含正常流程(Happy Path)
70
+ - [ ] 包含边界情况(Edge Cases)
71
+ - [ ] 包含错误场景(Error Handling)
72
+ - [ ] 具体且可测试(非模糊描述)
73
+
74
+ ---
75
+
76
+ ## EPIC-Specific Validation {#epic}
77
+
78
+ ### PRD 对齐
79
+
80
+ - [ ] 所有用户故事已映射到 Epic
81
+ - [ ] 所有验收标准已包含
82
+ - [ ] 成功指标与 PRD 一致
83
+ - [ ] 技术约束已考虑
84
+
85
+ ### 技术方案完整性
86
+
87
+ - [ ] 架构设计清晰
88
+ - [ ] 数据模型完整
89
+ - [ ] API 契约定义
90
+ - [ ] 技术栈选型合理
91
+
92
+ ### TDD 准备
93
+
94
+ - [ ] Phase 2 明确定义为"Tests First"
95
+ - [ ] TEST VERIFICATION CHECKPOINT 已标记
96
+ - [ ] 测试策略明确
97
+ - [ ] Phase 3 依赖 Phase 2 完成
98
+
99
+ ### 可执行性
100
+
101
+ - [ ] 实施阶段清晰
102
+ - [ ] 依赖已识别
103
+ - [ ] 资源需求明确
104
+ - [ ] 风险已评估
105
+
106
+ ---
107
+
108
+ ## TECH_DESIGN-Specific Validation {#tech}
109
+
110
+ ### 技术完整性
111
+
112
+ - [ ] **Section 1**: System Architecture - Complete
113
+ - [ ] **Section 2**: Technology Stack - Complete with versions
114
+ - [ ] **Section 3**: Data Model Design - Complete
115
+ - [ ] **Section 4**: API Design - Complete
116
+ - [ ] **Section 5**: Security Design - Complete
117
+ - [ ] **Section 6**: Performance Design - Complete
118
+ - [ ] **Section 7**: Constitution Check - Complete
119
+
120
+ ### 技术规范
121
+
122
+ - [ ] 所有技术都有具体版本号
123
+ - [ ] 所有表都有主键和关系定义
124
+ - [ ] 所有 API 端点都有请求/响应 schema
125
+ - [ ] 所有密钥使用环境变量
126
+
127
+ ### Baseline Adherence
128
+
129
+ - [ ] 所有 baseline 技术已复用
130
+ - [ ] 所有新技术都有 PRD 需求支撑
131
+ - [ ] 无不必要的重构
132
+
133
+ ---
134
+
135
+ ## UI_PROTOTYPE-Specific Validation {#ui}
136
+
137
+ ### Anti-Generic-Design
138
+
139
+ - [ ] 无占位图片(所有图片使用 Picsum URL)
140
+ - [ ] 无常见 AI 紫色/蓝色配色
141
+ - [ ] 无 Emoji 图标(使用 SVG 或图标库)
142
+ - [ ] 无 Lorem Ipsum 占位文本
143
+
144
+ ### 设计系统
145
+
146
+ - [ ] 色彩系统完整(主/辅/中性/状态)
147
+ - [ ] 字体系统支持中英文混排
148
+ - [ ] 间距系统基于统一基准
149
+ - [ ] 响应式断点定义(至少 3 个)
150
+
151
+ ### 交互完整性
152
+
153
+ - [ ] SPA 路由系统正常工作
154
+ - [ ] 所有按钮/链接有点击交互
155
+ - [ ] 表单有验证逻辑
156
+ - [ ] 模态框可打开/关闭
157
+
158
+ ### 响应式
159
+
160
+ - [ ] 在 320px 宽度下页面可用
161
+ - [ ] 在 768px 宽度下页面可用
162
+ - [ ] 在 1280px 宽度下页面可用
163
+ - [ ] 所有 Touch Targets ≥ 44px
164
+
165
+ ---
166
+
167
+ ## Progress Tracking
168
+
169
+ ### 完成状态
170
+
171
+ - [ ] 所有必需章节完成
172
+ - [ ] Constitution Check 通过
173
+ - [ ] 质量检查通过
174
+
175
+ ### 闸门状态
176
+
177
+ | Gate | Status |
178
+ |------|--------|
179
+ | Constitution Check | {{PASS/FAIL}} |
180
+ | Completeness | {{PASS/FAIL}} |
181
+ | Quality | {{PASS/FAIL}} |
182
+
183
+ **Ready for Next Phase**: {{YES/NO}}
184
+
185
+ ---
186
+
187
+ [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md