claude-code-workflow 7.2.30 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/.claude/commands/workflow-skill.md +130 -0
  2. package/.claude/skills/ccw-chain/SKILL.md +44 -71
  3. package/.claude/skills/ccw-chain/chains/ccw-cycle.json +13 -3
  4. package/.claude/skills/ccw-chain/chains/ccw-exploration.json +33 -22
  5. package/.claude/skills/ccw-chain/chains/ccw-issue.json +23 -12
  6. package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +23 -9
  7. package/.claude/skills/ccw-chain/chains/ccw-main.json +15 -2
  8. package/.claude/skills/ccw-chain/chains/ccw-standard.json +28 -16
  9. package/.claude/skills/ccw-chain/chains/ccw-team.json +7 -2
  10. package/.claude/skills/ccw-chain/chains/ccw-with-file.json +25 -9
  11. package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -53
  12. package/.claude/skills/chain-loader/specs/chain-schema.md +30 -3
  13. package/.claude/skills/chain-loader/templates/chain-json.md +63 -63
  14. package/.claude/skills/workflow-plan/SKILL.md +1 -0
  15. package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
  16. package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
  17. package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
  18. package/.codex/skills/analyze-with-file/SKILL.md +383 -134
  19. package/.codex/skills/brainstorm/SKILL.md +3 -3
  20. package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
  21. package/.codex/skills/clean/SKILL.md +1 -1
  22. package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
  23. package/.codex/skills/investigate/orchestrator.md +24 -0
  24. package/.codex/skills/issue-discover/SKILL.md +374 -361
  25. package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
  26. package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
  27. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
  28. package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
  29. package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
  30. package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
  31. package/.codex/skills/review-cycle/SKILL.md +31 -12
  32. package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
  33. package/.codex/skills/security-audit/orchestrator.md +29 -0
  34. package/.codex/skills/session-sync/SKILL.md +1 -1
  35. package/.codex/skills/ship/orchestrator.md +24 -0
  36. package/.codex/skills/spec-add/SKILL.md +5 -5
  37. package/.codex/skills/spec-generator/SKILL.md +33 -2
  38. package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
  39. package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
  40. package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
  41. package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
  42. package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
  43. package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
  44. package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
  45. package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
  46. package/.codex/skills/spec-setup/SKILL.md +669 -669
  47. package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
  48. package/.codex/skills/team-brainstorm/SKILL.md +259 -259
  49. package/.codex/skills/team-coordinate/SKILL.md +359 -359
  50. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
  51. package/.codex/skills/team-designer/SKILL.md +27 -1
  52. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
  53. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  54. package/.codex/skills/team-designer/phases/04-validation.md +1 -1
  55. package/.codex/skills/team-executor/SKILL.md +218 -218
  56. package/.codex/skills/team-frontend/SKILL.md +227 -227
  57. package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
  58. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
  59. package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
  60. package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
  61. package/.codex/skills/team-issue/SKILL.md +269 -269
  62. package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
  63. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
  64. package/.codex/skills/team-motion-design/SKILL.md +222 -222
  65. package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
  66. package/.codex/skills/team-perf-opt/SKILL.md +258 -258
  67. package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
  68. package/.codex/skills/team-planex/SKILL.md +216 -216
  69. package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
  70. package/.codex/skills/team-review/SKILL.md +227 -227
  71. package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
  72. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
  73. package/.codex/skills/team-tech-debt/SKILL.md +206 -206
  74. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
  75. package/.codex/skills/team-testing/SKILL.md +237 -237
  76. package/.codex/skills/team-ui-polish/SKILL.md +218 -218
  77. package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
  78. package/.codex/skills/team-uidesign/SKILL.md +219 -219
  79. package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
  80. package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
  81. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
  82. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
  83. package/.codex/skills/team-ux-improve/SKILL.md +227 -227
  84. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
  85. package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
  86. package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
  87. package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
  88. package/.codex/skills/workflow-execute/SKILL.md +5 -5
  89. package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
  90. package/.codex/skills/workflow-plan/SKILL.md +3 -3
  91. package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
  92. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
  93. package/ccw/dist/cli.d.ts.map +1 -1
  94. package/ccw/dist/cli.js +16 -0
  95. package/ccw/dist/cli.js.map +1 -1
  96. package/ccw/dist/commands/chain-loader.d.ts +2 -0
  97. package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
  98. package/ccw/dist/commands/chain-loader.js +11 -0
  99. package/ccw/dist/commands/chain-loader.js.map +1 -0
  100. package/ccw/dist/commands/install.d.ts.map +1 -1
  101. package/ccw/dist/commands/install.js +52 -1
  102. package/ccw/dist/commands/install.js.map +1 -1
  103. package/ccw/dist/commands/launcher.d.ts +2 -0
  104. package/ccw/dist/commands/launcher.d.ts.map +1 -0
  105. package/ccw/dist/commands/launcher.js +434 -0
  106. package/ccw/dist/commands/launcher.js.map +1 -0
  107. package/ccw/dist/tools/chain-loader.d.ts.map +1 -1
  108. package/ccw/dist/tools/chain-loader.js +457 -45
  109. package/ccw/dist/tools/chain-loader.js.map +1 -1
  110. package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
  111. package/ccw/dist/tools/skill-context-loader.js +12 -26
  112. package/ccw/dist/tools/skill-context-loader.js.map +1 -1
  113. package/ccw/dist/types/chain-types.d.ts +41 -1
  114. package/ccw/dist/types/chain-types.d.ts.map +1 -1
  115. package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
  116. package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
  117. package/ccw/dist/utils/chain-visualizer.js +164 -0
  118. package/ccw/dist/utils/chain-visualizer.js.map +1 -0
  119. package/package.json +1 -1
  120. package/.claude/commands/cli/cli-init.md +0 -441
  121. package/.claude/commands/cli/codex-review.md +0 -361
  122. package/.claude/commands/flow-create.md +0 -663
  123. package/.claude/skills/ccw-chain/phases/analyze-with-file.md +0 -788
  124. package/.claude/skills/ccw-chain/phases/brainstorm/SKILL.md +0 -408
  125. package/.claude/skills/ccw-chain/phases/brainstorm/phases/01-mode-routing.md +0 -207
  126. package/.claude/skills/ccw-chain/phases/brainstorm/phases/02-artifacts.md +0 -567
  127. package/.claude/skills/ccw-chain/phases/brainstorm/phases/03-role-analysis.md +0 -748
  128. package/.claude/skills/ccw-chain/phases/brainstorm/phases/04-synthesis.md +0 -827
  129. package/.claude/skills/ccw-chain/phases/brainstorm-with-file.md +0 -482
  130. package/.claude/skills/ccw-chain/phases/collaborative-plan-with-file.md +0 -639
  131. package/.claude/skills/ccw-chain/phases/debug-with-file.md +0 -656
  132. package/.claude/skills/ccw-chain/phases/integration-test-cycle.md +0 -936
  133. package/.claude/skills/ccw-chain/phases/issue-convert-to-plan.md +0 -720
  134. package/.claude/skills/ccw-chain/phases/issue-discover.md +0 -483
  135. package/.claude/skills/ccw-chain/phases/issue-execute.md +0 -629
  136. package/.claude/skills/ccw-chain/phases/issue-from-brainstorm.md +0 -382
  137. package/.claude/skills/ccw-chain/phases/issue-plan.md +0 -343
  138. package/.claude/skills/ccw-chain/phases/issue-queue.md +0 -464
  139. package/.claude/skills/ccw-chain/phases/refactor-cycle.md +0 -852
  140. package/.claude/skills/ccw-chain/phases/review-cycle/SKILL.md +0 -132
  141. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-fix.md +0 -760
  142. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-module.md +0 -764
  143. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-session.md +0 -775
  144. package/.claude/skills/ccw-chain/phases/roadmap-with-file.md +0 -544
  145. package/.claude/skills/ccw-chain/phases/spec-generator/SKILL.md +0 -338
  146. package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-5-requirement-clarification.md +0 -404
  147. package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-discovery.md +0 -257
  148. package/.claude/skills/ccw-chain/phases/spec-generator/phases/02-product-brief.md +0 -274
  149. package/.claude/skills/ccw-chain/phases/spec-generator/phases/03-requirements.md +0 -184
  150. package/.claude/skills/ccw-chain/phases/spec-generator/phases/04-architecture.md +0 -248
  151. package/.claude/skills/ccw-chain/phases/spec-generator/phases/05-epics-stories.md +0 -178
  152. package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-5-auto-fix.md +0 -144
  153. package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-readiness-check.md +0 -480
  154. package/.claude/skills/ccw-chain/phases/team-planex.md +0 -123
  155. package/.claude/skills/ccw-chain/phases/ui-design-explore-auto.md +0 -678
  156. package/.claude/skills/ccw-chain/phases/unified-execute-with-file.md +0 -870
  157. package/.claude/skills/ccw-chain/phases/workflow-execute/SKILL.md +0 -625
  158. package/.claude/skills/ccw-chain/phases/workflow-execute/phases/06-review.md +0 -215
  159. package/.claude/skills/ccw-chain/phases/workflow-lite-plan.md +0 -616
  160. package/.claude/skills/ccw-chain/phases/workflow-multi-cli-plan.md +0 -424
  161. package/.claude/skills/ccw-chain/phases/workflow-plan/SKILL.md +0 -466
  162. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/01-session-discovery.md +0 -99
  163. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/02-context-gathering.md +0 -338
  164. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/03-conflict-resolution.md +0 -422
  165. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/04-task-generation.md +0 -440
  166. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/05-plan-verify.md +0 -395
  167. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/06-replan.md +0 -594
  168. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/SKILL.md +0 -527
  169. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/01-session-discovery.md +0 -57
  170. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/02-context-gathering.md +0 -407
  171. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/03-test-coverage-analysis.md +0 -172
  172. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/04-conflict-resolution.md +0 -426
  173. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/05-tdd-task-generation.md +0 -473
  174. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/06-tdd-structure-validation.md +0 -189
  175. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/07-tdd-verify.md +0 -635
  176. package/.claude/skills/ccw-chain/phases/workflow-test-fix/SKILL.md +0 -482
  177. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/01-session-start.md +0 -60
  178. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/02-test-context-gather.md +0 -493
  179. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/03-test-concept-enhanced.md +0 -150
  180. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/04-test-task-generate.md +0 -346
  181. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/05-test-cycle-execute.md +0 -538
  182. package/.claude/skills/ccw-chain/specs/intent-patterns.md +0 -60
  183. package/.claude/skills/team-edict.zip +0 -0
@@ -1,466 +0,0 @@
1
- ---
2
- name: workflow-plan
3
- description: "Unified planning skill - 4-phase planning workflow, plan verification, and interactive replanning. Triggers on \"workflow-plan\", \"workflow-plan-verify\", \"workflow:replan\"."
4
- allowed-tools: Skill, Agent, AskUserQuestion, TodoWrite, Read, Write, Edit, Bash, Glob, Grep
5
- ---
6
-
7
- <purpose>
8
- Unified planning skill combining 4-phase planning workflow, plan quality verification, and interactive replanning. Produces IMPL_PLAN.md, task JSONs, verification reports, and manages plan lifecycle through session-level artifact updates. Routes by mode (plan | verify | replan) and acts as a pure orchestrator: executes phases, parses outputs, and passes context.
9
- </purpose>
10
-
11
- <process>
12
-
13
- ## 1. Architecture Overview
14
-
15
- ```
16
- ┌──────────────────────────────────────────────────────────────────┐
17
- │ Workflow Plan Orchestrator (SKILL.md) │
18
- │ → Route by mode: plan | verify | replan │
19
- │ → Pure coordinator: Execute phases, parse outputs, pass context │
20
- └──────────────────────────────────┬───────────────────────────────┘
21
-
22
- ┌───────────────────────┼───────────────────────┐
23
- ↓ ↓ ↓
24
- ┌───────────┐ ┌───────────┐ ┌───────────┐
25
- │ Plan Mode │ │ Verify │ │ Replan │
26
- │ (default) │ │ Mode │ │ Mode │
27
- │ Phase 1-4 │ │ Phase 5 │ │ Phase 6 │
28
- └─────┬─────┘ └───────────┘ └───────────┘
29
-
30
- ┌───┼───┬───┐
31
- ↓ ↓ ↓ ↓
32
- ┌───┐┌───┐┌───┐┌───┐
33
- │ 1 ││ 2 ││ 3 ││ 4 │
34
- │Ses││Ctx││Con││Gen│
35
- └───┘└───┘└───┘└─┬─┘
36
-
37
- ┌───────────┐
38
- │ Confirm │─── Verify ──→ Phase 5
39
- │ (choice) │─── Execute ─→ Skill("workflow-execute")
40
- └───────────┘─── Review ──→ Display session status inline
41
- ```
42
-
43
- ## 2. Key Design Principles
44
-
45
- 1. **Pure Orchestrator**: SKILL.md routes and coordinates only; execution detail lives in phase files
46
- 2. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute
47
- 3. **Multi-Mode Routing**: Single skill handles plan/verify/replan via mode detection
48
- 4. **Task Attachment Model**: Sub-command tasks are ATTACHED, executed sequentially, then COLLAPSED
49
- 5. **Auto-Continue**: After each phase completes, automatically execute next pending phase
50
- 6. **Accumulated State**: planning-notes.md carries context across phases for N+1 decisions
51
-
52
- ## 3. Interactive Preference Collection
53
-
54
- Before dispatching to phase execution, collect workflow preferences via AskUserQuestion:
55
-
56
- ```javascript
57
- // ★ 统一 auto mode 检测:-y/--yes 从 $ARGUMENTS 或 ccw 传播
58
- const autoYes = /\b(-y|--yes)\b/.test($ARGUMENTS)
59
-
60
- if (autoYes) {
61
- // 自动模式:跳过所有询问,使用默认值
62
- workflowPreferences = { autoYes: true, interactive: false }
63
- } else {
64
- const prefResponse = AskUserQuestion({
65
- questions: [
66
- {
67
- question: "是否跳过所有确认步骤(自动模式)?",
68
- header: "Auto Mode",
69
- multiSelect: false,
70
- options: [
71
- { label: "Interactive (Recommended)", description: "交互模式,包含确认步骤" },
72
- { label: "Auto", description: "跳过所有确认,自动执行" }
73
- ]
74
- }
75
- ]
76
- })
77
-
78
- workflowPreferences = {
79
- autoYes: prefResponse.autoMode === 'Auto'
80
- }
81
-
82
- // For replan mode, also collect interactive preference
83
- if (mode === 'replan') {
84
- const replanPref = AskUserQuestion({
85
- questions: [
86
- {
87
- question: "是否使用交互式澄清模式?",
88
- header: "Replan Mode",
89
- multiSelect: false,
90
- options: [
91
- { label: "Standard (Recommended)", description: "使用安全默认值" },
92
- { label: "Interactive", description: "通过提问交互式澄清修改范围" }
93
- ]
94
- }
95
- ]
96
- })
97
- workflowPreferences.interactive = replanPref.replanMode === 'Interactive'
98
- }
99
- }
100
- ```
101
-
102
- **workflowPreferences** is passed to phase execution as context variable, referenced as `workflowPreferences.autoYes`, `workflowPreferences.interactive` within phases.
103
-
104
- ## 4. Mode Detection
105
-
106
- ```javascript
107
- const args = $ARGUMENTS
108
- const mode = detectMode(args)
109
-
110
- function detectMode(args) {
111
- // Skill trigger determines mode
112
- if (skillName === 'workflow-plan-verify') return 'verify'
113
- if (skillName === 'workflow:replan') return 'replan'
114
- return 'plan' // default: workflow-plan
115
- }
116
- ```
117
-
118
- ## 5. Compact Recovery (Phase Persistence)
119
-
120
- Multi-phase planning (Phase 1-4/5/6) spans long conversations. Uses **双重保险**: TodoWrite 跟踪 active phase 保护其不被压缩,sentinel 作为兜底。
121
-
122
- > **⚠️ COMPACT DIRECTIVE**: Context compression MUST check TodoWrite phase status.
123
- > The phase currently marked `in_progress` is the active execution phase — preserve its FULL content.
124
- > Only compress phases marked `completed` or `pending`.
125
-
126
- ## 6. Execution Flow
127
-
128
- ### Plan Mode (default)
129
-
130
- ```
131
- Input Parsing:
132
- └─ Convert user input to structured format (GOAL/SCOPE/CONTEXT)
133
-
134
- Phase 1: Session Discovery
135
- └─ Ref: Read("phases/01-session-discovery.md")
136
- └─ Output: sessionId (WFS-xxx), planning-notes.md
137
-
138
- Phase 2: Context Gathering
139
- └─ Ref: Read("phases/02-context-gathering.md")
140
- ├─ Tasks attached: Analyze structure → Identify integration → Generate package
141
- └─ Output: contextPath + conflictRisk
142
-
143
- Phase 3: Conflict Resolution (conditional: conflictRisk ≥ medium)
144
- └─ Decision (conflictRisk check):
145
- ├─ conflictRisk ≥ medium → Ref: Read("phases/03-conflict-resolution.md")
146
- │ ├─ Tasks attached: Detect conflicts → Present to user → Apply strategies
147
- │ └─ Output: Modified brainstorm artifacts
148
- └─ conflictRisk < medium → Skip to Phase 4
149
-
150
- Phase 4: Task Generation
151
- └─ Ref: Read("phases/04-task-generation.md")
152
- └─ Output: IMPL_PLAN.md, task JSONs, TODO_LIST.md
153
-
154
- Plan Confirmation (User Decision Gate):
155
- └─ Decision (user choice):
156
- ├─ "Verify Plan Quality" (Recommended) → Route to Phase 5 (plan-verify)
157
- ├─ "Start Execution" → Skill(skill="workflow-execute")
158
- └─ "Review Status Only" → Display session status inline
159
- ```
160
-
161
- ### Verify Mode
162
-
163
- ```
164
- Phase 5: Plan Verification
165
- └─ Ref: Read("phases/05-plan-verify.md")
166
- └─ Output: PLAN_VERIFICATION.md with quality gate recommendation
167
- ```
168
-
169
- ### Replan Mode
170
-
171
- ```
172
- Phase 6: Interactive Replan
173
- └─ Ref: Read("phases/06-replan.md")
174
- └─ Output: Updated IMPL_PLAN.md, task JSONs, TODO_LIST.md
175
- ```
176
-
177
- **Phase Reference Documents** (read on-demand when phase executes):
178
-
179
- | Phase | Document | Purpose | Mode | Compact |
180
- |-------|----------|---------|------|---------|
181
- | 1 | phases/01-session-discovery.md | Create or discover workflow session | plan | TodoWrite 驱动 |
182
- | 2 | phases/02-context-gathering.md | Gather project context and analyze codebase | plan | TodoWrite 驱动 |
183
- | 3 | phases/03-conflict-resolution.md | Detect and resolve conflicts (conditional) | plan | TodoWrite 驱动 |
184
- | 4 | phases/04-task-generation.md | Generate implementation plan and task JSONs | plan | TodoWrite 驱动 + 🔄 sentinel |
185
- | 5 | phases/05-plan-verify.md | Read-only verification with quality gate | verify | TodoWrite 驱动 |
186
- | 6 | phases/06-replan.md | Interactive replanning with boundary clarification | replan | TodoWrite 驱动 |
187
-
188
- **Compact Rules**:
189
- 1. **TodoWrite `in_progress`** → 保留完整内容,禁止压缩
190
- 2. **TodoWrite `completed`** → 可压缩为摘要
191
- 3. **🔄 sentinel fallback** → Phase 4 包含 compact sentinel;若 compact 后仅存 sentinel 而无完整 Step 协议,必须立即 `Read("phases/04-task-generation.md")` 恢复
192
-
193
- ## 7. Core Rules
194
-
195
- 1. **Start Immediately**: First action is mode detection + TodoWrite initialization, second action is phase execution
196
- 2. **No Preliminary Analysis**: Do not read files, analyze structure, or gather context before Phase 1
197
- 3. **Parse Every Output**: Extract required data from each phase output for next phase
198
- 4. **Auto-Continue via TodoList**: Check TodoList status to execute next pending phase automatically
199
- 5. **Track Progress**: Update TodoWrite dynamically with task attachment/collapse pattern
200
- 6. **Task Attachment Model**: Skill execute **attaches** sub-tasks to current workflow. Orchestrator **executes** these attached tasks itself, then **collapses** them after completion
201
- 7. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute
202
- 8. **DO NOT STOP**: Continuous multi-phase workflow. After executing all attached tasks, immediately collapse them and execute next phase
203
-
204
- ## 8. Input Processing
205
-
206
- **Convert User Input to Structured Format**:
207
-
208
- 1. **Simple Text** → Structure it:
209
- ```
210
- User: "Build authentication system"
211
-
212
- Structured:
213
- GOAL: Build authentication system
214
- SCOPE: Core authentication features
215
- CONTEXT: New implementation
216
- ```
217
-
218
- 2. **Detailed Text** → Extract components:
219
- ```
220
- User: "Add JWT authentication with email/password login and token refresh"
221
-
222
- Structured:
223
- GOAL: Implement JWT-based authentication
224
- SCOPE: Email/password login, token generation, token refresh endpoints
225
- CONTEXT: JWT token-based security, refresh token rotation
226
- ```
227
-
228
- 3. **File Reference** (e.g., `requirements.md`) → Read and structure:
229
- - Read file content
230
- - Extract goal, scope, requirements
231
- - Format into structured description
232
-
233
- ## 9. Data Flow
234
-
235
- ### Plan Mode
236
-
237
- ```
238
- User Input (task description)
239
-
240
- [Convert to Structured Format]
241
- ↓ Structured Description:
242
- ↓ GOAL: [objective]
243
- ↓ SCOPE: [boundaries]
244
- ↓ CONTEXT: [background]
245
-
246
- Phase 1: session:start --auto "structured-description"
247
- ↓ Output: sessionId
248
- ↓ Write: planning-notes.md (User Intent section)
249
-
250
- Phase 2: context-gather --session sessionId "structured-description"
251
- ↓ Input: sessionId + structured description
252
- ↓ Output: contextPath (context-package.json) + conflictRisk
253
- ↓ Update: planning-notes.md (Context Findings + Consolidated Constraints)
254
-
255
- Phase 3: conflict-resolution [conditional: conflictRisk ≥ medium]
256
- ↓ Input: sessionId + contextPath + conflictRisk
257
- ↓ Output: Modified brainstorm artifacts
258
- ↓ Update: planning-notes.md (Conflict Decisions + Consolidated Constraints)
259
- ↓ Skip if conflictRisk is none/low → proceed directly to Phase 4
260
-
261
- Phase 4: task-generate-agent --session sessionId
262
- ↓ Input: sessionId + planning-notes.md + context-package.json + brainstorm artifacts
263
- ↓ Output: IMPL_PLAN.md, task JSONs, TODO_LIST.md
264
-
265
- Plan Confirmation (User Decision Gate):
266
- ├─ "Verify Plan Quality" (Recommended) → Route to Phase 5
267
- ├─ "Start Execution" → Skill(skill="workflow-execute")
268
- └─ "Review Status Only" → Display session status inline
269
- ```
270
-
271
- **Session Memory Flow**: Each phase receives session ID, which provides access to:
272
- - Previous task summaries
273
- - Existing context and analysis
274
- - Brainstorming artifacts (potentially modified by Phase 3)
275
- - Session-specific configuration
276
-
277
- ### Verify Mode
278
-
279
- ```
280
- Input: --session sessionId (or auto-detect)
281
-
282
- Phase 5: Load artifacts → Agent-driven verification → Generate report
283
- ↓ Output: PLAN_VERIFICATION.md with quality gate
284
- ```
285
-
286
- ### Replan Mode
287
-
288
- ```
289
- Input: [--session sessionId] [task-id] "requirements"
290
-
291
- Phase 6: Mode detection → Clarification → Impact analysis → Backup → Apply → Verify
292
- ↓ Output: Updated artifacts + change summary
293
- ```
294
-
295
- ## 10. TodoWrite Pattern
296
-
297
- **Core Concept**: Dynamic task attachment and collapse for real-time visibility into workflow execution.
298
-
299
- ### Key Principles
300
-
301
- 1. **Task Attachment** (when phase executed):
302
- - Sub-tasks are **attached** to orchestrator's TodoWrite
303
- - **Phase 2, 3**: Multiple sub-tasks attached
304
- - **Phase 1, 4**: Single task (atomic)
305
- - First attached task marked as `in_progress`, others as `pending`
306
- - Orchestrator **executes** these attached tasks sequentially
307
-
308
- 2. **Task Collapse** (after sub-tasks complete):
309
- - **Applies to Phase 2, 3**: Remove detailed sub-tasks from TodoWrite
310
- - **Collapse** to high-level phase summary
311
- - **Phase 1, 4**: No collapse needed (single task, just mark completed)
312
- - Maintains clean orchestrator-level view
313
-
314
- 3. **Continuous Execution**: After completion, automatically proceed to next pending phase
315
-
316
- **Lifecycle**: Initial pending → Phase executed (tasks ATTACHED) → Sub-tasks executed → Phase completed (tasks COLLAPSED for 2/3, marked completed for 1/4) → Next phase → Repeat
317
-
318
- ### Phase 2 (Tasks Attached):
319
- ```json
320
- [
321
- {"content": "Phase 1: Session Discovery", "status": "completed"},
322
- {"content": "Phase 2: Context Gathering", "status": "in_progress"},
323
- {"content": " → Analyze codebase structure", "status": "in_progress"},
324
- {"content": " → Identify integration points", "status": "pending"},
325
- {"content": " → Generate context package", "status": "pending"},
326
- {"content": "Phase 4: Task Generation", "status": "pending"}
327
- ]
328
- ```
329
-
330
- ### Phase 2 (Collapsed):
331
- ```json
332
- [
333
- {"content": "Phase 1: Session Discovery", "status": "completed"},
334
- {"content": "Phase 2: Context Gathering", "status": "completed"},
335
- {"content": "Phase 4: Task Generation", "status": "pending"}
336
- ]
337
- ```
338
-
339
- ### Phase 3 (Tasks Attached, conditional):
340
- ```json
341
- [
342
- {"content": "Phase 1: Session Discovery", "status": "completed"},
343
- {"content": "Phase 2: Context Gathering", "status": "completed"},
344
- {"content": "Phase 3: Conflict Resolution", "status": "in_progress"},
345
- {"content": " → Detect conflicts with CLI analysis", "status": "in_progress"},
346
- {"content": " → Present conflicts to user", "status": "pending"},
347
- {"content": " → Apply resolution strategies", "status": "pending"},
348
- {"content": "Phase 4: Task Generation", "status": "pending"}
349
- ]
350
- ```
351
-
352
- **Note**: See individual Phase descriptions for detailed TodoWrite Update examples.
353
-
354
- ## 11. Post-Phase Updates
355
-
356
- After each phase completes, update planning-notes.md:
357
-
358
- - **After Phase 1**: Initialize with user intent (GOAL, KEY_CONSTRAINTS)
359
- - **After Phase 2**: Add context findings (CRITICAL_FILES, ARCHITECTURE, CONFLICT_RISK, CONSTRAINTS)
360
- - **After Phase 3**: Add conflict decisions (RESOLVED, MODIFIED_ARTIFACTS, CONSTRAINTS) if executed
361
- - **Memory State Check**: After heavy phases (Phase 2-3), evaluate context window usage; if high (>120K tokens), trigger `compact`
362
-
363
- See phase files for detailed update code.
364
-
365
- ## 12. Error Handling
366
-
367
- - **Parsing Failure**: If output parsing fails, retry command once, then report error
368
- - **Validation Failure**: If validation fails, report which file/data is missing
369
- - **Command Failure**: Keep phase `in_progress`, report error to user, do not proceed to next phase
370
- - **Session Not Found** (verify/replan): Report error with available sessions list
371
- - **Task Not Found** (replan): Report error with available tasks list
372
-
373
- ## 13. Coordinator Checklist
374
-
375
- ### Plan Mode
376
- - **Pre-Phase**: Convert user input to structured format (GOAL/SCOPE/CONTEXT)
377
- - Initialize TodoWrite before any command (Phase 3 added dynamically after Phase 2)
378
- - Execute Phase 1 immediately with structured description
379
- - Parse session ID from Phase 1 output, store in memory
380
- - Pass session ID and structured description to Phase 2 command
381
- - Parse context path from Phase 2 output, store in memory
382
- - **Extract conflictRisk from context-package.json**: Determine Phase 3 execution
383
- - **If conflictRisk ≥ medium**: Launch Phase 3 conflict-resolution with sessionId and contextPath
384
- - Wait for Phase 3 to finish executing (if executed), verify conflict-resolution.json created
385
- - **If conflictRisk is none/low**: Skip Phase 3, proceed directly to Phase 4
386
- - Pass session ID to Phase 4 command
387
- - Verify all Phase 4 outputs
388
- - **Plan Confirmation Gate**: Present user with choice (Verify → Phase 5 / Execute / Review Status)
389
- - **If user selects Verify**: Read phases/05-plan-verify.md, execute Phase 5 in-process
390
- - **If user selects Execute**: Skill(skill="workflow-execute")
391
- - **If user selects Review**: Display session status inline
392
- - **Auto mode (workflowPreferences.autoYes)**: Auto-select "Verify Plan Quality", then auto-continue to execute if PROCEED
393
- - Update TodoWrite after each phase
394
- - After each phase, automatically continue to next phase based on TodoList status
395
-
396
- ### Verify Mode
397
- - Detect/validate session (auto-detect from active sessions)
398
- - Initialize TodoWrite with single verification task
399
- - Execute Phase 5 verification agent
400
- - Present quality gate result and next step options
401
-
402
- ### Replan Mode
403
- - Parse task ID from $ARGUMENTS (IMPL-N format, if present)
404
- - Detect operation mode (task vs session)
405
- - Initialize TodoWrite with replan-specific tasks
406
- - Execute Phase 6 through all sub-phases (clarification → impact → backup → apply → verify)
407
-
408
- ## 14. Structure Template Reference
409
-
410
- **Minimal Structure**:
411
- ```
412
- GOAL: [What to achieve]
413
- SCOPE: [What's included]
414
- CONTEXT: [Relevant info]
415
- ```
416
-
417
- **Detailed Structure** (optional, when more context available):
418
- ```
419
- GOAL: [Primary objective]
420
- SCOPE: [Included features/components]
421
- CONTEXT: [Existing system, constraints, dependencies]
422
- REQUIREMENTS: [Specific technical requirements]
423
- CONSTRAINTS: [Limitations or boundaries]
424
- ```
425
-
426
- ## 15. Related Skills
427
-
428
- **Prerequisite Skills**:
429
- - `brainstorm` skill - Optional: Generate role-based analyses before planning
430
- - `brainstorm` skill - Optional: Refine brainstorm analyses with clarifications
431
-
432
- **Called by Plan Mode** (4 phases):
433
- - `/workflow:session:start` - Phase 1: Create or discover workflow session
434
- - `phases/02-context-gathering.md` - Phase 2: Gather project context and analyze codebase (inline)
435
- - `phases/03-conflict-resolution.md` - Phase 3: Detect and resolve conflicts (inline, conditional)
436
- - `memory-capture` skill - Phase 3: Memory optimization (if context approaching limits)
437
- - `phases/04-task-generation.md` - Phase 4: Generate task JSON files (inline)
438
-
439
- **Follow-up Skills**:
440
- - `workflow-plan` skill (plan-verify phase) - Verify plan quality (can also invoke via verify mode)
441
- - Display session status inline - Review task breakdown and current progress
442
- - `Skill(skill="workflow-execute")` - Begin implementation of generated tasks (skill: workflow-execute)
443
- - `workflow-plan` skill (replan phase) - Modify plan (can also invoke via replan mode)
444
-
445
- </process>
446
-
447
- <auto_mode>
448
- When `workflowPreferences.autoYes` is true (triggered by `-y` or `--yes` flag, or user selecting "Auto" mode):
449
- - Skip all confirmation prompts, use default values
450
- - Auto-select "Verify Plan Quality" at Plan Confirmation Gate
451
- - Auto-continue to execution if verification returns PROCEED
452
- - Skip interactive clarification in replan mode (use safe defaults)
453
- </auto_mode>
454
-
455
- <success_criteria>
456
- - [ ] Mode correctly detected from skill trigger (plan / verify / replan)
457
- - [ ] TodoWrite initialized and updated after each phase with attachment/collapse pattern
458
- - [ ] All phases executed in sequence with proper data passing between phases
459
- - [ ] Phase documents loaded progressively via Read() only when phase is about to execute
460
- - [ ] planning-notes.md updated after each phase with accumulated context
461
- - [ ] Phase 3 conditionally executed based on conflictRisk assessment
462
- - [ ] Plan Confirmation Gate presented with correct options after Phase 4
463
- - [ ] All output artifacts generated: IMPL_PLAN.md, task JSONs, TODO_LIST.md
464
- - [ ] Compact recovery works: in_progress phases preserved, completed phases compressible
465
- - [ ] Error handling covers parsing failures, validation failures, and missing sessions/tasks
466
- </success_criteria>
@@ -1,99 +0,0 @@
1
- # Phase 1: Session Discovery
2
-
3
- Create or discover workflow session and initialize planning notes document.
4
-
5
- ## Objective
6
-
7
- - Create a new workflow session via `/workflow:session:start`
8
- - Extract session ID for subsequent phases
9
- - Initialize planning-notes.md with user intent and N+1 context structure
10
-
11
- ## Execution
12
-
13
- ### Step 1.1: Execute Session Start
14
-
15
- ```javascript
16
- Skill(skill="workflow:session:start", args="--auto \"[structured-task-description]\"")
17
- ```
18
-
19
- **Task Description Structure**:
20
- ```
21
- GOAL: [Clear, concise objective]
22
- SCOPE: [What's included/excluded]
23
- CONTEXT: [Relevant background or constraints]
24
- ```
25
-
26
- **Example**:
27
- ```
28
- GOAL: Build JWT-based authentication system
29
- SCOPE: User registration, login, token validation
30
- CONTEXT: Existing user database schema, REST API endpoints
31
- ```
32
-
33
- ### Step 1.2: Parse Output
34
-
35
- - Extract: `SESSION_ID: WFS-[id]` (store as `sessionId`)
36
-
37
- **Validation**:
38
- - Session ID successfully extracted
39
- - Session directory `.workflow/active/[sessionId]/` exists
40
-
41
- **Note**: Session directory contains `workflow-session.json` (metadata). Do NOT look for `manifest.json` here - it only exists in `.workflow/archives/` for archived sessions.
42
-
43
- **TodoWrite**: Mark phase 1 completed, phase 2 in_progress
44
-
45
- ### Step 1.3: Initialize Planning Notes
46
-
47
- After Phase 1, initialize planning-notes.md with user intent:
48
-
49
- ```javascript
50
- // Create planning notes document with N+1 context support
51
- const planningNotesPath = `.workflow/active/${sessionId}/planning-notes.md`
52
- const userGoal = structuredDescription.goal
53
- const userConstraints = structuredDescription.context || "None specified"
54
-
55
- Write(planningNotesPath, `# Planning Notes
56
-
57
- **Session**: ${sessionId}
58
- **Created**: ${new Date().toISOString()}
59
-
60
- ## User Intent (Phase 1)
61
-
62
- - **GOAL**: ${userGoal}
63
- - **KEY_CONSTRAINTS**: ${userConstraints}
64
-
65
- ---
66
-
67
- ## Context Findings (Phase 2)
68
- (To be filled by context-gather)
69
-
70
- ## Conflict Decisions (Phase 3)
71
- (To be filled if conflicts detected)
72
-
73
- ## Consolidated Constraints (Phase 4 Input)
74
- 1. ${userConstraints}
75
-
76
- ---
77
-
78
- ## Task Generation (Phase 4)
79
- (To be filled by action-planning-agent)
80
-
81
- ## N+1 Context
82
- ### Decisions
83
- | Decision | Rationale | Revisit? |
84
- |----------|-----------|----------|
85
-
86
- ### Deferred
87
- - [ ] (For N+1)
88
- `)
89
- ```
90
-
91
- ## Output
92
-
93
- - **Variable**: `sessionId` (WFS-xxx)
94
- - **File**: `.workflow/active/[sessionId]/planning-notes.md`
95
- - **TodoWrite**: Mark Phase 1 completed, Phase 2 in_progress
96
-
97
- ## Next Phase
98
-
99
- Return to orchestrator, then auto-continue to [Phase 2: Context Gathering](02-context-gathering.md).