claude-code-workflow 6.3.43 → 6.3.46
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.
- package/.claude/agents/tdd-developer.md +530 -0
- package/.claude/commands/ccw-coordinator.md +1042 -0
- package/.claude/commands/ccw.md +486 -0
- package/.claude/commands/issue/discover-by-prompt.md +5 -1
- package/.claude/commands/issue/discover.md +472 -468
- package/.claude/commands/issue/execute.md +580 -581
- package/.claude/commands/issue/new.md +417 -413
- package/.claude/commands/issue/plan.md +5 -1
- package/.claude/commands/issue/queue.md +445 -441
- package/.claude/commands/task/breakdown.md +207 -203
- package/.claude/commands/task/replan.md +440 -436
- package/.claude/commands/workflow/action-plan-verify.md +485 -447
- package/.claude/commands/workflow/brainstorm/artifacts.md +457 -453
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +5 -1
- package/.claude/commands/workflow/brainstorm/synthesis.md +402 -398
- package/.claude/commands/workflow/clean.md +67 -35
- package/.claude/commands/workflow/debug-with-file.md +670 -666
- package/.claude/commands/workflow/debug.md +331 -327
- package/.claude/commands/workflow/develop-with-file.md +5 -1
- package/.claude/commands/workflow/execute.md +546 -498
- package/.claude/commands/workflow/lite-execute.md +44 -26
- package/.claude/commands/workflow/lite-fix.md +780 -730
- package/.claude/commands/workflow/lite-lite-lite.md +5 -1
- package/.claude/commands/workflow/lite-plan.md +87 -39
- package/.claude/commands/workflow/multi-cli-plan.md +572 -568
- package/.claude/commands/workflow/plan-verify.md +527 -0
- package/.claude/commands/workflow/plan.md +555 -551
- package/.claude/commands/workflow/replan.md +572 -515
- package/.claude/commands/workflow/review-fix.md +608 -610
- package/.claude/commands/workflow/session/complete.md +37 -14
- package/.claude/commands/workflow/session/solidify.md +303 -299
- package/.claude/commands/workflow/tdd-plan.md +630 -597
- package/.claude/commands/workflow/tdd-verify.md +391 -206
- package/.claude/commands/workflow/tools/conflict-resolution.md +24 -12
- package/.claude/commands/workflow/tools/task-generate-agent.md +583 -563
- package/.claude/commands/workflow/tools/task-generate-tdd.md +749 -517
- package/.claude/commands/workflow/ui-design/animation-extract.md +1154 -1150
- package/.claude/commands/workflow/ui-design/layout-extract.md +792 -788
- package/.claude/commands/workflow/ui-design/style-extract.md +777 -773
- package/.claude/skills/ccw-help/command.json +5 -5
- package/.claude/skills/ccw-help/scripts/analyze_commands.py +337 -337
- package/.claude/workflows/cli-templates/prompts/workflow-impl-plan-template.txt +1 -1
- package/ccw/dist/commands/issue.d.ts +4 -0
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +73 -6
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js +32 -28
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts +10 -0
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +45 -0
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens.js +38 -11
- package/ccw/dist/tools/codex-lens.js.map +1 -1
- package/ccw/dist/tools/command-registry.d.ts +77 -0
- package/ccw/dist/tools/command-registry.d.ts.map +1 -0
- package/ccw/dist/tools/command-registry.js +265 -0
- package/ccw/dist/tools/command-registry.js.map +1 -0
- package/ccw/dist/tools/command-registry.test.d.ts +14 -0
- package/ccw/dist/tools/command-registry.test.d.ts.map +1 -0
- package/ccw/dist/tools/command-registry.test.js.map +1 -0
- package/ccw/dist/tools/index.d.ts +2 -0
- package/ccw/dist/tools/index.d.ts.map +1 -1
- package/ccw/dist/tools/index.js +2 -0
- package/ccw/dist/tools/index.js.map +1 -1
- package/ccw/src/commands/issue.ts +84 -6
- package/ccw/src/core/routes/cli-routes.ts +30 -25
- package/ccw/src/templates/dashboard-js/views/help.js +1 -1
- package/ccw/src/tools/claude-cli-tools.ts +50 -0
- package/ccw/src/tools/codex-lens.ts +40 -11
- package/ccw/src/tools/command-registry.test.ts +669 -0
- package/ccw/src/tools/command-registry.ts +308 -0
- package/ccw/src/tools/index.ts +4 -0
- package/package.json +1 -1
- package/.claude/skills/ccw/SKILL.md +0 -522
- package/.claude/skills/ccw/command.json +0 -641
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ccw
|
|
3
|
+
description: Main workflow orchestrator - analyze intent, select workflow, execute command chain in main process
|
|
4
|
+
argument-hint: "\"task description\""
|
|
5
|
+
allowed-tools: SlashCommand(*), TodoWrite(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# CCW Command - Main Workflow Orchestrator
|
|
9
|
+
|
|
10
|
+
Main process orchestrator: intent analysis → workflow selection → command chain execution.
|
|
11
|
+
|
|
12
|
+
## Core Concept: Minimum Execution Units (最小执行单元)
|
|
13
|
+
|
|
14
|
+
**Definition**: A set of commands that must execute together as an atomic group to achieve a meaningful workflow milestone.
|
|
15
|
+
|
|
16
|
+
**Why This Matters**:
|
|
17
|
+
- **Prevents Incomplete States**: Avoid stopping after task generation without execution
|
|
18
|
+
- **User Experience**: User gets complete results, not intermediate artifacts requiring manual follow-up
|
|
19
|
+
- **Workflow Integrity**: Maintains logical coherence of multi-step operations
|
|
20
|
+
|
|
21
|
+
**Key Units in CCW**:
|
|
22
|
+
|
|
23
|
+
| Unit Type | Pattern | Example |
|
|
24
|
+
|-----------|---------|---------|
|
|
25
|
+
| **Planning + Execution** | plan-cmd → execute-cmd | lite-plan → lite-execute |
|
|
26
|
+
| **Testing** | test-gen-cmd → test-exec-cmd | test-fix-gen → test-cycle-execute |
|
|
27
|
+
| **Review** | review-cmd → fix-cmd | review-session-cycle → review-fix |
|
|
28
|
+
|
|
29
|
+
**Atomic Rules**:
|
|
30
|
+
1. CCW automatically groups commands into minimum units - never splits them
|
|
31
|
+
2. Pipeline visualization shows units with `【 】` markers
|
|
32
|
+
3. Error handling preserves unit boundaries (retry/skip affects whole unit)
|
|
33
|
+
|
|
34
|
+
## Execution Model
|
|
35
|
+
|
|
36
|
+
**Synchronous (Main Process)**: Commands execute via SlashCommand in main process, blocking until complete.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
User Input → Analyze Intent → Select Workflow → [Confirm] → Execute Chain
|
|
40
|
+
↓
|
|
41
|
+
SlashCommand (blocking)
|
|
42
|
+
↓
|
|
43
|
+
Update TodoWrite
|
|
44
|
+
↓
|
|
45
|
+
Next Command...
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**vs ccw-coordinator**: External CLI execution with background tasks and hook callbacks.
|
|
49
|
+
|
|
50
|
+
## 5-Phase Workflow
|
|
51
|
+
|
|
52
|
+
### Phase 1: Analyze Intent
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
function analyzeIntent(input) {
|
|
56
|
+
return {
|
|
57
|
+
goal: extractGoal(input),
|
|
58
|
+
scope: extractScope(input),
|
|
59
|
+
constraints: extractConstraints(input),
|
|
60
|
+
task_type: detectTaskType(input), // bugfix|feature|tdd|review|exploration|...
|
|
61
|
+
complexity: assessComplexity(input), // low|medium|high
|
|
62
|
+
clarity_score: calculateClarity(input) // 0-3 (>=2 = clear)
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Task type detection (priority order)
|
|
67
|
+
function detectTaskType(text) {
|
|
68
|
+
const patterns = {
|
|
69
|
+
'bugfix-hotfix': /urgent|production|critical/ && /fix|bug/,
|
|
70
|
+
'bugfix': /fix|bug|error|crash|fail|debug/,
|
|
71
|
+
'issue-batch': /issues?|batch/ && /fix|resolve/,
|
|
72
|
+
'exploration': /uncertain|explore|research|what if/,
|
|
73
|
+
'multi-perspective': /multi-perspective|compare|cross-verify/,
|
|
74
|
+
'quick-task': /quick|simple|small/ && /feature|function/,
|
|
75
|
+
'ui-design': /ui|design|component|style/,
|
|
76
|
+
'tdd': /tdd|test-driven|test first/,
|
|
77
|
+
'test-fix': /test fail|fix test|failing test/,
|
|
78
|
+
'review': /review|code review/,
|
|
79
|
+
'documentation': /docs|documentation|readme/
|
|
80
|
+
};
|
|
81
|
+
for (const [type, pattern] of Object.entries(patterns)) {
|
|
82
|
+
if (pattern.test(text)) return type;
|
|
83
|
+
}
|
|
84
|
+
return 'feature';
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Output**: `Type: [task_type] | Goal: [goal] | Complexity: [complexity] | Clarity: [clarity_score]/3`
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### Phase 1.5: Requirement Clarification (if clarity_score < 2)
|
|
93
|
+
|
|
94
|
+
```javascript
|
|
95
|
+
async function clarifyRequirements(analysis) {
|
|
96
|
+
if (analysis.clarity_score >= 2) return analysis;
|
|
97
|
+
|
|
98
|
+
const questions = generateClarificationQuestions(analysis); // Goal, Scope, Constraints
|
|
99
|
+
const answers = await AskUserQuestion({ questions });
|
|
100
|
+
return updateAnalysis(analysis, answers);
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Questions**: Goal (Create/Fix/Optimize/Analyze), Scope (Single file/Module/Cross-module/System), Constraints (Backward compat/Skip tests/Urgent hotfix)
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### Phase 2: Select Workflow & Build Command Chain
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
function selectWorkflow(analysis) {
|
|
112
|
+
const levelMap = {
|
|
113
|
+
'bugfix-hotfix': { level: 2, flow: 'bugfix.hotfix' },
|
|
114
|
+
'bugfix': { level: 2, flow: 'bugfix.standard' },
|
|
115
|
+
'issue-batch': { level: 'Issue', flow: 'issue' },
|
|
116
|
+
'exploration': { level: 4, flow: 'full' },
|
|
117
|
+
'quick-task': { level: 1, flow: 'lite-lite-lite' },
|
|
118
|
+
'ui-design': { level: analysis.complexity === 'high' ? 4 : 3, flow: 'ui' },
|
|
119
|
+
'tdd': { level: 3, flow: 'tdd' },
|
|
120
|
+
'test-fix': { level: 3, flow: 'test-fix-gen' },
|
|
121
|
+
'review': { level: 3, flow: 'review-fix' },
|
|
122
|
+
'documentation': { level: 2, flow: 'docs' },
|
|
123
|
+
'feature': { level: analysis.complexity === 'high' ? 3 : 2, flow: analysis.complexity === 'high' ? 'coupled' : 'rapid' }
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const selected = levelMap[analysis.task_type] || levelMap['feature'];
|
|
127
|
+
return buildCommandChain(selected, analysis);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Build command chain (port-based matching with Minimum Execution Units)
|
|
131
|
+
function buildCommandChain(workflow, analysis) {
|
|
132
|
+
const chains = {
|
|
133
|
+
// Level 1 - Rapid
|
|
134
|
+
'lite-lite-lite': [
|
|
135
|
+
{ cmd: '/workflow:lite-lite-lite', args: `"${analysis.goal}"` }
|
|
136
|
+
],
|
|
137
|
+
|
|
138
|
+
// Level 2 - Lightweight
|
|
139
|
+
'rapid': [
|
|
140
|
+
// Unit: Quick Implementation【lite-plan → lite-execute】
|
|
141
|
+
{ cmd: '/workflow:lite-plan', args: `"${analysis.goal}"`, unit: 'quick-impl' },
|
|
142
|
+
{ cmd: '/workflow:lite-execute', args: '--in-memory', unit: 'quick-impl' },
|
|
143
|
+
// Unit: Test Validation【test-fix-gen → test-cycle-execute】
|
|
144
|
+
...(analysis.constraints?.includes('skip-tests') ? [] : [
|
|
145
|
+
{ cmd: '/workflow:test-fix-gen', args: '', unit: 'test-validation' },
|
|
146
|
+
{ cmd: '/workflow:test-cycle-execute', args: '', unit: 'test-validation' }
|
|
147
|
+
])
|
|
148
|
+
],
|
|
149
|
+
|
|
150
|
+
'bugfix.standard': [
|
|
151
|
+
// Unit: Bug Fix【lite-fix → lite-execute】
|
|
152
|
+
{ cmd: '/workflow:lite-fix', args: `"${analysis.goal}"`, unit: 'bug-fix' },
|
|
153
|
+
{ cmd: '/workflow:lite-execute', args: '--in-memory', unit: 'bug-fix' },
|
|
154
|
+
// Unit: Test Validation【test-fix-gen → test-cycle-execute】
|
|
155
|
+
...(analysis.constraints?.includes('skip-tests') ? [] : [
|
|
156
|
+
{ cmd: '/workflow:test-fix-gen', args: '', unit: 'test-validation' },
|
|
157
|
+
{ cmd: '/workflow:test-cycle-execute', args: '', unit: 'test-validation' }
|
|
158
|
+
])
|
|
159
|
+
],
|
|
160
|
+
|
|
161
|
+
'bugfix.hotfix': [
|
|
162
|
+
{ cmd: '/workflow:lite-fix', args: `--hotfix "${analysis.goal}"` }
|
|
163
|
+
],
|
|
164
|
+
|
|
165
|
+
'multi-cli-plan': [
|
|
166
|
+
// Unit: Multi-CLI Planning【multi-cli-plan → lite-execute】
|
|
167
|
+
{ cmd: '/workflow:multi-cli-plan', args: `"${analysis.goal}"`, unit: 'multi-cli' },
|
|
168
|
+
{ cmd: '/workflow:lite-execute', args: '--in-memory', unit: 'multi-cli' },
|
|
169
|
+
// Unit: Test Validation【test-fix-gen → test-cycle-execute】
|
|
170
|
+
...(analysis.constraints?.includes('skip-tests') ? [] : [
|
|
171
|
+
{ cmd: '/workflow:test-fix-gen', args: '', unit: 'test-validation' },
|
|
172
|
+
{ cmd: '/workflow:test-cycle-execute', args: '', unit: 'test-validation' }
|
|
173
|
+
])
|
|
174
|
+
],
|
|
175
|
+
|
|
176
|
+
'docs': [
|
|
177
|
+
// Unit: Quick Implementation【lite-plan → lite-execute】
|
|
178
|
+
{ cmd: '/workflow:lite-plan', args: `"${analysis.goal}"`, unit: 'quick-impl' },
|
|
179
|
+
{ cmd: '/workflow:lite-execute', args: '--in-memory', unit: 'quick-impl' }
|
|
180
|
+
],
|
|
181
|
+
|
|
182
|
+
// Level 3 - Standard
|
|
183
|
+
'coupled': [
|
|
184
|
+
// Unit: Verified Planning【plan → plan-verify】
|
|
185
|
+
{ cmd: '/workflow:plan', args: `"${analysis.goal}"`, unit: 'verified-planning' },
|
|
186
|
+
{ cmd: '/workflow:plan-verify', args: '', unit: 'verified-planning' },
|
|
187
|
+
// Execution
|
|
188
|
+
{ cmd: '/workflow:execute', args: '' },
|
|
189
|
+
// Unit: Code Review【review-session-cycle → review-fix】
|
|
190
|
+
{ cmd: '/workflow:review-session-cycle', args: '', unit: 'code-review' },
|
|
191
|
+
{ cmd: '/workflow:review-fix', args: '', unit: 'code-review' },
|
|
192
|
+
// Unit: Test Validation【test-fix-gen → test-cycle-execute】
|
|
193
|
+
...(analysis.constraints?.includes('skip-tests') ? [] : [
|
|
194
|
+
{ cmd: '/workflow:test-fix-gen', args: '', unit: 'test-validation' },
|
|
195
|
+
{ cmd: '/workflow:test-cycle-execute', args: '', unit: 'test-validation' }
|
|
196
|
+
])
|
|
197
|
+
],
|
|
198
|
+
|
|
199
|
+
'tdd': [
|
|
200
|
+
// Unit: TDD Planning + Execution【tdd-plan → execute】
|
|
201
|
+
{ cmd: '/workflow:tdd-plan', args: `"${analysis.goal}"`, unit: 'tdd-planning' },
|
|
202
|
+
{ cmd: '/workflow:execute', args: '', unit: 'tdd-planning' },
|
|
203
|
+
// TDD Verification
|
|
204
|
+
{ cmd: '/workflow:tdd-verify', args: '' }
|
|
205
|
+
],
|
|
206
|
+
|
|
207
|
+
'test-fix-gen': [
|
|
208
|
+
// Unit: Test Validation【test-fix-gen → test-cycle-execute】
|
|
209
|
+
{ cmd: '/workflow:test-fix-gen', args: `"${analysis.goal}"`, unit: 'test-validation' },
|
|
210
|
+
{ cmd: '/workflow:test-cycle-execute', args: '', unit: 'test-validation' }
|
|
211
|
+
],
|
|
212
|
+
|
|
213
|
+
'review-fix': [
|
|
214
|
+
// Unit: Code Review【review-session-cycle → review-fix】
|
|
215
|
+
{ cmd: '/workflow:review-session-cycle', args: '', unit: 'code-review' },
|
|
216
|
+
{ cmd: '/workflow:review-fix', args: '', unit: 'code-review' },
|
|
217
|
+
// Unit: Test Validation【test-fix-gen → test-cycle-execute】
|
|
218
|
+
{ cmd: '/workflow:test-fix-gen', args: '', unit: 'test-validation' },
|
|
219
|
+
{ cmd: '/workflow:test-cycle-execute', args: '', unit: 'test-validation' }
|
|
220
|
+
],
|
|
221
|
+
|
|
222
|
+
'ui': [
|
|
223
|
+
{ cmd: '/workflow:ui-design:explore-auto', args: `"${analysis.goal}"` },
|
|
224
|
+
// Unit: Planning + Execution【plan → execute】
|
|
225
|
+
{ cmd: '/workflow:plan', args: '', unit: 'plan-execute' },
|
|
226
|
+
{ cmd: '/workflow:execute', args: '', unit: 'plan-execute' }
|
|
227
|
+
],
|
|
228
|
+
|
|
229
|
+
// Level 4 - Brainstorm
|
|
230
|
+
'full': [
|
|
231
|
+
{ cmd: '/workflow:brainstorm:auto-parallel', args: `"${analysis.goal}"` },
|
|
232
|
+
// Unit: Verified Planning【plan → plan-verify】
|
|
233
|
+
{ cmd: '/workflow:plan', args: '', unit: 'verified-planning' },
|
|
234
|
+
{ cmd: '/workflow:plan-verify', args: '', unit: 'verified-planning' },
|
|
235
|
+
// Execution
|
|
236
|
+
{ cmd: '/workflow:execute', args: '' },
|
|
237
|
+
// Unit: Test Validation【test-fix-gen → test-cycle-execute】
|
|
238
|
+
{ cmd: '/workflow:test-fix-gen', args: '', unit: 'test-validation' },
|
|
239
|
+
{ cmd: '/workflow:test-cycle-execute', args: '', unit: 'test-validation' }
|
|
240
|
+
],
|
|
241
|
+
|
|
242
|
+
// Issue Workflow
|
|
243
|
+
'issue': [
|
|
244
|
+
{ cmd: '/issue:discover', args: '' },
|
|
245
|
+
{ cmd: '/issue:plan', args: '--all-pending' },
|
|
246
|
+
{ cmd: '/issue:queue', args: '' },
|
|
247
|
+
{ cmd: '/issue:execute', args: '' }
|
|
248
|
+
]
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
return chains[workflow.flow] || chains['rapid'];
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Output**: `Level [X] - [flow] | Pipeline: [...] | Commands: [1. /cmd1 2. /cmd2 ...]`
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
### Phase 3: User Confirmation
|
|
260
|
+
|
|
261
|
+
```javascript
|
|
262
|
+
async function getUserConfirmation(chain) {
|
|
263
|
+
const response = await AskUserQuestion({
|
|
264
|
+
questions: [{
|
|
265
|
+
question: "Execute this command chain?",
|
|
266
|
+
header: "Confirm",
|
|
267
|
+
options: [
|
|
268
|
+
{ label: "Confirm", description: "Start" },
|
|
269
|
+
{ label: "Adjust", description: "Modify" },
|
|
270
|
+
{ label: "Cancel", description: "Abort" }
|
|
271
|
+
]
|
|
272
|
+
}]
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
if (response.error === "Cancel") throw new Error("Cancelled");
|
|
276
|
+
if (response.error === "Adjust") return await adjustChain(chain);
|
|
277
|
+
return chain;
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
### Phase 4: Setup TODO Tracking
|
|
284
|
+
|
|
285
|
+
```javascript
|
|
286
|
+
function setupTodoTracking(chain, workflow) {
|
|
287
|
+
const todos = chain.map((step, i) => ({
|
|
288
|
+
content: `CCW:${workflow}: [${i + 1}/${chain.length}] ${step.cmd}`,
|
|
289
|
+
status: i === 0 ? 'in_progress' : 'pending',
|
|
290
|
+
activeForm: `Executing ${step.cmd}`
|
|
291
|
+
}));
|
|
292
|
+
TodoWrite({ todos });
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**Output**: `-> CCW:rapid: [1/3] /workflow:lite-plan | CCW:rapid: [2/3] /workflow:lite-execute | ...`
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
### Phase 5: Execute Command Chain
|
|
301
|
+
|
|
302
|
+
```javascript
|
|
303
|
+
async function executeCommandChain(chain, workflow) {
|
|
304
|
+
let previousResult = null;
|
|
305
|
+
|
|
306
|
+
for (let i = 0; i < chain.length; i++) {
|
|
307
|
+
try {
|
|
308
|
+
const fullCommand = assembleCommand(chain[i], previousResult);
|
|
309
|
+
const result = await SlashCommand({ command: fullCommand });
|
|
310
|
+
|
|
311
|
+
previousResult = { ...result, success: true };
|
|
312
|
+
updateTodoStatus(i, chain.length, workflow, 'completed');
|
|
313
|
+
|
|
314
|
+
} catch (error) {
|
|
315
|
+
const action = await handleError(chain[i], error, i);
|
|
316
|
+
if (action === 'retry') {
|
|
317
|
+
i--; // Retry
|
|
318
|
+
} else if (action === 'abort') {
|
|
319
|
+
return { success: false, error: error.message };
|
|
320
|
+
}
|
|
321
|
+
// 'skip' - continue
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return { success: true, completed: chain.length };
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Assemble full command with session/plan parameters
|
|
329
|
+
function assembleCommand(step, previousResult) {
|
|
330
|
+
let command = step.cmd;
|
|
331
|
+
if (step.args) {
|
|
332
|
+
command += ` ${step.args}`;
|
|
333
|
+
} else if (previousResult?.session_id) {
|
|
334
|
+
command += ` --session="${previousResult.session_id}"`;
|
|
335
|
+
}
|
|
336
|
+
return command;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Update TODO: mark current as complete, next as in-progress
|
|
340
|
+
function updateTodoStatus(index, total, workflow, status) {
|
|
341
|
+
const todos = getAllCurrentTodos();
|
|
342
|
+
const updated = todos.map(todo => {
|
|
343
|
+
if (todo.content.startsWith(`CCW:${workflow}:`)) {
|
|
344
|
+
const stepNum = extractStepIndex(todo.content);
|
|
345
|
+
if (stepNum === index + 1) return { ...todo, status };
|
|
346
|
+
if (stepNum === index + 2 && status === 'completed') return { ...todo, status: 'in_progress' };
|
|
347
|
+
}
|
|
348
|
+
return todo;
|
|
349
|
+
});
|
|
350
|
+
TodoWrite({ todos: updated });
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Error handling: Retry/Skip/Abort
|
|
354
|
+
async function handleError(step, error, index) {
|
|
355
|
+
const response = await AskUserQuestion({
|
|
356
|
+
questions: [{
|
|
357
|
+
question: `${step.cmd} failed: ${error.message}`,
|
|
358
|
+
header: "Error",
|
|
359
|
+
options: [
|
|
360
|
+
{ label: "Retry", description: "Re-execute" },
|
|
361
|
+
{ label: "Skip", description: "Continue next" },
|
|
362
|
+
{ label: "Abort", description: "Stop" }
|
|
363
|
+
]
|
|
364
|
+
}]
|
|
365
|
+
});
|
|
366
|
+
return { Retry: 'retry', Skip: 'skip', Abort: 'abort' }[response.Error] || 'abort';
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## Execution Flow Summary
|
|
373
|
+
|
|
374
|
+
```
|
|
375
|
+
User Input
|
|
376
|
+
|
|
|
377
|
+
Phase 1: Analyze Intent
|
|
378
|
+
|-- Extract: goal, scope, constraints, task_type, complexity, clarity
|
|
379
|
+
+-- If clarity < 2 -> Phase 1.5: Clarify Requirements
|
|
380
|
+
|
|
|
381
|
+
Phase 2: Select Workflow & Build Chain
|
|
382
|
+
|-- Map task_type -> Level (1/2/3/4/Issue)
|
|
383
|
+
|-- Select flow based on complexity
|
|
384
|
+
+-- Build command chain (port-based)
|
|
385
|
+
|
|
|
386
|
+
Phase 3: User Confirmation (optional)
|
|
387
|
+
|-- Show pipeline visualization
|
|
388
|
+
+-- Allow adjustment
|
|
389
|
+
|
|
|
390
|
+
Phase 4: Setup TODO Tracking
|
|
391
|
+
+-- Create todos with CCW prefix
|
|
392
|
+
|
|
|
393
|
+
Phase 5: Execute Command Chain
|
|
394
|
+
|-- For each command:
|
|
395
|
+
| |-- Assemble full command
|
|
396
|
+
| |-- Execute via SlashCommand
|
|
397
|
+
| |-- Update TODO status
|
|
398
|
+
| +-- Handle errors (retry/skip/abort)
|
|
399
|
+
+-- Return workflow result
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## Pipeline Examples (with Minimum Execution Units)
|
|
405
|
+
|
|
406
|
+
**Note**: `【 】` marks Minimum Execution Units - commands execute together as atomic groups.
|
|
407
|
+
|
|
408
|
+
| Input | Type | Level | Pipeline (with Units) |
|
|
409
|
+
|-------|------|-------|-----------------------|
|
|
410
|
+
| "Add API endpoint" | feature (low) | 2 |【lite-plan → lite-execute】→【test-fix-gen → test-cycle-execute】|
|
|
411
|
+
| "Fix login timeout" | bugfix | 2 |【lite-fix → lite-execute】→【test-fix-gen → test-cycle-execute】|
|
|
412
|
+
| "OAuth2 system" | feature (high) | 3 |【plan → plan-verify】→ execute →【review-session-cycle → review-fix】→【test-fix-gen → test-cycle-execute】|
|
|
413
|
+
| "Implement with TDD" | tdd | 3 |【tdd-plan → execute】→ tdd-verify |
|
|
414
|
+
| "Uncertain: real-time arch" | exploration | 4 | brainstorm:auto-parallel →【plan → plan-verify】→ execute →【test-fix-gen → test-cycle-execute】|
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Key Design Principles
|
|
419
|
+
|
|
420
|
+
1. **Main Process Execution** - Use SlashCommand in main process, no external CLI
|
|
421
|
+
2. **Intent-Driven** - Auto-select workflow based on task intent
|
|
422
|
+
3. **Port-Based Chaining** - Build command chain using port matching
|
|
423
|
+
4. **Minimum Execution Units** - Commands grouped into atomic units, never split (e.g., lite-plan → lite-execute)
|
|
424
|
+
5. **Progressive Clarification** - Low clarity triggers clarification phase
|
|
425
|
+
6. **TODO Tracking** - Use CCW prefix to isolate workflow todos
|
|
426
|
+
7. **Unit-Aware Error Handling** - Retry/skip/abort affects whole unit, not individual commands
|
|
427
|
+
8. **User Control** - Optional user confirmation at each phase
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## State Management
|
|
432
|
+
|
|
433
|
+
**TodoWrite-Based Tracking**: All execution state tracked via TodoWrite with `CCW:` prefix.
|
|
434
|
+
|
|
435
|
+
```javascript
|
|
436
|
+
// Initial state
|
|
437
|
+
todos = [
|
|
438
|
+
{ content: "CCW:rapid: [1/3] /workflow:lite-plan", status: "in_progress" },
|
|
439
|
+
{ content: "CCW:rapid: [2/3] /workflow:lite-execute", status: "pending" },
|
|
440
|
+
{ content: "CCW:rapid: [3/3] /workflow:test-cycle-execute", status: "pending" }
|
|
441
|
+
];
|
|
442
|
+
|
|
443
|
+
// After command 1 completes
|
|
444
|
+
todos = [
|
|
445
|
+
{ content: "CCW:rapid: [1/3] /workflow:lite-plan", status: "completed" },
|
|
446
|
+
{ content: "CCW:rapid: [2/3] /workflow:lite-execute", status: "in_progress" },
|
|
447
|
+
{ content: "CCW:rapid: [3/3] /workflow:test-cycle-execute", status: "pending" }
|
|
448
|
+
];
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**vs ccw-coordinator**: Extensive state.json with task_id, status transitions, hook callbacks.
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## Type Comparison: ccw vs ccw-coordinator
|
|
456
|
+
|
|
457
|
+
| Aspect | ccw | ccw-coordinator |
|
|
458
|
+
|--------|-----|-----------------|
|
|
459
|
+
| **Type** | Main process (SlashCommand) | External CLI (ccw cli + hook callbacks) |
|
|
460
|
+
| **Execution** | Synchronous blocking | Async background with hook completion |
|
|
461
|
+
| **Workflow** | Auto intent-based selection | Manual chain building |
|
|
462
|
+
| **Intent Analysis** | 5-phase clarity check | 3-phase requirement analysis |
|
|
463
|
+
| **State** | TodoWrite only (in-memory) | state.json + checkpoint/resume |
|
|
464
|
+
| **Error Handling** | Retry/skip/abort (interactive) | Retry/skip/abort (via AskUser) |
|
|
465
|
+
| **Use Case** | Auto workflow for any task | Manual orchestration, large chains |
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## Usage
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
# Auto-select workflow
|
|
473
|
+
ccw "Add user authentication"
|
|
474
|
+
|
|
475
|
+
# Complex requirement (triggers clarification)
|
|
476
|
+
ccw "Optimize system performance"
|
|
477
|
+
|
|
478
|
+
# Bug fix
|
|
479
|
+
ccw "Fix memory leak in WebSocket handler"
|
|
480
|
+
|
|
481
|
+
# TDD development
|
|
482
|
+
ccw "Implement user registration with TDD"
|
|
483
|
+
|
|
484
|
+
# Exploratory task
|
|
485
|
+
ccw "Uncertain about architecture for real-time notifications"
|
|
486
|
+
```
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: issue:discover-by-prompt
|
|
3
3
|
description: Discover issues from user prompt with Gemini-planned iterative multi-agent exploration. Uses ACE semantic search for context gathering and supports cross-module comparison (e.g., frontend vs backend API contracts).
|
|
4
|
-
argument-hint: "<prompt> [--scope=src/**] [--depth=standard|deep] [--max-iterations=5]"
|
|
4
|
+
argument-hint: "[-y|--yes] <prompt> [--scope=src/**] [--depth=standard|deep] [--max-iterations=5]"
|
|
5
5
|
allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*), AskUserQuestion(*), Glob(*), Grep(*), mcp__ace-tool__search_context(*), mcp__exa__search(*)
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## Auto Mode
|
|
9
|
+
|
|
10
|
+
When `--yes` or `-y`: Auto-continue all iterations, skip confirmations.
|
|
11
|
+
|
|
8
12
|
# Issue Discovery by Prompt
|
|
9
13
|
|
|
10
14
|
## Quick Start
|