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,748 +0,0 @@
1
- # Phase 3: Role Analysis
2
-
3
- Unified role-specific analysis generation with interactive context gathering, framework alignment, and incremental update support. Supports both parallel execution (auto mode, N roles simultaneously) and single-role execution.
4
-
5
- ## Objective
6
-
7
- - Validate role name and detect session
8
- - Gather interactive context via role-specific questions (optional)
9
- - Execute conceptual-planning-agent with role template and framework
10
- - Support feature-point output organization when feature list available
11
- - Support incremental updates to existing analyses
12
- - Validate output and update session metadata
13
-
14
- ## Supported Roles
15
-
16
- | Role ID | Title | Focus Area | Context Questions |
17
- |---------|-------|------------|-------------------|
18
- | `ux-expert` | UX专家 | User research, information architecture, user journey | 4 |
19
- | `ui-designer` | UI设计师 | Visual design, high-fidelity mockups, design systems | 4 |
20
- | `system-architect` | 系统架构师 | Technical architecture, scalability, integration patterns | 5 |
21
- | `product-manager` | 产品经理 | Product strategy, roadmap, prioritization | 4 |
22
- | `product-owner` | 产品负责人 | Backlog management, user stories, acceptance criteria | 4 |
23
- | `scrum-master` | 敏捷教练 | Process facilitation, impediment removal, team dynamics | 3 |
24
- | `subject-matter-expert` | 领域专家 | Domain knowledge, business rules, compliance | 4 |
25
- | `data-architect` | 数据架构师 | Data models, storage strategies, data flow | 5 |
26
- | `api-designer` | API设计师 | API contracts, versioning, integration patterns | 4 |
27
-
28
- ## Execution
29
-
30
- ### Auto Mode Parallel Execution
31
-
32
- When called from auto mode, launch N role-analysis calls simultaneously:
33
-
34
- ```javascript
35
- // Single message with multiple Skill invokes for parallelism
36
- // For each selected role:
37
- Skill(skill="brainstorm", args="{role-name} --session {session-id} --skip-questions")
38
-
39
- // For ui-designer with style-skill:
40
- Skill(skill="brainstorm", args="ui-designer --session {session-id} --skip-questions --style-skill {style_skill_package}")
41
- ```
42
-
43
- **Parallel Safety**: Each role operates independently on its own directory. No cross-agent dependencies.
44
-
45
- ### Step 3.1: Detection & Validation
46
-
47
- **Step 3.1.1: Role Validation**
48
- ```bash
49
- VALIDATE role_name IN [
50
- ux-expert, ui-designer, system-architect, product-manager,
51
- product-owner, scrum-master, subject-matter-expert,
52
- data-architect, api-designer
53
- ]
54
- IF invalid:
55
- ERROR: "Unknown role: {role_name}. Use one of: ux-expert, ui-designer, ..."
56
- EXIT
57
- ```
58
-
59
- **Step 3.1.2: Session Detection**
60
- ```bash
61
- IF --session PROVIDED:
62
- session_id = --session
63
- brainstorm_dir = .workflow/active/{session_id}/.brainstorming/
64
- ELSE:
65
- FIND .workflow/active/WFS-*/
66
- IF multiple:
67
- PROMPT user to select
68
- ELSE IF single:
69
- USE existing
70
- ELSE:
71
- ERROR: "No active session. Run /brainstorm 'topic' first"
72
- EXIT
73
-
74
- VALIDATE brainstorm_dir EXISTS
75
- ```
76
-
77
- **Step 3.1.3: Framework Detection & Feature List Extraction**
78
- ```bash
79
- framework_file = {brainstorm_dir}/guidance-specification.md
80
- IF framework_file EXISTS:
81
- framework_mode = true
82
- LOAD framework_content
83
- # Extract Feature Decomposition table from guidance-specification.md
84
- feature_list = EXTRACT_TABLE(framework_content, "Feature Decomposition")
85
- # feature_list format: [{id: "F-001", slug: "real-time-sync", description: "...", roles: [...], priority: "High"}, ...]
86
- IF feature_list NOT EMPTY:
87
- feature_mode = true # Use feature-point organization for sub-documents
88
- ELSE:
89
- feature_mode = false # Fall back to arbitrary-topic organization
90
- ELSE:
91
- WARN: "No framework found - will create standalone analysis"
92
- framework_mode = false
93
- feature_mode = false
94
- ```
95
-
96
- **Step 3.1.4: Update Mode Detection**
97
- ```bash
98
- existing_analysis = {brainstorm_dir}/{role_name}/analysis*.md
99
- IF --update FLAG OR existing_analysis EXISTS:
100
- update_mode = true
101
- IF --update NOT PROVIDED:
102
- ASK: "Analysis exists. Update or regenerate?"
103
- OPTIONS: ["Incremental update", "Full regenerate", "Cancel"]
104
- ELSE:
105
- update_mode = false
106
- ```
107
-
108
- ### Step 3.2: Interactive Context Gathering
109
-
110
- **Trigger Conditions**:
111
- - Default: Always ask unless `--skip-questions` provided
112
- - `--include-questions`: Force context gathering even if analysis exists
113
- - `--skip-questions`: Skip all interactive questions
114
-
115
- **Step 3.2.1: Load Role Configuration**
116
- ```javascript
117
- const roleConfig = {
118
- 'ux-expert': {
119
- title: 'UX专家',
120
- focus_area: 'User research, information architecture, user journey',
121
- question_categories: ['User Intent', 'Requirements', 'UX'],
122
- question_count: 4,
123
- template: '~/.ccw/workflows/cli-templates/planning-roles/ux-expert.md'
124
- },
125
- 'ui-designer': {
126
- title: 'UI设计师',
127
- focus_area: 'Visual design, high-fidelity mockups, design systems',
128
- question_categories: ['Requirements', 'UX', 'Feasibility'],
129
- question_count: 4,
130
- template: '~/.ccw/workflows/cli-templates/planning-roles/ui-designer.md'
131
- },
132
- 'system-architect': {
133
- title: '系统架构师',
134
- focus_area: 'Technical architecture, scalability, integration patterns',
135
- question_categories: ['Scale & Performance', 'Technical Constraints', 'Architecture Complexity', 'Non-Functional Requirements'],
136
- question_count: 5,
137
- template: '~/.ccw/workflows/cli-templates/planning-roles/system-architect.md'
138
- },
139
- 'product-manager': {
140
- title: '产品经理',
141
- focus_area: 'Product strategy, roadmap, prioritization',
142
- question_categories: ['User Intent', 'Requirements', 'Process'],
143
- question_count: 4,
144
- template: '~/.ccw/workflows/cli-templates/planning-roles/product-manager.md'
145
- },
146
- 'product-owner': {
147
- title: '产品负责人',
148
- focus_area: 'Backlog management, user stories, acceptance criteria',
149
- question_categories: ['Requirements', 'Decisions', 'Process'],
150
- question_count: 4,
151
- template: '~/.ccw/workflows/cli-templates/planning-roles/product-owner.md'
152
- },
153
- 'scrum-master': {
154
- title: '敏捷教练',
155
- focus_area: 'Process facilitation, impediment removal, team dynamics',
156
- question_categories: ['Process', 'Risk', 'Decisions'],
157
- question_count: 3,
158
- template: '~/.ccw/workflows/cli-templates/planning-roles/scrum-master.md'
159
- },
160
- 'subject-matter-expert': {
161
- title: '领域专家',
162
- focus_area: 'Domain knowledge, business rules, compliance',
163
- question_categories: ['Requirements', 'Feasibility', 'Terminology'],
164
- question_count: 4,
165
- template: '~/.ccw/workflows/cli-templates/planning-roles/subject-matter-expert.md'
166
- },
167
- 'data-architect': {
168
- title: '数据架构师',
169
- focus_area: 'Data models, storage strategies, data flow',
170
- question_categories: ['Architecture', 'Scale & Performance', 'Technical Constraints', 'Feasibility'],
171
- question_count: 5,
172
- template: '~/.ccw/workflows/cli-templates/planning-roles/data-architect.md'
173
- },
174
- 'api-designer': {
175
- title: 'API设计师',
176
- focus_area: 'API contracts, versioning, integration patterns',
177
- question_categories: ['Architecture', 'Requirements', 'Feasibility', 'Decisions'],
178
- question_count: 4,
179
- template: '~/.ccw/workflows/cli-templates/planning-roles/api-designer.md'
180
- }
181
- };
182
-
183
- config = roleConfig[role_name];
184
- ```
185
-
186
- **Step 3.2.2: Generate Role-Specific Questions**
187
-
188
- **9-Category Taxonomy**:
189
-
190
- | Category | Focus | Example Question Pattern |
191
- |----------|-------|--------------------------|
192
- | User Intent | 用户目标 | "该分析的核心目标是什么?" |
193
- | Requirements | 需求细化 | "需求的优先级如何排序?" |
194
- | Architecture | 架构决策 | "技术栈的选择考量?" |
195
- | UX | 用户体验 | "交互复杂度的取舍?" |
196
- | Feasibility | 可行性 | "资源约束下的实现范围?" |
197
- | Risk | 风险管理 | "风险容忍度是多少?" |
198
- | Process | 流程规范 | "开发迭代的节奏?" |
199
- | Decisions | 决策确认 | "冲突的解决方案?" |
200
- | Terminology | 术语统一 | "统一使用哪个术语?" |
201
- | Scale & Performance | 性能扩展 | "预期的负载和性能要求?" |
202
- | Technical Constraints | 技术约束 | "现有技术栈的限制?" |
203
- | Architecture Complexity | 架构复杂度 | "架构的复杂度权衡?" |
204
- | Non-Functional Requirements | 非功能需求 | "可用性和可维护性要求?" |
205
-
206
- **Question Generation Algorithm**:
207
- ```javascript
208
- async function generateQuestions(role_name, framework_content) {
209
- const config = roleConfig[role_name];
210
- const questions = [];
211
-
212
- // Parse framework for keywords
213
- const keywords = extractKeywords(framework_content);
214
-
215
- // Generate category-specific questions
216
- for (const category of config.question_categories) {
217
- const question = generateCategoryQuestion(category, keywords, role_name);
218
- questions.push(question);
219
- }
220
-
221
- return questions.slice(0, config.question_count);
222
- }
223
- ```
224
-
225
- **Step 3.2.3: Multi-Round Question Execution**
226
-
227
- ```javascript
228
- const BATCH_SIZE = 4;
229
- const user_context = {};
230
-
231
- for (let i = 0; i < questions.length; i += BATCH_SIZE) {
232
- const batch = questions.slice(i, i + BATCH_SIZE);
233
- const currentRound = Math.floor(i / BATCH_SIZE) + 1;
234
- const totalRounds = Math.ceil(questions.length / BATCH_SIZE);
235
-
236
- console.log(`\n[Round ${currentRound}/${totalRounds}] ${config.title} 上下文询问\n`);
237
-
238
- AskUserQuestion({
239
- questions: batch.map(q => ({
240
- question: q.question,
241
- header: q.category.substring(0, 12),
242
- multiSelect: false,
243
- options: q.options.map(opt => ({
244
- label: opt.label,
245
- description: opt.description
246
- }))
247
- }))
248
- });
249
-
250
- // Store responses before next round
251
- for (const answer of responses) {
252
- user_context[answer.question] = {
253
- answer: answer.selected,
254
- category: answer.category,
255
- timestamp: new Date().toISOString()
256
- };
257
- }
258
- }
259
-
260
- // Save context to file
261
- Write(
262
- `${brainstorm_dir}/${role_name}/${role_name}-context.md`,
263
- formatUserContext(user_context)
264
- );
265
- ```
266
-
267
- **Question Quality Rules**:
268
-
269
- **MUST Include**:
270
- - ✅ All questions in Chinese (用中文提问)
271
- - ✅ 业务场景作为问题前提
272
- - ✅ 技术选项的业务影响说明
273
- - ✅ 量化指标和约束条件
274
-
275
- **MUST Avoid**:
276
- - ❌ 纯技术选型无业务上下文
277
- - ❌ 过度抽象的通用问题
278
- - ❌ 脱离框架的重复询问
279
-
280
- ### Step 3.3: Agent Execution
281
-
282
- **Step 3.3.1: Load Session Metadata**
283
- ```bash
284
- session_metadata = Read(.workflow/active/{session_id}/workflow-session.json)
285
- original_topic = session_metadata.topic
286
- selected_roles = session_metadata.selected_roles
287
- ```
288
-
289
- **Step 3.3.2: Prepare Agent Context**
290
- ```javascript
291
- const agentContext = {
292
- role_name: role_name,
293
- role_config: roleConfig[role_name],
294
- output_location: `${brainstorm_dir}/${role_name}/`,
295
- framework_mode: framework_mode,
296
- feature_mode: feature_mode,
297
- feature_list: feature_mode ? feature_list : null,
298
- framework_path: framework_mode ? `${brainstorm_dir}/guidance-specification.md` : null,
299
- update_mode: update_mode,
300
- user_context: user_context,
301
- original_topic: original_topic,
302
- session_id: session_id
303
- };
304
-
305
- // Load role-specific template if exists
306
- let roleTemplate = null;
307
- try {
308
- roleTemplate = Read(`templates/role-templates/${role_name}-template.md`);
309
- } catch (e) {
310
- // No template, use generic analysis
311
- }
312
- ```
313
-
314
- **Step 3.3.3: Execute Conceptual Planning Agent**
315
-
316
- **Framework-Based Analysis** (when guidance-specification.md exists):
317
- ```javascript
318
- // Build feature list injection block (only when feature_mode is true)
319
- const featureListBlock = feature_mode ? `
320
- ## Feature Point List (from guidance-specification.md Feature Decomposition)
321
- ${feature_list.map(f => `- **${f.id}** (${f.slug}): ${f.description} [Priority: ${f.priority}]`).join('\n')}
322
-
323
- **IMPORTANT - Feature-Point Output Organization**:
324
- - Generate ONE sub-document per feature: analysis-F-{id}-{slug}.md (e.g., analysis-${feature_list[0].id}-${feature_list[0].slug}.md)
325
- - Generate ONE cross-cutting document: analysis-cross-cutting.md
326
- - analysis.md is a role overview INDEX only (< 1500 words), NOT a full analysis
327
- - Each feature sub-document < 2000 words, cross-cutting < 2000 words
328
- - Total across all files < 15000 words
329
- ` : `
330
- ## Output Organization (fallback: no feature list available)
331
- - Generate analysis.md as main document (< 3000 words)
332
- - Optionally split into analysis-{slug}.md sub-documents (max 5, < 2000 words each)
333
- - Total < 15000 words
334
- `;
335
-
336
- Task(
337
- subagent_type="conceptual-planning-agent",
338
- run_in_background=false,
339
- description=`Generate ${role_name} analysis`,
340
- prompt=`
341
- [FLOW_CONTROL]
342
-
343
- Execute ${role_name} analysis for existing topic framework
344
-
345
- ## Context Loading
346
- ASSIGNED_ROLE: ${role_name}
347
- OUTPUT_LOCATION: ${agentContext.output_location}
348
- ANALYSIS_MODE: ${framework_mode ? "framework_based" : "standalone"}
349
- FEATURE_MODE: ${feature_mode}
350
- UPDATE_MODE: ${update_mode}
351
-
352
- ## Flow Control Steps
353
- 1. **load_topic_framework**
354
- - Action: Load structured topic discussion framework
355
- - Command: Read(${agentContext.framework_path})
356
- - Output: topic_framework_content
357
-
358
- 2. **load_role_template**
359
- - Action: Load ${role_name} planning template
360
- - Command: Read(${roleConfig[role_name].template})
361
- - Output: role_template_guidelines
362
-
363
- 3. **load_session_metadata**
364
- - Action: Load session metadata and user intent
365
- - Command: Read(.workflow/active/${session_id}/workflow-session.json)
366
- - Output: session_context
367
-
368
- 4. **load_user_context** (if exists)
369
- - Action: Load interactive context responses
370
- - Command: Read(${brainstorm_dir}/${role_name}/${role_name}-context.md)
371
- - Output: user_context_answers
372
-
373
- ${roleTemplate ? `
374
- 5. **load_role_template**
375
- - Action: Load role-specific analysis template
376
- - Command: Read(templates/role-templates/${role_name}-template.md)
377
- - Output: role_specific_template
378
- ` : ''}
379
-
380
- 5. **${update_mode ? 'load_existing_analysis' : 'skip'}**
381
- ${update_mode ? `
382
- - Action: Load existing analysis for incremental update
383
- - Command: Read(${brainstorm_dir}/${role_name}/analysis.md)
384
- - Output: existing_analysis_content
385
- ` : ''}
386
-
387
- ${featureListBlock}
388
-
389
- ## Analysis Requirements
390
- **Primary Reference**: Original user prompt from workflow-session.json is authoritative
391
- **Framework Source**: Address all discussion points in guidance-specification.md from ${role_name} perspective
392
- **User Context Integration**: Incorporate interactive Q&A responses into analysis
393
- **Role Focus**: ${roleConfig[role_name].focus_area}
394
- **Template Integration**: Apply role template guidelines within framework structure
395
- ${feature_mode ? `**Feature Organization**: Organize analysis by feature points - each feature gets its own sub-document. Cross-cutting concerns go into analysis-cross-cutting.md.` : ''}
396
- **RFC 2119 Compliance**: Use RFC 2119 keywords (MUST, SHOULD, MAY, MUST NOT, SHOULD NOT) to define all behavioral constraints and recommendations. Every technical decision MUST be expressed with appropriate RFC keyword. Distinguish between absolute requirements (MUST) and recommendations (SHOULD).
397
-
398
- ${roleTemplate ? `
399
- **ROLE-SPECIFIC TEMPLATE (MUST follow this structure)**:
400
- ${roleTemplate}
401
-
402
- Your analysis MUST include all Required Sections from the template above.
403
- ` : ''}
404
-
405
- **For system-architect role specifically**:
406
- - MUST define Data Model for 3-5 core entities with fields, types, constraints, relationships
407
- - MUST create State Machine for at least 1 entity with complex lifecycle (ASCII diagram + transition table)
408
- - MUST define Error Handling Strategy with error classification and recovery mechanisms
409
- - MUST specify Observability Requirements with metrics (at least 5), log events, and health checks
410
- - All constraints MUST use RFC 2119 keywords (MUST, SHOULD, MAY)
411
-
412
- ## Expected Deliverables
413
- ${feature_mode ? `
414
- 1. **analysis.md** - Role overview index (< 1500 words): role perspective summary, feature point index with @-references to sub-documents, cross-cutting summary
415
- 2. **analysis-cross-cutting.md** - Cross-feature decisions (< 2000 words): architecture decisions, technology choices, shared patterns that span multiple features
416
- 3. **analysis-F-{id}-{slug}.md** - One per feature (< 2000 words each): role-specific analysis, recommendations, considerations for that feature
417
- 4. **Framework Reference**: @../guidance-specification.md (if framework_mode)
418
- 5. **User Context Reference**: @./${role_name}-context.md (if user context exists)
419
- 6. **User Intent Alignment**: Validate against session_context
420
- ` : `
421
- 1. **analysis.md** (main document, optionally with analysis-{slug}.md sub-documents)
422
- 2. **Framework Reference**: @../guidance-specification.md (if framework_mode)
423
- 3. **User Context Reference**: @./${role_name}-context.md (if user context exists)
424
- 4. **User Intent Alignment**: Validate against session_context
425
- `}
426
-
427
- ## Update Requirements (if UPDATE_MODE)
428
- - **Preserve Structure**: Maintain existing analysis structure
429
- - **Add "Clarifications" Section**: Document new user context with timestamp
430
- - **Merge Insights**: Integrate new perspectives without removing existing content
431
- - **Resolve Conflicts**: If new context contradicts existing analysis, document both and recommend resolution
432
-
433
- ## Completion Criteria
434
- - Address each discussion point from guidance-specification.md with ${role_name} expertise
435
- - Provide actionable recommendations from ${role_name} perspective within analysis files
436
- - All output files MUST start with "analysis" prefix (no recommendations.md or other naming)
437
- ${feature_mode ? `- Each feature from the feature list has a corresponding analysis-F-{id}-{slug}.md file
438
- - analysis-cross-cutting.md exists with cross-feature decisions
439
- - analysis.md serves as index (< 1500 words), NOT a full analysis document` : ''}
440
- - Reference framework document using @ notation for integration
441
- - Update workflow-session.json with completion status
442
- `
443
- );
444
- ```
445
-
446
- ### Step 3.4: Validation & Finalization
447
-
448
- **Step 3.4.1: Validate Output**
449
- ```bash
450
- VERIFY EXISTS: ${brainstorm_dir}/${role_name}/analysis.md
451
- VERIFY CONTAINS: "@../guidance-specification.md" (if framework_mode)
452
- IF user_context EXISTS:
453
- VERIFY CONTAINS: "@./${role_name}-context.md" OR "## Clarifications" section
454
- ```
455
-
456
- **Step 3.4.2: Update Session Metadata**
457
- ```json
458
- {
459
- "phases": {
460
- "BRAINSTORM": {
461
- "${role_name}": {
462
- "status": "${update_mode ? 'updated' : 'completed'}",
463
- "completed_at": "timestamp",
464
- "framework_addressed": true,
465
- "context_gathered": true,
466
- "output_location": "${brainstorm_dir}/${role_name}/analysis.md",
467
- "update_history": [
468
- {
469
- "timestamp": "ISO8601",
470
- "mode": "${update_mode ? 'incremental' : 'initial'}",
471
- "context_questions": "question_count"
472
- }
473
- ]
474
- }
475
- }
476
- }
477
- }
478
- ```
479
-
480
- **Step 3.4.3: Completion Report**
481
- ```markdown
482
- ✅ ${roleConfig[role_name].title} Analysis Complete
483
-
484
- **Output**: ${brainstorm_dir}/${role_name}/analysis.md
485
- **Mode**: ${update_mode ? 'Incremental Update' : 'New Generation'}
486
- **Framework**: ${framework_mode ? '✓ Aligned' : '✗ Standalone'}
487
- **Context Questions**: ${question_count} answered
488
-
489
- ${update_mode ? '
490
- **Changes**:
491
- - Added "Clarifications" section with new user context
492
- - Merged new insights into existing sections
493
- - Resolved conflicts with framework alignment
494
- ' : ''}
495
-
496
- **Next Steps**:
497
- ${selected_roles.length > 1 ? `
498
- - Continue with other roles: ${selected_roles.filter(r => r !== role_name).join(', ')}
499
- - Run synthesis: /brainstorm --session ${session_id} (auto mode)
500
- ` : `
501
- - Clarify insights: /brainstorm --session ${session_id} (auto mode)
502
- - Generate plan: /workflow-plan --session ${session_id}
503
- `}
504
- ```
505
-
506
- ## Output
507
-
508
- ### Directory Layout
509
-
510
- **Feature-point mode** (when `feature_list` available):
511
- ```
512
- .workflow/active/WFS-{session}/.brainstorming/
513
- ├── guidance-specification.md
514
- └── {role-name}/
515
- ├── {role-name}-context.md # Interactive Q&A responses
516
- ├── analysis.md # Role overview INDEX (< 1500 words)
517
- ├── analysis-cross-cutting.md # Cross-feature decisions (< 2000 words)
518
- ├── analysis-F-001-{slug}.md # Per-feature analysis (< 2000 words)
519
- ├── analysis-F-002-{slug}.md
520
- └── analysis-F-00N-{slug}.md # One per feature (max 8)
521
- ```
522
-
523
- **Fallback mode** (when `feature_list` NOT available):
524
- ```
525
- .workflow/active/WFS-{session}/.brainstorming/
526
- ├── guidance-specification.md
527
- └── {role-name}/
528
- ├── {role-name}-context.md # Interactive Q&A responses
529
- ├── analysis.md # Main analysis (REQUIRED)
530
- └── analysis-{slug}.md # Section documents (optional, max 5)
531
- ```
532
-
533
- ### Document Structure Templates
534
-
535
- #### Feature-Point Mode: analysis.md (Role Overview Index, < 1500 words)
536
-
537
- ```markdown
538
- # ${roleConfig[role_name].title} Analysis: [Topic from Framework]
539
-
540
- ## Framework Reference
541
- **Topic Framework**: @../guidance-specification.md
542
- **Role Focus**: ${roleConfig[role_name].focus_area}
543
- **User Context**: @./${role_name}-context.md
544
-
545
- ## Role Perspective Overview
546
- [Brief summary of this role's perspective on the overall project]
547
-
548
- ## Feature Point Index
549
- | Feature | Sub-document | Key Insight |
550
- |---------|-------------|-------------|
551
- | F-001: [name] | @./analysis-F-001-{slug}.md | [One-line summary] |
552
- | F-002: [name] | @./analysis-F-002-{slug}.md | [One-line summary] |
553
-
554
- ## Cross-Cutting Summary
555
- **Full analysis**: @./analysis-cross-cutting.md
556
- [Brief overview of cross-feature decisions and shared patterns]
557
-
558
- ---
559
- *Generated by ${role_name} analysis addressing structured framework*
560
- ```
561
-
562
- #### Feature-Point Mode: analysis-cross-cutting.md (< 2000 words)
563
-
564
- ```markdown
565
- # Cross-Cutting Analysis: ${roleConfig[role_name].title}
566
-
567
- ## Architecture Decisions
568
- [Decisions that span multiple features]
569
-
570
- ## Technology Choices
571
- [Shared technology selections and rationale]
572
-
573
- ## Shared Patterns
574
- [Common patterns, constraints, and conventions across features]
575
-
576
- ## ${roleConfig[role_name].title} Recommendations
577
- [Role-wide strategic recommendations]
578
- ```
579
-
580
- #### Feature-Point Mode: analysis-F-{id}-{slug}.md (< 2000 words each)
581
-
582
- ```markdown
583
- # Feature ${id}: [Feature Name] - ${roleConfig[role_name].title} Analysis
584
-
585
- ## Feature Overview
586
- [Role-specific perspective on this feature's scope and goals]
587
-
588
- ## Analysis
589
- [Detailed role-specific analysis for this feature]
590
-
591
- ## Recommendations
592
- [Actionable recommendations for this feature from role perspective]
593
-
594
- ## Dependencies & Risks
595
- [Cross-feature dependencies and risks from role viewpoint]
596
- ```
597
-
598
- #### Fallback Mode: analysis.md (New Generation)
599
-
600
- ```markdown
601
- # ${roleConfig[role_name].title} Analysis: [Topic from Framework]
602
-
603
- ## Framework Reference
604
- **Topic Framework**: @../guidance-specification.md
605
- **Role Focus**: ${roleConfig[role_name].focus_area}
606
- **User Context**: @./${role_name}-context.md
607
-
608
- ## User Context Summary
609
- **Context Gathered**: ${question_count} questions answered
610
- **Categories**: ${question_categories.join(', ')}
611
-
612
- ${user_context ? formatContextSummary(user_context) : ''}
613
-
614
- ## Discussion Points Analysis
615
- [Address each point from guidance-specification.md with ${role_name} expertise]
616
-
617
- ### Core Requirements (from framework)
618
- [Role-specific perspective on requirements]
619
-
620
- ### Technical Considerations (from framework)
621
- [Role-specific technical analysis]
622
-
623
- ### User Experience Factors (from framework)
624
- [Role-specific UX considerations]
625
-
626
- ### Implementation Challenges (from framework)
627
- [Role-specific challenges and solutions]
628
-
629
- ### Success Metrics (from framework)
630
- [Role-specific metrics and KPIs]
631
-
632
- ## ${roleConfig[role_name].title} Specific Recommendations
633
- [Role-specific actionable strategies]
634
-
635
- ---
636
- *Generated by ${role_name} analysis addressing structured framework*
637
- *Context gathered: ${new Date().toISOString()}*
638
- ```
639
-
640
- #### Incremental Update Structure
641
-
642
- ```markdown
643
- # ${roleConfig[role_name].title} Analysis: [Topic]
644
-
645
- ## Framework Reference
646
- [Existing content preserved]
647
-
648
- ## Clarifications
649
- ### Session ${new Date().toISOString().split('T')[0]}
650
- ${Object.entries(user_context).map(([q, a]) => `
651
- - **Q**: ${q} (Category: ${a.category})
652
- **A**: ${a.answer}
653
- `).join('\n')}
654
-
655
- ## User Context Summary
656
- [Updated with new context]
657
-
658
- ## Discussion Points Analysis
659
- [Existing content enhanced with new insights]
660
-
661
- [Rest of sections updated based on clarifications]
662
- ```
663
-
664
- ### Parameter Combinations
665
-
666
- | Scenario | Command | Behavior |
667
- |----------|---------|----------|
668
- | New analysis | `/brainstorm ux-expert` | Generate + ask context questions |
669
- | Quick generation | `/brainstorm ux-expert --skip-questions` | Generate without context |
670
- | Update existing | `/brainstorm ux-expert --update` | Ask clarifications + merge |
671
- | Force questions | `/brainstorm ux-expert --include-questions` | Ask even if exists |
672
- | Specific session | `/brainstorm ux-expert --session WFS-xxx` | Target specific session |
673
-
674
- ### Quality Assurance
675
-
676
- **Required Analysis Elements**:
677
- - [ ] Framework discussion points addressed (if framework_mode)
678
- - [ ] User context integrated (if context gathered)
679
- - [ ] Role template guidelines applied
680
- - [ ] Output files follow naming convention (analysis*.md only)
681
- - [ ] Framework reference using @ notation
682
- - [ ] Session metadata updated
683
- - [ ] Feature-point organization used when feature_list available (if feature_mode)
684
- - [ ] analysis.md is index only (< 1500 words) when in feature_mode
685
- - [ ] analysis-cross-cutting.md exists when in feature_mode
686
- - [ ] One analysis-F-{id}-{slug}.md per feature when in feature_mode
687
-
688
- **Context Quality**:
689
- - [ ] Questions in Chinese with business context
690
- - [ ] Options include technical trade-offs
691
- - [ ] Categories aligned with role focus
692
- - [ ] No generic questions unrelated to framework
693
-
694
- **Update Quality** (if update_mode):
695
- - [ ] "Clarifications" section added with timestamp
696
- - [ ] New insights merged without content loss
697
- - [ ] Conflicts documented and resolved
698
- - [ ] Framework alignment maintained
699
-
700
- - **TodoWrite**: Mark Phase 3 completed (auto mode: collapse N parallel sub-tasks to summary)
701
-
702
- ## Error Handling
703
-
704
- | Error | Recovery |
705
- |-------|----------|
706
- | Invalid role name | Show valid roles list, exit |
707
- | No active session | Error with guidance to run /brainstorm first |
708
- | Missing framework | Warn and generate standalone analysis |
709
- | Agent execution failure | Check error.log, retry with --skip-questions |
710
-
711
- ## Advanced Usage
712
-
713
- ### Batch Role Generation (via auto mode)
714
- ```bash
715
- # Auto mode handles multiple roles in parallel
716
- /brainstorm "topic" --count 3
717
- # → Internally calls role-analysis for each selected role with --skip-questions
718
- ```
719
-
720
- ### Manual Multi-Role Workflow
721
- ```bash
722
- # 1. Create framework
723
- /brainstorm "Build real-time collaboration platform" --count 3
724
-
725
- # 2. Generate each role with context
726
- /brainstorm system-architect --include-questions
727
- /brainstorm ui-designer --include-questions
728
- /brainstorm product-manager --include-questions
729
-
730
- # 3. Synthesize insights
731
- /brainstorm --session WFS-xxx
732
- ```
733
-
734
- ### Iterative Refinement
735
- ```bash
736
- # Initial generation
737
- /brainstorm ux-expert
738
-
739
- # User reviews and wants more depth
740
- /brainstorm ux-expert --update --include-questions
741
- # → Asks clarification questions, merges new insights
742
- ```
743
-
744
- ## Next Phase
745
-
746
- Return to orchestrator:
747
- - If auto mode → Continue to [Phase 4: Synthesis](04-synthesis.md)
748
- - If single-role mode → Workflow complete, report results