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,338 +0,0 @@
1
- # Phase 2: Context Gathering
2
-
3
- Gather project context and analyze codebase via context-search-agent with parallel exploration.
4
-
5
- ## Objective
6
-
7
- - Gather project context using context-search-agent
8
- - Identify critical files, architecture patterns, and constraints
9
- - Detect conflict risk level for Phase 3 decision
10
- - Update planning-notes.md with findings
11
-
12
- ## Core Philosophy
13
-
14
- - **Agent Delegation**: Delegate all discovery to `context-search-agent` for autonomous execution
15
- - **Detection-First**: Check for existing context-package before executing
16
- - **Plan Mode**: Full comprehensive analysis (vs lightweight brainstorm mode)
17
- - **Standardized Output**: Generate `.workflow/active/{session}/.process/context-package.json`
18
-
19
- ## Execution
20
-
21
- ### Step 2.1: Context-Package Detection
22
-
23
- **Execute First** - Check if valid package already exists:
24
-
25
- ```javascript
26
- const contextPackagePath = `.workflow/active/${sessionId}/.process/context-package.json`;
27
-
28
- if (file_exists(contextPackagePath)) {
29
- const existing = Read(contextPackagePath);
30
-
31
- // Validate package belongs to current session
32
- if (existing?.metadata?.session_id === sessionId) {
33
- console.log("Valid context-package found for session:", sessionId);
34
- console.log("Stats:", existing.statistics);
35
- console.log("Conflict Risk:", existing.conflict_detection.risk_level);
36
- // Skip execution, store variables and proceed to Step 2.5
37
- contextPath = contextPackagePath;
38
- conflictRisk = existing.conflict_detection.risk_level;
39
- return; // Early exit - skip Steps 2.2-2.4
40
- }
41
- }
42
- ```
43
-
44
- ### Step 2.2: Complexity Assessment & Parallel Explore
45
-
46
- **Only execute if Step 2.1 finds no valid package**
47
-
48
- ```javascript
49
- // 2.2.1 Complexity Assessment
50
- function analyzeTaskComplexity(taskDescription) {
51
- const text = taskDescription.toLowerCase();
52
- if (/architect|refactor|restructure|modular|cross-module/.test(text)) return 'High';
53
- if (/multiple|several|integrate|migrate|extend/.test(text)) return 'Medium';
54
- return 'Low';
55
- }
56
-
57
- const ANGLE_PRESETS = {
58
- architecture: ['architecture', 'dependencies', 'modularity', 'integration-points'],
59
- security: ['security', 'auth-patterns', 'dataflow', 'validation'],
60
- performance: ['performance', 'bottlenecks', 'caching', 'data-access'],
61
- bugfix: ['error-handling', 'dataflow', 'state-management', 'edge-cases'],
62
- feature: ['patterns', 'integration-points', 'testing', 'dependencies'],
63
- refactor: ['architecture', 'patterns', 'dependencies', 'testing']
64
- };
65
-
66
- function selectAngles(taskDescription, complexity) {
67
- const text = taskDescription.toLowerCase();
68
- let preset = 'feature';
69
- if (/refactor|architect|restructure/.test(text)) preset = 'architecture';
70
- else if (/security|auth|permission/.test(text)) preset = 'security';
71
- else if (/performance|slow|optimi/.test(text)) preset = 'performance';
72
- else if (/fix|bug|error|issue/.test(text)) preset = 'bugfix';
73
-
74
- const count = complexity === 'High' ? 4 : (complexity === 'Medium' ? 3 : 1);
75
- return ANGLE_PRESETS[preset].slice(0, count);
76
- }
77
-
78
- const complexity = analyzeTaskComplexity(task_description);
79
- const selectedAngles = selectAngles(task_description, complexity);
80
- const sessionFolder = `.workflow/active/${sessionId}/.process`;
81
-
82
- // 2.2.2 Launch Parallel Explore Agents
83
- const explorationTasks = selectedAngles.map((angle, index) =>
84
- Task(
85
- subagent_type="cli-explore-agent",
86
- run_in_background=false,
87
- description=`Explore: ${angle}`,
88
- prompt=`
89
- ## Task Objective
90
- Execute **${angle}** exploration for task planning context. Analyze codebase from this specific angle to discover relevant structure, patterns, and constraints.
91
-
92
- ## Assigned Context
93
- - **Exploration Angle**: ${angle}
94
- - **Task Description**: ${task_description}
95
- - **Session ID**: ${sessionId}
96
- - **Exploration Index**: ${index + 1} of ${selectedAngles.length}
97
- - **Output File**: ${sessionFolder}/exploration-${angle}.json
98
-
99
- ## Agent Initialization
100
- The cli-explore-agent autonomously executes project structure discovery, schema loading, project context loading, and keyword search as part of its Phase 1 initialization. No manual steps needed.
101
-
102
- ## Exploration Strategy (${angle} focus)
103
-
104
- **Step 1: Structural Scan** (Bash)
105
- - Identify modules related to ${angle}
106
- - Locate files relevant to ${angle} aspect
107
- - Analyze imports/dependencies from ${angle} perspective
108
-
109
- **Step 2: Semantic Analysis** (Gemini CLI)
110
- - How does existing code handle ${angle} concerns?
111
- - What patterns are used for ${angle}?
112
- - Where would new code integrate from ${angle} viewpoint?
113
-
114
- **Step 3: Write Output**
115
- - Consolidate ${angle} findings into JSON
116
- - Identify ${angle}-specific clarification needs
117
-
118
- ## Expected Output
119
-
120
- **File**: ${sessionFolder}/exploration-${angle}.json
121
-
122
- **Required Fields** (all ${angle} focused):
123
- - Follow explore-json-schema.json exactly (loaded during agent initialization)
124
- - All fields scoped to ${angle} perspective
125
- - Ensure rationale is specific to ${angle} topic (not generic)
126
- - Include file:line locations in integration_points
127
-
128
- ## Success Criteria
129
- - [ ] At least 3 relevant files identified with ${angle} rationale
130
- - [ ] Patterns are actionable (code examples, not generic advice)
131
- - [ ] Integration points include file:line locations
132
- - [ ] Constraints are project-specific to ${angle}
133
- - [ ] JSON output follows schema exactly
134
- - [ ] clarification_needs includes options + recommended
135
-
136
- ## Output
137
- Write: ${sessionFolder}/exploration-${angle}.json
138
- Return: 2-3 sentence summary of ${angle} findings
139
- `
140
- )
141
- );
142
-
143
- // 2.2.3 Generate Manifest after all complete
144
- const explorationFiles = bash(`find ${sessionFolder} -name "exploration-*.json" -type f`).split('\n').filter(f => f.trim());
145
- const explorationManifest = {
146
- session_id: sessionId,
147
- task_description,
148
- timestamp: new Date().toISOString(),
149
- complexity,
150
- exploration_count: selectedAngles.length,
151
- angles_explored: selectedAngles,
152
- explorations: explorationFiles.map(file => {
153
- const data = JSON.parse(Read(file));
154
- return { angle: data._metadata.exploration_angle, file: file.split('/').pop(), path: file, index: data._metadata.exploration_index };
155
- })
156
- };
157
- Write(`${sessionFolder}/explorations-manifest.json`, JSON.stringify(explorationManifest, null, 2));
158
- ```
159
-
160
- ### Step 2.3: Invoke Context-Search Agent
161
-
162
- **Only execute after Step 2.2 completes**
163
-
164
- ```javascript
165
- // Load user intent from planning-notes.md (from Phase 1)
166
- const planningNotesPath = `.workflow/active/${sessionId}/planning-notes.md`;
167
- let userIntent = { goal: task_description, key_constraints: "None specified" };
168
-
169
- if (file_exists(planningNotesPath)) {
170
- const notesContent = Read(planningNotesPath);
171
- const goalMatch = notesContent.match(/\*\*GOAL\*\*:\s*(.+)/);
172
- const constraintsMatch = notesContent.match(/\*\*KEY_CONSTRAINTS\*\*:\s*(.+)/);
173
- if (goalMatch) userIntent.goal = goalMatch[1].trim();
174
- if (constraintsMatch) userIntent.key_constraints = constraintsMatch[1].trim();
175
- }
176
-
177
- Task(
178
- subagent_type="context-search-agent",
179
- run_in_background=false,
180
- description="Gather comprehensive context for plan",
181
- prompt=`
182
- ## Execution Mode
183
- **PLAN MODE** (Comprehensive) - Full Phase 1-3 execution with priority sorting
184
-
185
- ## Session Information
186
- - **Session ID**: ${sessionId}
187
- - **Task Description**: ${task_description}
188
- - **Output Path**: .workflow/${sessionId}/.process/context-package.json
189
-
190
- ## User Intent (from Phase 1 - Planning Notes)
191
- **GOAL**: ${userIntent.goal}
192
- **KEY_CONSTRAINTS**: ${userIntent.key_constraints}
193
-
194
- This is the PRIMARY context source - all subsequent analysis must align with user intent.
195
-
196
- ## Exploration Input (from Step 2.2)
197
- - **Manifest**: ${sessionFolder}/explorations-manifest.json
198
- - **Exploration Count**: ${explorationManifest.exploration_count}
199
- - **Angles**: ${explorationManifest.angles_explored.join(', ')}
200
- - **Complexity**: ${complexity}
201
-
202
- ## Mission
203
- Execute complete context-search-agent workflow (Phase 1-3) for implementation planning.
204
-
205
- Key emphasis:
206
- - Run: ccw spec load --category exploration FIRST (per your spec Phase 1.1b)
207
- - Synthesize exploration results with project context
208
- - Generate prioritized_context with user_intent alignment
209
- - Apply specs/*.md constraints during conflict detection
210
-
211
- Input priority: User Intent > project-tech.json > Exploration results > Code discovery > Web examples
212
-
213
- ## Output Requirements
214
-
215
- Complete context-package.json must include a **prioritized_context** section:
216
- ```json
217
- {
218
- "prioritized_context": {
219
- "user_intent": { "goal": "...", "scope": "...", "key_constraints": ["..."] },
220
- "priority_tiers": {
221
- "critical": [{ "path": "...", "relevance": 0.95, "rationale": "..." }],
222
- "high": [], "medium": [], "low": []
223
- },
224
- "dependency_order": ["module1", "module2", "module3"],
225
- "sorting_rationale": "Based on user goal alignment, exploration critical files, and dependency graph"
226
- }
227
- }
228
- ```
229
-
230
- All other required fields (metadata, project_context, project_guidelines, assets, dependencies, brainstorm_artifacts, conflict_detection, exploration_results) follow context-search-agent standard output schema.
231
-
232
- ## Planning Notes Record (REQUIRED)
233
- After completing context-package.json, append to planning-notes.md:
234
-
235
- **File**: .workflow/active/${sessionId}/planning-notes.md
236
- **Location**: Under "## Context Findings (Phase 2)" section
237
- **Format**:
238
- ### [Context-Search Agent] YYYY-MM-DD
239
- - **Note**: [Brief summary of key findings]
240
-
241
- Execute autonomously following agent documentation.
242
- Report completion with statistics.
243
- `
244
- )
245
- ```
246
-
247
- ### Step 2.4: Output Verification
248
-
249
- After agent completes, verify output:
250
-
251
- ```javascript
252
- // Verify file was created
253
- const outputPath = `.workflow/active/${sessionId}/.process/context-package.json`;
254
- if (!file_exists(outputPath)) {
255
- throw new Error("Agent failed to generate context-package.json");
256
- }
257
-
258
- // Store variables for subsequent phases
259
- contextPath = outputPath;
260
-
261
- // Verify exploration_results included
262
- const pkg = JSON.parse(Read(outputPath));
263
- if (pkg.exploration_results?.exploration_count > 0) {
264
- console.log(`Exploration results aggregated: ${pkg.exploration_results.exploration_count} angles`);
265
- }
266
-
267
- conflictRisk = pkg.conflict_detection?.risk_level || 'low';
268
- ```
269
-
270
- ### TodoWrite Update (Phase 2 in progress - tasks attached)
271
-
272
- ```json
273
- [
274
- {"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
275
- {"content": "Phase 2: Context Gathering", "status": "in_progress", "activeForm": "Executing context gathering"},
276
- {"content": " -> Analyze codebase structure", "status": "in_progress", "activeForm": "Analyzing codebase structure"},
277
- {"content": " -> Identify integration points", "status": "pending", "activeForm": "Identifying integration points"},
278
- {"content": " -> Generate context package", "status": "pending", "activeForm": "Generating context package"},
279
- {"content": "Phase 4: Task Generation", "status": "pending", "activeForm": "Executing task generation"}
280
- ]
281
- ```
282
-
283
- ### TodoWrite Update (Phase 2 completed - tasks collapsed)
284
-
285
- ```json
286
- [
287
- {"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
288
- {"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
289
- {"content": "Phase 4: Task Generation", "status": "pending", "activeForm": "Executing task generation"}
290
- ]
291
- ```
292
-
293
- ### Step 2.5: Update Planning Notes
294
-
295
- After context gathering completes, update planning-notes.md with findings:
296
-
297
- ```javascript
298
- // Read context-package to extract key findings
299
- const contextPackage = JSON.parse(Read(contextPath))
300
- const conflictRisk = contextPackage.conflict_detection?.risk_level || 'low'
301
- const criticalFiles = (contextPackage.exploration_results?.aggregated_insights?.critical_files || [])
302
- .slice(0, 5).map(f => f.path)
303
- const archPatterns = contextPackage.project_context?.architecture_patterns || []
304
- const constraints = contextPackage.exploration_results?.aggregated_insights?.constraints || []
305
-
306
- // Append Phase 2 findings to planning-notes.md
307
- Edit(planningNotesPath, {
308
- old: '## Context Findings (Phase 2)\n(To be filled by context-gather)',
309
- new: `## Context Findings (Phase 2)
310
-
311
- - **CRITICAL_FILES**: ${criticalFiles.join(', ') || 'None identified'}
312
- - **ARCHITECTURE**: ${archPatterns.join(', ') || 'Not detected'}
313
- - **CONFLICT_RISK**: ${conflictRisk}
314
- - **CONSTRAINTS**: ${constraints.length > 0 ? constraints.join('; ') : 'None'}`
315
- })
316
-
317
- // Append Phase 2 constraints to consolidated list
318
- Edit(planningNotesPath, {
319
- old: '## Consolidated Constraints (Phase 4 Input)',
320
- new: `## Consolidated Constraints (Phase 4 Input)
321
- ${constraints.map((c, i) => `${i + 2}. [Context] ${c}`).join('\n')}`
322
- })
323
- ```
324
-
325
- **Auto-Continue**: Return to user showing Phase 2 results, then auto-continue to Phase 3/4 (depending on `conflictRisk`).
326
-
327
- ## Output
328
-
329
- - **Variable**: `contextPath` (path to context-package.json)
330
- - **Variable**: `conflictRisk` (none/low/medium/high)
331
- - **File**: `context-package.json`
332
- - **TodoWrite**: Mark Phase 2 completed, determine Phase 3 or Phase 4
333
-
334
- ## Next Phase
335
-
336
- Return to orchestrator. Orchestrator checks `conflictRisk`:
337
- - If `conflictRisk >= medium` -> [Phase 3: Conflict Resolution](03-conflict-resolution.md)
338
- - If `conflictRisk < medium` -> [Phase 4: Task Generation](04-task-generation.md)