cc-devflow 2.4.6 → 4.1.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 (191) hide show
  1. package/.claude/CLAUDE.md +1065 -48
  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/quality.md +159 -0
  9. package/.claude/commands/flow/spec.md +186 -0
  10. package/.claude/commands/flow/workspace.md +146 -0
  11. package/.claude/commands/{cancel-ralph.md → util/cancel-ralph.md} +1 -0
  12. package/.claude/config/quality-gates.yml +305 -0
  13. package/.claude/docs/guides/TEAM_MODE_GUIDE.md +313 -0
  14. package/.claude/docs/templates/DELTA_SPEC_TEMPLATE.md +91 -0
  15. package/.claude/docs/templates/DESIGN_DECISIONS_TEMPLATE.md +151 -0
  16. package/.claude/docs/templates/JOURNAL_TEMPLATE.md +75 -0
  17. package/.claude/docs/templates/_shared/CLAUDE.md +36 -0
  18. package/.claude/docs/templates/_shared/CONSTITUTION_CHECK.md +125 -0
  19. package/.claude/docs/templates/_shared/VALIDATION_CHECKLIST.md +187 -0
  20. package/.claude/docs/templates/_shared/YAML_FRONTMATTER.md +164 -0
  21. package/.claude/docs/templates/context/dev.jsonl.template +6 -0
  22. package/.claude/docs/templates/context/epic.jsonl.template +5 -0
  23. package/.claude/docs/templates/context/prd.jsonl.template +4 -0
  24. package/.claude/docs/templates/context/research.jsonl.template +4 -0
  25. package/.claude/docs/templates/context/review.jsonl.template +5 -0
  26. package/.claude/docs/templates/context/tech.jsonl.template +5 -0
  27. package/.claude/hooks/CLAUDE.md +342 -0
  28. package/.claude/hooks/inject-agent-context.ts +480 -0
  29. package/.claude/hooks/inject-skill-context.ts +359 -0
  30. package/.claude/hooks/ralph-loop.ts +931 -0
  31. package/.claude/hooks/task-completed-hook.ts +593 -0
  32. package/.claude/hooks/teammate-idle-hook.ts +690 -0
  33. package/.claude/hooks/types/team-types.d.ts +238 -0
  34. package/.claude/rules/devflow-conventions.md +82 -9
  35. package/.claude/scripts/archive-requirement.sh +44 -1
  36. package/.claude/scripts/common.sh +670 -3
  37. package/.claude/scripts/delta-parser.ts +527 -0
  38. package/.claude/scripts/detect-file-conflicts.sh +151 -0
  39. package/.claude/scripts/flow-context-add.sh +134 -0
  40. package/.claude/scripts/flow-context-init.sh +133 -0
  41. package/.claude/scripts/flow-context-validate.sh +144 -0
  42. package/.claude/scripts/flow-delta-apply.sh +297 -0
  43. package/.claude/scripts/flow-delta-archive.sh +71 -0
  44. package/.claude/scripts/flow-delta-create.sh +202 -0
  45. package/.claude/scripts/flow-delta-list.sh +142 -0
  46. package/.claude/scripts/flow-delta-status.sh +235 -0
  47. package/.claude/scripts/flow-quality-full.sh +184 -0
  48. package/.claude/scripts/flow-quality-quick.sh +64 -0
  49. package/.claude/scripts/flow-workspace-init.sh +117 -0
  50. package/.claude/scripts/flow-workspace-record.sh +164 -0
  51. package/.claude/scripts/flow-workspace-start.sh +88 -0
  52. package/.claude/scripts/get-workflow-status.sh +415 -0
  53. package/.claude/scripts/parse-task-dependencies.js +334 -0
  54. package/.claude/scripts/record-quality-error.sh +165 -0
  55. package/.claude/scripts/run-quality-gates.sh +242 -0
  56. package/.claude/scripts/team-dev-init.sh +319 -0
  57. package/.claude/scripts/team-state-recovery.sh +229 -0
  58. package/.claude/scripts/workflow-status.ts +433 -0
  59. package/.claude/settings.json +19 -0
  60. package/.claude/skills/cc-devflow-orchestrator/SKILL.md +85 -200
  61. package/.claude/skills/domain/using-git-worktrees/SKILL.md +252 -0
  62. package/.claude/skills/domain/using-git-worktrees/assets/SHELL_ALIASES.md +133 -0
  63. package/.claude/skills/domain/using-git-worktrees/context.jsonl +4 -0
  64. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-cleanup.sh +218 -0
  65. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-create.sh +232 -0
  66. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-list.sh +130 -0
  67. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-status.sh +140 -0
  68. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-switch.sh +70 -0
  69. package/.claude/skills/skill-rules.json +72 -1
  70. package/.claude/skills/utility/journey-checker/SKILL.md +199 -0
  71. package/.claude/skills/utility/journey-checker/pressure-scenarios.md +164 -0
  72. package/.claude/skills/utility/skill-creator/LICENSE.txt +202 -0
  73. package/.claude/skills/utility/skill-creator/SKILL.md +356 -0
  74. package/.claude/skills/utility/skill-creator/references/output-patterns.md +82 -0
  75. package/.claude/skills/utility/skill-creator/references/workflows.md +28 -0
  76. package/.claude/skills/utility/skill-creator/scripts/init_skill.py +303 -0
  77. package/.claude/skills/utility/skill-creator/scripts/package_skill.py +110 -0
  78. package/.claude/skills/utility/skill-creator/scripts/quick_validate.py +95 -0
  79. package/.claude/skills/workflow/flow-dev/CLAUDE.md +78 -0
  80. package/.claude/skills/workflow/flow-dev/SKILL.md +96 -0
  81. package/.claude/skills/workflow/flow-dev/assets/IMPLEMENTATION_PLAN_TEMPLATE.md +71 -0
  82. package/.claude/skills/workflow/flow-dev/context.jsonl +8 -0
  83. package/.claude/skills/workflow/flow-dev/dev-implementer.jsonl +8 -0
  84. package/.claude/skills/workflow/flow-dev/scripts/entry-gate.sh +116 -0
  85. package/.claude/skills/workflow/flow-dev/scripts/exit-gate.sh +101 -0
  86. package/.claude/skills/workflow/flow-dev/scripts/task-orchestrator.sh +106 -0
  87. package/.claude/skills/workflow/flow-fix/SKILL.md +105 -0
  88. package/.claude/skills/workflow/flow-fix/context.jsonl +6 -0
  89. package/.claude/skills/workflow/flow-fix/references/bug-analyzer.md +381 -0
  90. package/.claude/skills/workflow/flow-init/SKILL.md +211 -0
  91. package/.claude/skills/workflow/flow-init/assets/BRAINSTORM_TEMPLATE.md +148 -0
  92. package/.claude/skills/workflow/flow-init/assets/INIT_FLOW_TEMPLATE.md +198 -0
  93. package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +276 -0
  94. package/.claude/skills/workflow/flow-init/context.jsonl +5 -0
  95. package/.claude/skills/workflow/flow-init/references/flow-researcher.md +132 -0
  96. package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +232 -0
  97. package/.claude/skills/workflow/flow-init/scripts/consolidate-research.sh +182 -0
  98. package/.claude/skills/workflow/flow-init/scripts/create-requirement.sh +515 -0
  99. package/.claude/skills/workflow/flow-init/scripts/generate-research-tasks.sh +157 -0
  100. package/.claude/skills/workflow/flow-init/scripts/populate-research-tasks.sh +284 -0
  101. package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +332 -0
  102. package/.claude/skills/workflow/flow-quality/SKILL.md +94 -0
  103. package/.claude/skills/workflow/flow-quality/context.jsonl +6 -0
  104. package/.claude/skills/workflow/flow-quality/references/code-quality-reviewer.md +205 -0
  105. package/.claude/skills/workflow/flow-quality/references/qa-tester.md +313 -0
  106. package/.claude/skills/workflow/flow-quality/references/security-reviewer.md +314 -0
  107. package/.claude/skills/workflow/flow-quality/references/spec-reviewer.md +221 -0
  108. package/.claude/skills/workflow/flow-release/SKILL.md +126 -0
  109. package/.claude/skills/workflow/flow-release/context.jsonl +7 -0
  110. package/.claude/skills/workflow/flow-release/references/release-manager.md +295 -0
  111. package/.claude/skills/workflow/flow-spec/CLAUDE.md +103 -0
  112. package/.claude/skills/workflow/flow-spec/SKILL.md +545 -0
  113. package/.claude/skills/workflow/flow-spec/context.jsonl +7 -0
  114. package/.claude/skills/workflow/flow-spec/scripts/entry-gate.sh +194 -0
  115. package/.claude/skills/workflow/flow-spec/scripts/exit-gate.sh +244 -0
  116. package/.claude/skills/workflow/flow-spec/scripts/parallel-orchestrator.sh +205 -0
  117. package/.claude/skills/workflow/flow-spec/scripts/team-communication.sh +353 -0
  118. package/.claude/skills/workflow/flow-spec/scripts/team-init.sh +195 -0
  119. package/.claude/skills/workflow/flow-spec/scripts/test-team-mode.sh +496 -0
  120. package/.claude/skills/workflow/flow-spec/team-config.json +165 -0
  121. package/.claude/skills/workflow.yaml +417 -0
  122. package/CHANGELOG.md +254 -0
  123. package/README.md +193 -33
  124. package/README.zh-CN.md +206 -46
  125. package/lib/compiler/CLAUDE.md +77 -46
  126. package/lib/compiler/__tests__/multi-module-emitters.test.js +508 -0
  127. package/lib/compiler/context-expander.js +179 -0
  128. package/lib/compiler/emitters/antigravity-emitter.js +195 -5
  129. package/lib/compiler/emitters/base-emitter.js +217 -2
  130. package/lib/compiler/emitters/codex-emitter.js +200 -4
  131. package/lib/compiler/emitters/cursor-emitter.js +307 -3
  132. package/lib/compiler/emitters/qwen-emitter.js +196 -4
  133. package/lib/compiler/index.js +197 -2
  134. package/lib/compiler/platforms.js +270 -21
  135. package/package.json +1 -1
  136. package/.claude/commands/flow-epic.md +0 -183
  137. package/.claude/commands/flow-init.md +0 -370
  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-new.md → flow/new.md} +0 -0
  170. /package/.claude/commands/{flow-release.md → flow/release.md} +0 -0
  171. /package/.claude/commands/{flow-restart.md → flow/restart.md} +0 -0
  172. /package/.claude/commands/{flow-status.md → flow/status.md} +0 -0
  173. /package/.claude/commands/{flow-update.md → flow/update.md} +0 -0
  174. /package/.claude/commands/{flow-upgrade.md → flow/upgrade.md} +0 -0
  175. /package/.claude/commands/{flow-verify.md → flow/verify.md} +0 -0
  176. /package/.claude/commands/{code-review-high.md → util/code-review.md} +0 -0
  177. /package/.claude/commands/{git-commit.md → util/git-commit.md} +0 -0
  178. /package/.claude/commands/{problem-analyzer.md → util/problem-analyzer.md} +0 -0
  179. /package/.claude/skills/{flow-attention-refresh → domain/attention-refresh}/SKILL.md +0 -0
  180. /package/.claude/skills/{flow-brainstorming → domain/brainstorming}/SKILL.md +0 -0
  181. /package/.claude/skills/{flow-debugging → domain/debugging}/SKILL.md +0 -0
  182. /package/.claude/skills/{flow-finishing-branch → domain/finishing-branch}/SKILL.md +0 -0
  183. /package/.claude/skills/{flow-receiving-review → domain/receiving-review}/SKILL.md +0 -0
  184. /package/.claude/skills/{flow-tdd → domain/tdd}/SKILL.md +0 -0
  185. /package/.claude/skills/{verification-before-completion → domain/verification}/SKILL.md +0 -0
  186. /package/.claude/skills/{constitution-guardian → guardrail/constitution-guardian}/SKILL.md +0 -0
  187. /package/.claude/skills/{devflow-tdd-enforcer → guardrail/tdd-enforcer}/SKILL.md +0 -0
  188. /package/.claude/skills/{devflow-constitution-quick-ref → utility/constitution-quick-ref}/SKILL.md +0 -0
  189. /package/.claude/skills/{devflow-file-standards → utility/file-standards}/SKILL.md +0 -0
  190. /package/.claude/skills/{fractal-docs-generator → utility/fractal-docs}/SKILL.md +0 -0
  191. /package/.claude/skills/{npm-release → utility/npm-release}/SKILL.md +0 -0
@@ -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
@@ -0,0 +1,164 @@
1
+ # YAML Frontmatter Template Component
2
+
3
+ > **Purpose**: Shared YAML frontmatter patterns for all spec documents
4
+ > **Version**: 1.0.0
5
+ > **Usage**: Copy relevant frontmatter based on document type
6
+
7
+ ---
8
+
9
+ ## Usage
10
+
11
+ Select the appropriate frontmatter template based on document type.
12
+
13
+ ---
14
+
15
+ ## PRD Frontmatter
16
+
17
+ ```yaml
18
+ ---
19
+ req_id: "{{REQ_ID}}"
20
+ title: "{{TITLE}}"
21
+ type: "PRD"
22
+ status: "Draft"
23
+ created_at: "{{ISO_8601_TIMESTAMP}}"
24
+ updated_at: "{{ISO_8601_TIMESTAMP}}"
25
+ version: "1.0.0"
26
+ author: "prd-writer"
27
+ constitution_version: "v2.1.0"
28
+ ---
29
+ ```
30
+
31
+ ---
32
+
33
+ ## TECH_DESIGN Frontmatter
34
+
35
+ ```yaml
36
+ ---
37
+ req_id: "{{REQ_ID}}"
38
+ title: "{{TITLE}}"
39
+ type: "Technical Design"
40
+ status: "Draft"
41
+ created_at: "{{ISO_8601_TIMESTAMP}}"
42
+ updated_at: "{{ISO_8601_TIMESTAMP}}"
43
+ version: "1.0.0"
44
+ author: "tech-architect"
45
+ constitution_version: "v2.1.0"
46
+ baseline_tech_stack:
47
+ frontend: "{{BASELINE_FRONTEND}}"
48
+ backend: "{{BASELINE_BACKEND}}"
49
+ database: "{{BASELINE_DATABASE}}"
50
+ ---
51
+ ```
52
+
53
+ ---
54
+
55
+ ## EPIC Frontmatter
56
+
57
+ ```yaml
58
+ ---
59
+ req_id: "{{REQ_ID}}"
60
+ title: "{{TITLE}}"
61
+ type: "Epic"
62
+ status: "Planned"
63
+ created_at: "{{ISO_8601_TIMESTAMP}}"
64
+ updated_at: "{{ISO_8601_TIMESTAMP}}"
65
+ version: "1.0.0"
66
+ author: "planner"
67
+ constitution_version: "v2.1.0"
68
+ phases:
69
+ - name: "Setup"
70
+ status: "pending"
71
+ - name: "Tests First"
72
+ status: "pending"
73
+ - name: "Implementation"
74
+ status: "pending"
75
+ - name: "Integration"
76
+ status: "pending"
77
+ - name: "Polish"
78
+ status: "pending"
79
+ ---
80
+ ```
81
+
82
+ ---
83
+
84
+ ## UI_PROTOTYPE Frontmatter (HTML Comment)
85
+
86
+ ```html
87
+ <!--
88
+ Generated: {{ISO_8601_TIMESTAMP}}
89
+ REQ-ID: {{REQ_ID}}
90
+ Title: {{TITLE}}
91
+ Type: UI Prototype
92
+ Version: 1.0.0
93
+ Author: ui-designer
94
+
95
+ Design Inspirations:
96
+ - Inspiration 1: {{ARTIST_1}} ({{CATEGORY}})
97
+ - Inspiration 2: {{ARTIST_2}} ({{CATEGORY}})
98
+
99
+ Design System:
100
+ Primary Color: {{PRIMARY_COLOR}}
101
+ Font Family: {{FONT_FAMILY}}
102
+ Base Spacing: {{BASE_SPACING}}
103
+
104
+ Responsive Breakpoints:
105
+ Mobile: 320px - 767px
106
+ Tablet: 768px - 1023px
107
+ Desktop: 1024px+
108
+
109
+ Constitution Check: {{PASS/FAIL}}
110
+ -->
111
+ ```
112
+
113
+ ---
114
+
115
+ ## TASKS Frontmatter
116
+
117
+ ```yaml
118
+ ---
119
+ req_id: "{{REQ_ID}}"
120
+ title: "{{TITLE}}"
121
+ type: "Tasks"
122
+ status: "In Progress"
123
+ created_at: "{{ISO_8601_TIMESTAMP}}"
124
+ updated_at: "{{ISO_8601_TIMESTAMP}}"
125
+ version: "1.0.0"
126
+ author: "planner"
127
+ total_tasks: {{TOTAL}}
128
+ completed_tasks: {{COMPLETED}}
129
+ progress: "{{PERCENTAGE}}%"
130
+ current_phase: "{{PHASE_NAME}}"
131
+ ---
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Common Fields Reference
137
+
138
+ | Field | Type | Description | Required |
139
+ |-------|------|-------------|----------|
140
+ | `req_id` | string | Requirement ID (REQ-XXX) | Yes |
141
+ | `title` | string | Document title | Yes |
142
+ | `type` | string | Document type | Yes |
143
+ | `status` | string | Draft/Planned/In Progress/Complete | Yes |
144
+ | `created_at` | string | ISO 8601 timestamp | Yes |
145
+ | `updated_at` | string | ISO 8601 timestamp | Yes |
146
+ | `version` | string | Semantic version | Yes |
147
+ | `author` | string | Agent or person name | Yes |
148
+ | `constitution_version` | string | Constitution version | Recommended |
149
+
150
+ ---
151
+
152
+ ## Status Values
153
+
154
+ | Status | Description | Applicable To |
155
+ |--------|-------------|---------------|
156
+ | `Draft` | Initial creation, not reviewed | PRD, TECH_DESIGN |
157
+ | `Planned` | Reviewed and approved | EPIC |
158
+ | `In Progress` | Currently being worked on | TASKS |
159
+ | `Complete` | All work finished | All |
160
+ | `Archived` | No longer active | All |
161
+
162
+ ---
163
+
164
+ [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
@@ -0,0 +1,6 @@
1
+ {"type": "file", "path": "TASKS.md", "purpose": "Current task list and progress"}
2
+ {"type": "file", "path": "EPIC.md", "purpose": "Epic overview and phases"}
3
+ {"type": "file", "path": "TECH_DESIGN.md", "purpose": "Technical implementation guide"}
4
+ {"type": "file", "path": "ERROR_LOG.md", "purpose": "Previous errors to avoid", "optional": true}
5
+ {"type": "spec", "path": "devflow/spec/frontend/style.md", "purpose": "Frontend style guide", "optional": true}
6
+ {"type": "spec", "path": "devflow/spec/backend/api.md", "purpose": "Backend API conventions", "optional": true}
@@ -0,0 +1,5 @@
1
+ {"type": "file", "path": "PRD.md", "purpose": "Product requirements for task breakdown"}
2
+ {"type": "file", "path": "TECH_DESIGN.md", "purpose": "Technical design decisions"}
3
+ {"type": "file", "path": "data-model.md", "purpose": "Data structures"}
4
+ {"type": "directory", "path": "contracts/", "purpose": "API contracts"}
5
+ {"type": "file", "path": "UI_PROTOTYPE.html", "purpose": "UI prototype reference", "optional": true}
@@ -0,0 +1,4 @@
1
+ {"type": "file", "path": "BRAINSTORM.md", "purpose": "Original intent and design decisions"}
2
+ {"type": "file", "path": "research/research-summary.md", "purpose": "Research findings summary"}
3
+ {"type": "file", "path": "research/internal/codebase-overview.md", "purpose": "Existing codebase patterns"}
4
+ {"type": "spec", "path": "devflow/spec/shared/naming.md", "purpose": "Naming conventions"}
@@ -0,0 +1,4 @@
1
+ {"type": "file", "path": "research/research.md", "purpose": "Research findings and analysis"}
2
+ {"type": "file", "path": "research/research-summary.md", "purpose": "Condensed research summary"}
3
+ {"type": "file", "path": "research/internal/codebase-overview.md", "purpose": "Codebase structure analysis"}
4
+ {"type": "directory", "path": "research/mcp/", "purpose": "MCP-fetched documentation", "depth": 2}
@@ -0,0 +1,5 @@
1
+ {"type": "file", "path": "PRD.md", "purpose": "Requirements to verify against"}
2
+ {"type": "file", "path": "TASKS.md", "purpose": "Completed tasks to review"}
3
+ {"type": "file", "path": "TECH_DESIGN.md", "purpose": "Design decisions to validate"}
4
+ {"type": "directory", "path": "contracts/", "purpose": "API contracts to verify"}
5
+ {"type": "file", "path": "ERROR_LOG.md", "purpose": "Known issues", "optional": true}
@@ -0,0 +1,5 @@
1
+ {"type": "file", "path": "PRD.md", "purpose": "Product requirements"}
2
+ {"type": "file", "path": "BRAINSTORM.md", "purpose": "Original intent alignment"}
3
+ {"type": "file", "path": "research/internal/codebase-overview.md", "purpose": "Existing architecture"}
4
+ {"type": "spec", "path": "devflow/spec/backend/api.md", "purpose": "API conventions"}
5
+ {"type": "spec", "path": "devflow/spec/shared/security.md", "purpose": "Security standards"}