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
@@ -13,267 +13,152 @@ Guide users to the correct agent/command WITHOUT duplicating their detailed stan
13
13
  ### 🏢 项目级工作流(Project-Level, 项目初期执行一次)
14
14
 
15
15
  ```
16
- /core-roadmap → ROADMAP.md + BACKLOG.md (产品路线图)
17
- /core-architecture → ARCHITECTURE.md (系统架构设计)
18
- /core-guidelines → frontend-guidelines.md / backend-guidelines.md (项目规范)
19
- /core-style → STYLE.md (设计风格指南)
16
+ /core:roadmap → ROADMAP.md + BACKLOG.md (产品路线图)
17
+ /core:architecture → ARCHITECTURE.md (系统架构设计)
18
+ /core:guidelines → frontend-guidelines.md / backend-guidelines.md (项目规范)
19
+ /core:style → STYLE.md (设计风格指南)
20
20
  ```
21
21
 
22
22
  ### 📦 需求级工作流(Requirement-Level, 每个需求执行一次)
23
23
 
24
24
  ```
25
- /flow-init → research.md + tasks.json + BRAINSTORM.md (研究初始化 + 头脑风暴)
25
+ /flow:init → research.md + tasks.json + BRAINSTORM.md (研究初始化 + 头脑风暴)
26
26
 
27
- /flow-clarify → clarifications/*.md (11 维度歧义扫描, 可选)
27
+ /flow:clarify → clarifications/*.md (11 维度歧义扫描, 可选)
28
28
 
29
- /flow-prd → PRD.md (invoke prd-writer agent, BRAINSTORM.md 对齐)
29
+ /flow:spec → PRD + Tech + UI + Epic (统一规格阶段)
30
+ Modes:
31
+ - Full: PRD → Tech+UI (并行) → Epic
32
+ - Quick: PRD → Epic (--skip-tech --skip-ui)
33
+ - Backend: PRD → Tech → Epic (--skip-ui)
34
+ - Frontend: PRD → UI → Epic (--skip-tech)
30
35
 
31
- /flow-checklistchecklists/*.md (需求质量检查, 可选)
36
+ /flow:devTASKS.md execution (TDD + Autonomous mode default)
32
37
 
33
- /flow-techTECH_DESIGN.md + data-model + contracts (invoke tech-architect agent)
38
+ /flow:qualityQuality verification
34
39
 
35
- /flow-uiUI_PROTOTYPE.html (invoke ui-designer agent, 可选, 引用 STYLE.md)
40
+ /flow:releasePR creation + deployment
36
41
 
37
- /flow-epicEPIC.md + TASKS.md (invoke planner, bite-sized tasks)
38
-
39
- /flow-dev → TASKS.md execution (TDD + Autonomous mode default)
40
-
41
- /flow-review → SPEC_REVIEW.md + CODE_QUALITY_REVIEW.md (Two-Stage Review)
42
-
43
- /flow-qa → QA reports (invoke qa-tester + security-reviewer agents)
44
-
45
- /flow-release → PR creation + deployment (分支完成决策)
46
-
47
- /flow-verifyconsistency check (invoke consistency-checker agent, 任意阶段可调用)
42
+ /flow:verifyconsistency check (任意阶段可调用)
43
+ ```
44
+
45
+ ### 🚀 简化流程
46
+
47
+ ```
48
+ 【精简流程】(适合小需求, 3 )
49
+ /flow:init --quick → /flow:spec --skip-tech --skip-ui → /flow:dev → /flow:release
50
+
51
+ 【标准流程】(适合中等需求, 4 步)
52
+ /flow:init/flow:spec /flow:dev /flow:quality → /flow:release
53
+
54
+ 【完整流程】(适合大需求, 5 步)
55
+ /flow:init → /flow:clarify → /flow:spec → /flow:dev → /flow:quality --full → /flow:release
48
56
  ```
49
57
 
50
58
  ### 🐛 Bug 修复工作流
51
59
 
52
60
  ```
53
- /flow-fix "BUG-123|描述" → 系统化调试 (4阶段: Root Cause → Pattern → Hypothesis → TDD Fix)
61
+ /flow:fix "BUG-123|描述" → 系统化调试 (4阶段: Root Cause → Pattern → Hypothesis → TDD Fix)
54
62
  ```
55
63
 
56
64
  **说明**:
57
- - 项目级命令建立全局标准(SSOT),需求级命令引用这些标准
58
- - `/flow-init` 包含 Brainstorming 阶段,生成 BRAINSTORM.md 作为需求「北极星」
59
- - `/flow-prd` 需要 BRAINSTORM.md 对齐检查
60
- - `/flow-clarify` 在 PRD 前可选执行,消除 research.md 中的歧义
61
- - `/flow-epic` 使用 bite-sized tasks 原则 (2-5分钟/任务)
62
- - `/flow-dev` 默认 Autonomous 模式(自动重试),使用 `--manual` 退出到 Manual 模式
63
- - `/flow-review` 是新增的两阶段审查 (Spec Compliance → Code Quality)
64
- - `/flow-ui` 和 `/flow-dev` 自动加载 `devflow/STYLE.md`(如存在)
65
- - 项目级命令可按需执行,无严格顺序要求
65
+ - `/flow:spec` 是统一规格命令,合并 PRD/Tech/UI/Epic 为单一命令
66
+ - `/flow:spec` 内部并行执行 Tech + UI,减少 ~35% 设计阶段时间
67
+ - `/flow:dev` 默认 Autonomous 模式(自动重试),使用 `--manual` 退出到 Manual 模式
66
68
 
67
69
  ## Agent Delegation Guide
68
70
 
71
+ ### When User Asks About Unified Specification
72
+ - **DO**: Recommend `/flow:spec` command → orchestrates prd-writer + tech-architect + ui-designer + planner
73
+ - **Link**: See `.claude/skills/workflow/flow-spec/SKILL.md` for details
74
+ - **Modes**: Full (default), Quick (--skip-tech --skip-ui), Backend (--skip-ui), Frontend (--skip-tech)
75
+
69
76
  ### When User Asks About Requirements Clarification
70
- - **DO**: Recommend `/flow-clarify` command → invokes clarify-analyst agent
71
- - **DON'T**: Duplicate clarification logic (flow-clarify.md has ~128 lines)
72
- - **Link**: See [.claude/commands/flow-clarify.md](.claude/commands/flow-clarify.md) for details
73
- - **Outputs**: clarifications/[timestamp]-flow-clarify.md (澄清报告)
74
- - **Features**: 11-dimension scan, ≤5 prioritized questions, session recovery
75
-
76
- ### When User Asks About PRD
77
- - **DO**: Recommend `/flow-prd` command → invokes prd-writer agent
78
- - **DON'T**: Duplicate PRD standards (prd-writer agent has ~300 lines)
79
- - **Link**: See [.claude/agents/prd-writer.md](.claude/agents/prd-writer.md) for PRD details
80
- - **Standards**: INVEST principles, Anti-Expansion mandate, Given-When-Then criteria
81
-
82
- ### When User Asks About Requirement Quality Checklist
83
- - **DO**: Recommend `/flow-checklist` command → invokes checklist-agent
84
- - **DON'T**: Duplicate checklist standards (checklist-agent has ~180 lines)
85
- - **Link**: See [.claude/commands/flow-checklist.md](.claude/commands/flow-checklist.md) for details
86
- - **Outputs**: checklists/*.md (ux, api, security, performance, data, general)
87
- - **Features**: 5 quality dimensions, Anti-Example rules, 80% gate threshold
88
- - **Level**: Requirement-level (optional, before /flow-epic)
89
-
90
- ### When User Asks About Tech Design
91
- - **DO**: Recommend `/flow-tech` command → invokes tech-architect agent
92
- - **DON'T**: Duplicate tech standards (tech-architect agent has ~516 lines)
93
- - **Link**: See [.claude/agents/tech-architect.md](.claude/agents/tech-architect.md) for design details
94
- - **Outputs**: TECH_DESIGN.md, data-model.md, contracts/, quickstart.md
95
-
96
- ### When User Asks About Design Style Guide
97
- - **DO**: Recommend `/core-style` command → invokes style-guide-generator agent
98
- - **DON'T**: Duplicate style guide standards (style-guide-generator agent has ~400 lines)
99
- - **Link**: See [.claude/agents/style-guide-generator.md](.claude/agents/style-guide-generator.md) for details
100
- - **Outputs**: STYLE.md (project-level SSOT for visual consistency)
101
- - **Level**: Project-level (execute once per project)
102
-
103
- ### When User Asks About UI Prototype
104
- - **DO**: Recommend `/flow-ui` command → invokes ui-designer agent
105
- - **DON'T**: Duplicate UI standards (ui-designer agent has ~485 lines)
106
- - **Link**: See [.claude/agents/ui-designer.md](.claude/agents/ui-designer.md) for UI details
107
- - **Features**: 80+ design masters sampling, responsive design, NO PLACEHOLDER, references STYLE.md
108
-
109
- ### When User Asks About Task Planning
110
- - **DO**: Recommend `/flow-epic` command → invokes planner agent
111
- - **DON'T**: Duplicate planning logic (planner agent has ~400 lines)
112
- - **Link**: See [.claude/agents/planner.md](.claude/agents/planner.md) for task breakdown rules
113
- - **Enforces**: Phase -1 Gates (Articles VII, VIII, IX), TDD sequence
77
+ - **DO**: Recommend `/flow:clarify` command → invokes clarify-analyst agent
78
+ - **Link**: See `.claude/commands/flow/clarify.md` for details
79
+
80
+ ### When User Asks About PRD/Tech/UI/Epic
81
+ - **DO**: Recommend `/flow:spec` command (unified)
82
+ - **Link**: See `.claude/agents/prd-writer.md`, `tech-architect.md`, `ui-designer.md`, `planner.md` for agent details
114
83
 
115
84
  ### When User Asks About QA/Security
116
- - **DO**: Recommend `/flow-qa` command → invokes qa-tester + security-reviewer agents
117
- - **DON'T**: Duplicate QA standards (qa-tester agent has ~300 lines)
118
- - **Link**: See [.claude/agents/qa-tester.md](.claude/agents/qa-tester.md) for QA details
85
+ - **DO**: Recommend `/flow:quality` command → invokes qa-tester + security-reviewer agents
86
+ - **Link**: See `.claude/agents/qa-tester.md` for QA details
119
87
 
120
- ### When User Asks About Code Review (v2.1.0 新增)
121
- - **DO**: Recommend `/flow-review` command → invokes spec-reviewer + code-quality-reviewer agents
122
- - **DON'T**: Duplicate review standards (Two-Stage Review)
123
- - **Link**: See [.claude/commands/flow-review.md](.claude/commands/flow-review.md) for details
124
- - **Features**: Stage 1 (Spec Compliance) → Stage 2 (Code Quality), 不信任实现者报告
88
+ ### When User Asks About Code Review
89
+ - **DO**: Recommend `/flow:review` command → invokes spec-reviewer + code-quality-reviewer agents
90
+ - **Link**: See `.claude/commands/flow/review.md` for details
125
91
 
126
- ### When User Asks About Bug Fix (v2.1.0 新增)
127
- - **DO**: Recommend `/flow-fix` command → 4-phase systematic debugging
128
- - **DON'T**: Guess and fix without investigation
129
- - **Link**: See [.claude/commands/flow-fix.md](.claude/commands/flow-fix.md) for details
130
- - **Features**: Root Cause → Pattern → Hypothesis → TDD Fix, Iron Law enforcement
92
+ ### When User Asks About Bug Fix
93
+ - **DO**: Recommend `/flow:fix` command → 4-phase systematic debugging
94
+ - **Link**: See `.claude/commands/flow/fix.md` for details
131
95
 
132
- ## Phase Gates (Quick Reference Only)
96
+ ## Phase Gates (Quick Reference)
133
97
 
134
98
  ### Entry Gates
135
- - **flow-init Entry**: Git 工作区干净, main 分支
136
- - **flow-clarify Entry**: research.md 存在, phase0_complete == true
137
- - **flow-prd Entry**: BRAINSTORM.md 存在, research.md 无 TODO placeholder
138
- - **flow-checklist Entry**: PRD.md 必须完成 (prd_complete == true)
139
- - **flow-tech Entry**: PRD.md 必须完成
140
- - **flow-ui Entry**: PRD.md 必须完成(可与 tech 并行)
141
- - **flow-epic Entry**: PRD 完成,tech/ui 推荐但可选,Checklist Gate (如存在 checklists/)
142
- - **flow-dev Entry**: EPIC.md + TASKS.md 存在
143
- - **flow-review Entry**: development_complete == true
144
- - **flow-qa Entry**: review_complete == true (或 development_complete)
145
- - **flow-release Entry**: qa_complete == true
99
+ - **flow:init Entry**: Git 工作区干净, main 分支
100
+ - **flow:clarify Entry**: research.md 存在, phase0_complete == true
101
+ - **flow:spec Entry**: BRAINSTORM.md 存在, research.md 无 TODO placeholder
102
+ - **flow:dev Entry**: EPIC.md + TASKS.md 存在
103
+ - **flow:quality Entry**: development_complete == true
104
+ - **flow:release Entry**: quality_complete == true
146
105
 
147
106
  ### Exit Gates
148
- - **flow-init Exit**: research.md 5-level quality check, BRAINSTORM.md 完整
149
- - **flow-clarify Exit**: clarification report 完整, orchestration_status.clarify_complete == true
150
- - **flow-prd Exit**: PRD.md placeholder, Constitution 合规, BRAINSTORM 对齐
151
- - **flow-tech Exit**: TECH_DESIGN.md + data-model + contracts 完整
152
- - **flow-epic Exit**: TASKS.md TDD 顺序正确, bite-sized tasks, Phase -1 Gates 通过
153
- - **flow-dev Exit**: 所有 TASKS 完成, TDD Checkpoint 通过, 测试通过
154
- - **flow-review Exit**: SPEC_REVIEW.md + CODE_QUALITY_REVIEW.md 均 PASS
155
- - **flow-qa Exit**: 无 high-severity 漏洞
156
- - **flow-release Exit**: PR 创建成功, 分支决策完成
157
-
158
- **For Details**: See [orchestration_status.json](devflow/requirements/REQ-XXX/orchestration_status.json) and [EXECUTION_LOG.md](devflow/requirements/REQ-XXX/EXECUTION_LOG.md)
107
+ - **flow:init Exit**: research.md 5-level quality check, BRAINSTORM.md 完整
108
+ - **flow:spec Exit**: PRD.md + EPIC.md + TASKS.md 完整, TDD 顺序正确
109
+ - **flow:dev Exit**: 所有 TASKS 完成, TDD Checkpoint 通过
110
+ - **flow:quality Exit**: high-severity 漏洞
111
+ - **flow:release Exit**: PR 创建成功
159
112
 
160
113
  ## State Machine: Status → Recommended Command
161
114
 
162
- Read `orchestration_status.json` to determine current phase:
163
-
164
115
  ```yaml
165
116
  status: "initialized"
166
- → Recommend: /flow-clarify (optional, clarify ambiguities)
167
- → Alternative: /flow-prd (skip clarification, generate PRD directly)
168
- → Note: BRAINSTORM.md 已在 /flow-init 生成
117
+ → Recommend: /flow:spec (统一规格阶段)
118
+ → Alternative: /flow:clarify (optional)
169
119
 
170
120
  status: "clarify_complete" OR "clarify_skipped"
171
- → Recommend: /flow-prd (generate PRD)
121
+ → Recommend: /flow:spec
172
122
 
173
- status: "prd_complete"
174
- → Recommend: /flow-tech (generate technical design)
175
- → Alternative: /flow-ui (generate UI prototype, optional)
176
-
177
- status: "tech_design_complete"
178
- → If UI not done: /flow-ui (optional)
179
- → Else: /flow-epic (generate EPIC and TASKS)
180
-
181
- status: "epic_complete"
182
- → Recommend: /flow-dev (TDD development, Autonomous mode default)
183
- → Alternative: /flow-dev --manual (Manual mode for complex requirements)
123
+ status: "spec_complete"
124
+ → Recommend: /flow:dev (TDD development, Autonomous mode default)
184
125
 
185
126
  status: "development_complete"
186
- → Recommend: /flow-review (Two-Stage Code Review)
187
- → Alternative: /flow-qa (skip review, go directly to QA)
127
+ → Recommend: /flow:quality
188
128
 
189
- status: "review_complete"
190
- → Recommend: /flow-qa (quality assurance and security review)
191
-
192
- status: "qa_complete"
193
- → Recommend: /flow-release (create PR and release)
129
+ status: "quality_complete"
130
+ → Recommend: /flow:release
194
131
 
195
132
  status: "released"
196
- → Recommend: /flow-verify (final consistency check)
133
+ → Recommend: /flow:verify (final consistency check)
197
134
  ```
198
135
 
199
- ## Troubleshooting Quick Routing
200
-
201
- ### Phase gate blocked?
202
- - **Action**: Check `orchestration_status.json` for current status
203
- - **Script**: Run `.claude/scripts/check-prerequisites.sh --json`
204
-
205
- ### Document missing?
206
- - **Action**: Check which phase is incomplete
207
- - **Script**: Run `.claude/scripts/generate-status-report.sh`
208
-
209
- ### Need detailed standards?
210
- - **Clarify**: See flow-clarify.md command + clarify-analyst agent
211
- - **PRD**: Consult prd-writer agent
212
- - **Tech**: Consult tech-architect agent
213
- - **UI**: Consult ui-designer agent
214
- - **Tasks**: Consult planner agent
215
- - **QA**: Consult qa-tester agent
216
-
217
- ### Constitution violation?
218
- - **Real-time check**: constitution-guardian guardrail (PreToolUse hook)
219
- - **Batch validation**: Run `.claude/scripts/validate-constitution.sh`
220
- - **Reference**: See `.claude/rules/project-constitution.md`
221
- - **Rationalization Library**: See `.claude/rules/rationalization-library.md`
222
-
223
- ### TDD order violated?
224
- - **Real-time check**: devflow-tdd-enforcer guardrail (PreToolUse hook)
225
- - **Manual check**: See TASKS.md, tests MUST be marked [x] before implementation
226
- - **TDD Skill**: See `.claude/skills/flow-tdd/SKILL.md`
227
-
228
136
  ## Auxiliary Commands
229
137
 
230
138
  ### Status and Progress
231
- - `/flow-status` - Query requirement progress
232
- - `/flow-update "REQ-123" "T012"` - Update task completion
233
- - `/flow-restart "REQ-123" --from=epic` - Resume interrupted workflow
139
+ - `/flow:status` - Query requirement progress
140
+ - `/flow:update "REQ-123" "T012"` - Update task completion
141
+ - `/flow:restart "REQ-123" --from=spec` - Resume interrupted workflow
234
142
 
235
143
  ### Upgrade and Analysis
236
- - `/flow-upgrade "REQ-123" --analyze` - PRD version upgrade impact analysis
237
- - `/flow-constitution` - Constitution management
238
- - `/flow-verify "REQ-123"` - Comprehensive consistency verification
144
+ - `/flow:upgrade "REQ-123" --analyze` - PRD version upgrade impact analysis
145
+ - `/flow:constitution` - Constitution management
146
+ - `/flow:verify "REQ-123"` - Comprehensive consistency verification
239
147
 
240
148
  ### Bug Fix
241
- - `/flow-fix "BUG-123|登录超时"` - 系统化 BUG 修复 (4阶段调试法)
242
- - `/problem-analyzer "<issue>"` - Problem diagnosis
149
+ - `/flow:fix "BUG-123|描述"` - 系统化 BUG 修复
150
+ - `/util:problem-analyzer "<issue>"` - Problem diagnosis
243
151
 
244
152
  ### Code Review
245
- - `/flow-review "REQ-123"` - Two-Stage Code Review (Spec → Quality)
246
- - `/code-review-high "<diff>"` - High-rigor code review
247
-
248
- ## Integration with Other Skills
249
-
250
- ### Guardrails (实时阻断)
251
- - **devflow-tdd-enforcer**: Enforces TDD order in TASKS.md
252
- - **constitution-guardian**: Enforces Constitution compliance
253
-
254
- ### Workflow Skills
255
- - **flow-brainstorming**: 需求头脑风暴,生成 BRAINSTORM.md
256
- - **flow-tdd**: TDD Iron Law 执行
257
- - **flow-debugging**: 4阶段系统化调试
258
- - **flow-receiving-review**: 处理代码审查反馈
259
- - **flow-finishing-branch**: 分支完成决策
260
- - **verification-before-completion**: 验证闸门
261
-
262
- ### Reference Skills
263
- - **devflow-file-standards**: File naming and directory structure reference
264
- - **devflow-constitution-quick-ref**: Constitution quick reference
153
+ - `/flow:review "REQ-123"` - Two-Stage Code Review
154
+ - `/util:code-review "<diff>"` - High-rigor code review
265
155
 
266
156
  ## Design Principle
267
157
 
268
- **This skill does NOT contain**:
269
- - ❌ Detailed agent execution standards (those are in agent files)
270
- - ❌ Full Phase Gate validation logic (those are in flow command files)
271
- - ❌ Complete Constitution articles (those are in project-constitution.md)
272
-
273
158
  **This skill ONLY contains**:
274
159
  - ✅ Workflow routing (which command to run next)
275
160
  - ✅ Agent delegation (which agent handles what)
276
- - ✅ Quick reference (Phase Gates summary, not full details)
161
+ - ✅ Quick reference (Phase Gates summary)
277
162
  - ✅ Links to detailed documentation
278
163
 
279
- **Rationale**: Avoid duplication ("不重不漏" principle). Agents and Commands own detailed standards.
164
+ **Rationale**: Avoid duplication. Agents and Commands own detailed standards.
@@ -0,0 +1,252 @@
1
+ ---
2
+ name: using-git-worktrees
3
+ description: 'Git Worktree management for parallel development. Enables multiple Claude Code sessions working on different requirements simultaneously.'
4
+ ---
5
+
6
+ # Using Git Worktrees Skill
7
+
8
+ > [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
9
+
10
+ ## Purpose
11
+
12
+ 支持多需求并行开发,每个 worktree 独立的 Claude 会话,互不干扰。
13
+
14
+ ## When to Use
15
+
16
+ - 多需求并行开发
17
+ - 代码审查时需要隔离环境
18
+ - 紧急修复时不丢失当前工作
19
+ - 需要在不同分支间快速切换
20
+
21
+ ## Core Concepts
22
+
23
+ ### Worktree vs Branch
24
+
25
+ | 传统分支 | Git Worktree |
26
+ |---------|--------------|
27
+ | `git checkout` 切换 | `cd` 切换目录 |
28
+ | 需要 stash 当前工作 | 工作区完全隔离 |
29
+ | 单一 Claude 会话 | 每个 worktree 独立会话 |
30
+ | 切换耗时 ~30s | 切换耗时 ~1s |
31
+
32
+ ### Directory Layout
33
+
34
+ ```
35
+ ~/projects/
36
+ ├── cc-devflow/ # 主仓库 (main 分支)
37
+ ├── cc-devflow-REQ-001/ # REQ-001 worktree
38
+ ├── cc-devflow-REQ-002/ # REQ-002 worktree
39
+ ├── cc-devflow-analysis/ # 只读分析 worktree (可选)
40
+ └── cc-devflow-hotfix/ # 紧急修复 worktree (可选)
41
+ ```
42
+
43
+ ### Naming Convention
44
+
45
+ ```
46
+ Worktree 目录: {repo-name}-{REQ_ID}
47
+ 对应分支: feature/{REQ_ID}-{slug}
48
+ ```
49
+
50
+ ## Commands
51
+
52
+ ### Create Worktree
53
+
54
+ ```bash
55
+ # 创建新 worktree + 分支
56
+ bash scripts/worktree-create.sh "REQ-123" "Feature Title"
57
+
58
+ # 仅创建 worktree (分支已存在)
59
+ bash scripts/worktree-create.sh "REQ-123" --existing-branch
60
+ ```
61
+
62
+ ### List Worktrees
63
+
64
+ ```bash
65
+ # 列出所有 worktree
66
+ bash scripts/worktree-list.sh
67
+
68
+ # JSON 格式输出
69
+ bash scripts/worktree-list.sh --json
70
+ ```
71
+
72
+ ### Switch Worktree
73
+
74
+ ```bash
75
+ # 切换到指定 worktree
76
+ bash scripts/worktree-switch.sh "REQ-123"
77
+
78
+ # 或直接 cd
79
+ cd ../cc-devflow-REQ-123
80
+ ```
81
+
82
+ ### Cleanup Worktree
83
+
84
+ ```bash
85
+ # 清理单个 worktree
86
+ bash scripts/worktree-cleanup.sh "REQ-123"
87
+
88
+ # 清理所有已合并的 worktree
89
+ bash scripts/worktree-cleanup.sh --merged
90
+ ```
91
+
92
+ ### Status Check
93
+
94
+ ```bash
95
+ # 检查当前 worktree 状态
96
+ bash scripts/worktree-status.sh
97
+ ```
98
+
99
+ ## Shell Aliases (Recommended)
100
+
101
+ 将以下内容添加到 `~/.zshrc` 或 `~/.bashrc`:
102
+
103
+ ```bash
104
+ # 快速导航
105
+ alias za='cd $(git rev-parse --show-toplevel 2>/dev/null || echo .)' # 当前 worktree 根目录
106
+ alias zl='git worktree list' # 列出所有 worktree
107
+ alias zm='cd ~/projects/cc-devflow' # 主仓库
108
+
109
+ # 快速切换函数
110
+ zw() {
111
+ local req_id="${1:-}"
112
+ if [[ -z "$req_id" ]]; then
113
+ echo "Usage: zw REQ-123"
114
+ return 1
115
+ fi
116
+ local repo_name=$(basename $(git -C ~/projects/cc-devflow rev-parse --show-toplevel 2>/dev/null))
117
+ local target_dir=~/projects/${repo_name}-${req_id}
118
+ if [[ -d "$target_dir" ]]; then
119
+ cd "$target_dir"
120
+ else
121
+ echo "Worktree not found: $target_dir"
122
+ return 1
123
+ fi
124
+ }
125
+ ```
126
+
127
+ ## Integration with CC-DevFlow
128
+
129
+ ### flow-init
130
+
131
+ 默认使用 worktree 模式:
132
+
133
+ ```bash
134
+ /flow-init "REQ-123|Feature Title"
135
+ # 创建: ../cc-devflow-REQ-123/
136
+ # 分支: feature/REQ-123-feature-title
137
+ ```
138
+
139
+ 兼容模式 (传统分支):
140
+
141
+ ```bash
142
+ /flow-init "REQ-123|Feature Title" --branch-only
143
+ ```
144
+
145
+ ### flow-release
146
+
147
+ 自动清理 worktree:
148
+
149
+ ```bash
150
+ /flow-release "REQ-123"
151
+ # 1. 合并分支
152
+ # 2. 删除 worktree
153
+ # 3. 删除分支
154
+ ```
155
+
156
+ ### flow-restart
157
+
158
+ 切换到已有 worktree:
159
+
160
+ ```bash
161
+ /flow-restart "REQ-123"
162
+ # cd ../cc-devflow-REQ-123
163
+ ```
164
+
165
+ ## Session Management
166
+
167
+ 每个 worktree 可以运行独立的 Claude Code 会话:
168
+
169
+ ```bash
170
+ # 终端 1: REQ-001
171
+ cd ~/projects/cc-devflow-REQ-001
172
+ claude
173
+
174
+ # 终端 2: REQ-002
175
+ cd ~/projects/cc-devflow-REQ-002
176
+ claude
177
+
178
+ # 终端 3: 主仓库 (代码审查)
179
+ cd ~/projects/cc-devflow
180
+ claude
181
+ ```
182
+
183
+ ## Best Practices
184
+
185
+ ### 1. 保持主仓库干净
186
+
187
+ 主仓库 (`cc-devflow/`) 应始终在 `main` 分支,用于:
188
+ - 创建新 worktree
189
+ - 代码审查
190
+ - 合并操作
191
+
192
+ ### 2. 定期清理
193
+
194
+ ```bash
195
+ # 清理已合并的 worktree
196
+ bash scripts/worktree-cleanup.sh --merged
197
+ ```
198
+
199
+ ### 3. 命名一致性
200
+
201
+ - Worktree 目录: `{repo}-{REQ_ID}`
202
+ - 分支名: `feature/{REQ_ID}-{slug}`
203
+
204
+ ### 4. 紧急修复流程
205
+
206
+ ```bash
207
+ # 1. 在主仓库创建 hotfix worktree
208
+ cd ~/projects/cc-devflow
209
+ git worktree add ../cc-devflow-hotfix -b hotfix/critical-fix
210
+
211
+ # 2. 修复并合并
212
+ cd ../cc-devflow-hotfix
213
+ # ... 修复代码 ...
214
+ git push origin hotfix/critical-fix
215
+
216
+ # 3. 清理
217
+ cd ~/projects/cc-devflow
218
+ git worktree remove ../cc-devflow-hotfix
219
+ git branch -d hotfix/critical-fix
220
+ ```
221
+
222
+ ## Error Handling
223
+
224
+ | 错误 | 解决方案 |
225
+ |------|----------|
226
+ | Worktree 目录已存在 | 使用 `--force` 或手动删除 |
227
+ | 分支已被其他 worktree 使用 | 先删除旧 worktree |
228
+ | 主仓库不在 main 分支 | `git checkout main` |
229
+ | 磁盘空间不足 | 清理已合并的 worktree |
230
+
231
+ ## Scripts Reference
232
+
233
+ | Script | Purpose |
234
+ |--------|---------|
235
+ | `scripts/worktree-create.sh` | 创建 worktree |
236
+ | `scripts/worktree-list.sh` | 列出 worktree |
237
+ | `scripts/worktree-switch.sh` | 切换 worktree |
238
+ | `scripts/worktree-cleanup.sh` | 清理 worktree |
239
+ | `scripts/worktree-status.sh` | 状态检查 |
240
+
241
+ ## Assets Reference
242
+
243
+ | Asset | Purpose |
244
+ |-------|---------|
245
+ | `assets/SHELL_ALIASES.md` | Shell 别名模板 |
246
+
247
+ ---
248
+
249
+ **Related Skills**:
250
+ - `flow-init` - 需求初始化 (worktree 创建)
251
+ - `flow-release` - 发布管理 (worktree 清理)
252
+ - `finishing-branch` - 分支完成决策