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,343 +0,0 @@
1
- ---
2
- name: plan
3
- description: Batch plan issue resolution using issue-plan-agent (explore + plan closed-loop)
4
- argument-hint: "[-y|--yes] --all-pending <issue-id>[,<issue-id>,...] [--batch-size 3]"
5
- allowed-tools: TodoWrite(*), Agent(*), Skill(*), AskUserQuestion(*), Bash(*), Read(*), Write(*)
6
- ---
7
-
8
- ## Auto Mode
9
-
10
- When `--yes` or `-y`: Auto-bind solutions without confirmation, use recommended settings.
11
-
12
- # Issue Plan Command (/issue:plan)
13
-
14
- ## Overview
15
-
16
- Unified planning command using **issue-plan-agent** that combines exploration and planning into a single closed-loop workflow.
17
-
18
- **Behavior:**
19
- - Single solution per issue → auto-bind
20
- - Multiple solutions → return for user selection
21
- - Agent handles file generation
22
-
23
- ## Core Guidelines
24
-
25
- **⚠️ Data Access Principle**: Issues and solutions files can grow very large. To avoid context overflow:
26
-
27
- | Operation | Correct | Incorrect |
28
- |-----------|---------|-----------|
29
- | List issues (brief) | `ccw issue list --status pending --brief` | `Read('issues.jsonl')` |
30
- | Read issue details | `ccw issue status <id> --json` | `Read('issues.jsonl')` |
31
- | Update status | `ccw issue update <id> --status ...` | Direct file edit |
32
- | Bind solution | `ccw issue bind <id> <sol-id>` | Direct file edit |
33
-
34
- **Output Options**:
35
- - `--brief`: JSON with minimal fields (id, title, status, priority, tags)
36
- - `--json`: Full JSON (agent use only)
37
-
38
- **Orchestration vs Execution**:
39
- - **Command (orchestrator)**: Use `--brief` for minimal context
40
- - **Agent (executor)**: Fetch full details → `ccw issue status <id> --json`
41
-
42
- **ALWAYS** use CLI commands for CRUD operations. **NEVER** read entire `issues.jsonl` or `solutions/*.jsonl` directly.
43
-
44
- ## Usage
45
-
46
- ```bash
47
- /issue:plan [<issue-id>[,<issue-id>,...]] [FLAGS]
48
-
49
- # Examples
50
- /issue:plan # Default: --all-pending
51
- /issue:plan GH-123 # Single issue
52
- /issue:plan GH-123,GH-124,GH-125 # Batch (up to 3)
53
- /issue:plan --all-pending # All pending issues (explicit)
54
-
55
- # Flags
56
- --batch-size <n> Max issues per agent batch (default: 3)
57
- ```
58
-
59
- ## Execution Process
60
-
61
- ```
62
- Phase 1: Issue Loading & Intelligent Grouping
63
- ├─ Parse input (single, comma-separated, or --all-pending)
64
- ├─ Fetch issue metadata (ID, title, tags)
65
- ├─ Validate issues exist (create if needed)
66
- └─ Intelligent grouping via Gemini (semantic similarity, max 3 per batch)
67
-
68
- Phase 2: Unified Explore + Plan (issue-plan-agent)
69
- ├─ Launch issue-plan-agent per batch
70
- ├─ Agent performs:
71
- │ ├─ ACE semantic search for each issue
72
- │ ├─ Codebase exploration (files, patterns, dependencies)
73
- │ ├─ Solution generation with task breakdown
74
- │ └─ Conflict detection across issues
75
- └─ Output: solution JSON per issue
76
-
77
- Phase 3: Solution Registration & Binding
78
- ├─ Append solutions to solutions/{issue-id}.jsonl
79
- ├─ Single solution per issue → auto-bind
80
- ├─ Multiple candidates → AskUserQuestion to select
81
- └─ Update issues.jsonl with bound_solution_id
82
-
83
- Phase 4: Summary
84
- ├─ Display bound solutions
85
- ├─ Show task counts per issue
86
- └─ Display next steps (/issue:queue)
87
- ```
88
-
89
- ## Implementation
90
-
91
- ### Phase 1: Issue Loading (Brief Info Only)
92
-
93
- ```javascript
94
- const batchSize = flags.batchSize || 3;
95
- let issues = []; // {id, title, tags} - brief info for grouping only
96
-
97
- // Default to --all-pending if no input provided
98
- const useAllPending = flags.allPending || !userInput || userInput.trim() === '';
99
-
100
- if (useAllPending) {
101
- // Get pending issues with brief metadata via CLI
102
- const result = Bash(`ccw issue list --status pending,registered --json`).trim();
103
- const parsed = result ? JSON.parse(result) : [];
104
- issues = parsed.map(i => ({ id: i.id, title: i.title || '', tags: i.tags || [] }));
105
-
106
- if (issues.length === 0) {
107
- console.log('No pending issues found.');
108
- return;
109
- }
110
- console.log(`Found ${issues.length} pending issues`);
111
- } else {
112
- // Parse comma-separated issue IDs, fetch brief metadata
113
- const ids = userInput.includes(',')
114
- ? userInput.split(',').map(s => s.trim())
115
- : [userInput.trim()];
116
-
117
- for (const id of ids) {
118
- Bash(`ccw issue init ${id} --title "Issue ${id}" 2>/dev/null || true`);
119
- const info = Bash(`ccw issue status ${id} --json`).trim();
120
- const parsed = info ? JSON.parse(info) : {};
121
- issues.push({ id, title: parsed.title || '', tags: parsed.tags || [] });
122
- }
123
- }
124
- // Note: Agent fetches full issue content via `ccw issue status <id> --json`
125
-
126
- // Intelligent grouping: Analyze issues by title/tags, group semantically similar ones
127
- // Strategy: Same module/component, related bugs, feature clusters
128
- // Constraint: Max ${batchSize} issues per batch
129
-
130
- console.log(`Processing ${issues.length} issues in ${batches.length} batch(es)`);
131
-
132
- TodoWrite({
133
- todos: batches.map((_, i) => ({
134
- content: `Plan batch ${i+1}`,
135
- status: 'pending',
136
- activeForm: `Planning batch ${i+1}`
137
- }))
138
- });
139
- ```
140
-
141
- ### Phase 2: Unified Explore + Plan (issue-plan-agent) - PARALLEL
142
-
143
- ```javascript
144
- Bash(`mkdir -p .workflow/issues/solutions`);
145
- const pendingSelections = []; // Collect multi-solution issues for user selection
146
- const agentResults = []; // Collect all agent results for conflict aggregation
147
-
148
- // Build prompts for all batches
149
- const agentTasks = batches.map((batch, batchIndex) => {
150
- const issueList = batch.map(i => `- ${i.id}: ${i.title}${i.tags.length ? ` [${i.tags.join(', ')}]` : ''}`).join('\n');
151
- const batchIds = batch.map(i => i.id);
152
-
153
- const issuePrompt = `
154
- ## Plan Issues
155
-
156
- **Issues** (grouped by similarity):
157
- ${issueList}
158
-
159
- **Project Root**: ${process.cwd()}
160
-
161
- ### Project Context (MANDATORY)
162
- 1. Read: .workflow/project-tech.json (technology stack, architecture)
163
- 2. Read: .workflow/specs/*.md (constraints and conventions)
164
-
165
- ### Workflow
166
- 1. Fetch issue details: ccw issue status <id> --json
167
- 2. **Analyze failure history** (if issue.feedback exists):
168
- - Extract failure details from issue.feedback (type='failure', stage='execute')
169
- - Parse error_type, message, task_id, solution_id from content JSON
170
- - Identify failure patterns: repeated errors, root causes, blockers
171
- - **Constraint**: Avoid repeating failed approaches
172
- 3. Load project context files
173
- 4. Explore codebase (ACE semantic search)
174
- 5. Plan solution with tasks (schema: solution-schema.json)
175
- - **If previous solution failed**: Reference failure analysis in solution.approach
176
- - Add explicit verification steps to prevent same failure mode
177
- 6. **If github_url exists**: Add final task to comment on GitHub issue
178
- 7. Write solution to: .workflow/issues/solutions/{issue-id}.jsonl
179
- 8. **CRITICAL - Binding Decision**:
180
- - Single solution → **MUST execute**: ccw issue bind <issue-id> <solution-id>
181
- - Multiple solutions → Return pending_selection only (no bind)
182
-
183
- ### Failure-Aware Planning Rules
184
- - **Extract failure patterns**: Parse issue.feedback where type='failure' and stage='execute'
185
- - **Identify root causes**: Analyze error_type (test_failure, compilation, timeout, etc.)
186
- - **Design alternative approach**: Create solution that addresses root cause
187
- - **Add prevention steps**: Include explicit verification to catch same error earlier
188
- - **Document lessons**: Reference previous failures in solution.approach
189
-
190
- ### Rules
191
- - Solution ID format: SOL-{issue-id}-{uid} (uid: 4 random alphanumeric chars, e.g., a7x9)
192
- - Single solution per issue → auto-bind via ccw issue bind
193
- - Multiple solutions → register only, return pending_selection
194
- - Tasks must have quantified convergence.criteria
195
-
196
- ### Return Summary
197
- {"bound":[{"issue_id":"...","solution_id":"...","task_count":N}],"pending_selection":[{"issue_id":"...","solutions":[{"id":"...","description":"...","task_count":N}]}]}
198
- `;
199
-
200
- return { batchIndex, batchIds, issuePrompt, batch };
201
- });
202
-
203
- // Launch agents in parallel (max 10 concurrent)
204
- const MAX_PARALLEL = 10;
205
- for (let i = 0; i < agentTasks.length; i += MAX_PARALLEL) {
206
- const chunk = agentTasks.slice(i, i + MAX_PARALLEL);
207
- const taskIds = [];
208
-
209
- // Launch chunk in parallel
210
- for (const { batchIndex, batchIds, issuePrompt, batch } of chunk) {
211
- updateTodo(`Plan batch ${batchIndex + 1}`, 'in_progress');
212
- const taskId = Task(
213
- subagent_type="issue-plan-agent",
214
- run_in_background=true,
215
- description=`Explore & plan ${batch.length} issues: ${batchIds.join(', ')}`,
216
- prompt=issuePrompt
217
- );
218
- taskIds.push({ taskId, batchIndex });
219
- }
220
-
221
- console.log(`Launched ${taskIds.length} agents (batch ${i/MAX_PARALLEL + 1}/${Math.ceil(agentTasks.length/MAX_PARALLEL)})...`);
222
-
223
- // Collect results from this chunk
224
- for (const { taskId, batchIndex } of taskIds) {
225
- const result = TaskOutput({ task_id: taskId, block: true });
226
-
227
- // Extract JSON from potential markdown code blocks (agent may wrap in ```json...```)
228
- const jsonText = extractJsonFromMarkdown(result);
229
- let summary;
230
- try {
231
- summary = JSON.parse(jsonText);
232
- } catch (e) {
233
- console.log(`⚠ Batch ${batchIndex + 1}: Failed to parse agent result, skipping`);
234
- updateTodo(`Plan batch ${batchIndex + 1}`, 'completed');
235
- continue;
236
- }
237
- agentResults.push(summary); // Store for Phase 3 conflict aggregation
238
-
239
- // Verify binding for bound issues (agent should have executed bind)
240
- for (const item of summary.bound || []) {
241
- const status = JSON.parse(Bash(`ccw issue status ${item.issue_id} --json`).trim());
242
- if (status.bound_solution_id === item.solution_id) {
243
- console.log(`✓ ${item.issue_id}: ${item.solution_id} (${item.task_count} tasks)`);
244
- } else {
245
- // Fallback: agent failed to bind, execute here
246
- Bash(`ccw issue bind ${item.issue_id} ${item.solution_id}`);
247
- console.log(`✓ ${item.issue_id}: ${item.solution_id} (${item.task_count} tasks) [recovered]`);
248
- }
249
- }
250
- // Collect pending selections for Phase 3
251
- for (const pending of summary.pending_selection || []) {
252
- pendingSelections.push(pending);
253
- }
254
- updateTodo(`Plan batch ${batchIndex + 1}`, 'completed');
255
- }
256
- }
257
- ```
258
-
259
- ### Phase 3: Solution Selection (if pending)
260
-
261
- ```javascript
262
- // Handle multi-solution issues
263
- for (const pending of pendingSelections) {
264
- if (pending.solutions.length === 0) continue;
265
-
266
- // Auto mode: auto-bind first (highest-ranked) solution
267
- if (autoYes) {
268
- const solId = pending.solutions[0].id;
269
- Bash(`ccw issue bind ${pending.issue_id} ${solId}`);
270
- console.log(`✓ ${pending.issue_id}: ${solId} bound (auto)`);
271
- continue;
272
- }
273
-
274
- const options = pending.solutions.slice(0, 4).map(sol => ({
275
- label: `${sol.id} (${sol.task_count} tasks)`,
276
- description: sol.description || sol.approach || 'No description'
277
- }));
278
-
279
- const answer = AskUserQuestion({
280
- questions: [{
281
- question: `Issue ${pending.issue_id}: which solution to bind?`,
282
- header: pending.issue_id,
283
- options: options,
284
- multiSelect: false
285
- }]
286
- });
287
-
288
- const selected = answer[Object.keys(answer)[0]];
289
- if (!selected || selected === 'Other') continue;
290
-
291
- const solId = selected.split(' ')[0];
292
- Bash(`ccw issue bind ${pending.issue_id} ${solId}`);
293
- console.log(`✓ ${pending.issue_id}: ${solId} bound`);
294
- }
295
- ```
296
-
297
- ### Phase 4: Summary
298
-
299
- ```javascript
300
- // Count planned issues via CLI
301
- const planned = JSON.parse(Bash(`ccw issue list --status planned --brief`) || '[]');
302
- const plannedCount = planned.length;
303
-
304
- console.log(`
305
- ## Done: ${issues.length} issues → ${plannedCount} planned
306
-
307
- Next: \`/issue:queue\` → \`/issue:execute\`
308
- `);
309
- ```
310
-
311
- ## Error Handling
312
-
313
- | Error | Resolution |
314
- |-------|------------|
315
- | Issue not found | Auto-create in issues.jsonl |
316
- | ACE search fails | Agent falls back to ripgrep |
317
- | No solutions generated | Display error, suggest manual planning |
318
- | User cancels selection | Skip issue, continue with others |
319
- | File conflicts | Agent detects and suggests resolution order |
320
-
321
- ## Bash Compatibility
322
-
323
- **Avoid**: `$(cmd)`, `$var`, `for` loops — will be escaped incorrectly
324
-
325
- **Use**: Simple commands + `&&` chains, quote comma params `"pending,registered"`
326
-
327
- ## Quality Checklist
328
-
329
- Before completing, verify:
330
-
331
- - [ ] All input issues have solutions in `solutions/{issue-id}.jsonl`
332
- - [ ] Single solution issues are auto-bound (`bound_solution_id` set)
333
- - [ ] Multi-solution issues returned in `pending_selection` for user choice
334
- - [ ] Each solution has executable tasks with `files`
335
- - [ ] Task convergence criteria are quantified (not vague)
336
- - [ ] Conflicts detected and reported (if multiple issues touch same files)
337
- - [ ] Issue status updated to `planned` after binding
338
-
339
- ## Related Commands
340
-
341
- - `/issue:queue` - Form execution queue from bound solutions
342
- - `ccw issue list` - List all issues
343
- - `ccw issue status` - View issue and solution details