claude-code-workflow 6.3.48 → 6.3.49
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/CLAUDE.md +6 -8
- package/.claude/agents/action-planning-agent.md +28 -45
- package/.claude/agents/cli-lite-planning-agent.md +93 -1
- package/.claude/agents/code-developer.md +144 -27
- package/.claude/commands/ccw-coordinator.md +175 -21
- package/.claude/commands/ccw-debug.md +832 -0
- package/.claude/commands/ccw.md +90 -9
- package/.claude/commands/cli/cli-init.md +1 -0
- package/.claude/commands/issue/convert-to-plan.md +718 -0
- package/.claude/commands/issue/from-brainstorm.md +382 -0
- package/.claude/commands/memory/tips.md +332 -0
- package/.claude/commands/workflow/analyze-with-file.md +804 -0
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +18 -43
- package/.claude/commands/workflow/brainstorm/role-analysis.md +705 -0
- package/.claude/commands/workflow/brainstorm-with-file.md +1153 -0
- package/.claude/commands/workflow/debug-with-file.md +7 -5
- package/.claude/commands/workflow/execute.md +6 -4
- package/.claude/commands/workflow/lite-plan.md +2 -2
- package/.claude/commands/workflow/plan-verify.md +162 -327
- package/.claude/commands/workflow/plan.md +162 -26
- package/.claude/commands/workflow/replan.md +78 -2
- package/.claude/commands/workflow/{review-fix.md → review-cycle-fix.md} +6 -6
- package/.claude/commands/workflow/review-module-cycle.md +2 -2
- package/.claude/commands/workflow/review-session-cycle.md +2 -2
- package/.claude/commands/workflow/tools/conflict-resolution.md +16 -26
- package/.claude/commands/workflow/tools/context-gather.md +81 -118
- package/.claude/commands/workflow/tools/task-generate-agent.md +94 -10
- package/.claude/skills/ccw-help/command.json +4 -4
- package/.claude/skills/lite-skill-generator/SKILL.md +650 -0
- package/.claude/skills/lite-skill-generator/templates/simple-skill.md +68 -0
- package/.claude/skills/lite-skill-generator/templates/style-guide.md +64 -0
- package/.claude/skills/skill-generator/SKILL.md +277 -85
- package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +4 -15
- package/.claude/skills/skill-generator/phases/02-structure-generation.md +72 -17
- package/.claude/skills/skill-generator/phases/03-phase-generation.md +218 -51
- package/.claude/skills/skill-generator/phases/04-specs-templates.md +111 -41
- package/.claude/skills/skill-generator/phases/05-validation.md +139 -56
- package/.claude/skills/skill-generator/templates/autonomous-action.md +78 -268
- package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +14 -0
- package/.claude/skills/skill-generator/templates/code-analysis-action.md +12 -0
- package/.claude/skills/skill-generator/templates/llm-action.md +12 -0
- package/.claude/skills/skill-generator/templates/script-template.md +368 -0
- package/.claude/skills/skill-generator/templates/sequential-phase.md +14 -0
- package/.claude/skills/skill-generator/templates/skill-md.md +14 -0
- package/.claude/skills/skill-tuning/SKILL.md +130 -266
- package/.claude/skills/skill-tuning/phases/orchestrator.md +95 -283
- package/.claude/skills/skill-tuning/specs/problem-taxonomy.md +90 -198
- package/.claude/skills/skill-tuning/specs/tuning-strategies.md +193 -1345
- package/.claude/workflows/cli-templates/schemas/plan-verify-agent-schema.json +47 -0
- package/.claude/workflows/cli-templates/schemas/verify-json-schema.json +158 -0
- package/.claude/workflows/cli-tools-usage.md +1 -1
- package/.codex/AGENTS.md +1 -3
- package/.codex/prompts/analyze-with-file.md +607 -0
- package/.codex/prompts/brainstorm-to-cycle.md +455 -0
- package/.codex/prompts/brainstorm-with-file.md +933 -0
- package/.codex/prompts/debug-with-file.md +15 -20
- package/.codex/skills/ccw-cli-tools/SKILL.md +559 -0
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +29 -5
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +2 -0
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +62 -20
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.js +5 -3
- package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
- package/ccw/dist/config/litellm-provider-models.d.ts +73 -0
- package/ccw/dist/config/litellm-provider-models.d.ts.map +1 -0
- package/ccw/dist/config/litellm-provider-models.js +172 -0
- package/ccw/dist/config/litellm-provider-models.js.map +1 -0
- package/ccw/dist/config/provider-models.d.ts +25 -51
- package/ccw/dist/config/provider-models.d.ts.map +1 -1
- package/ccw/dist/config/provider-models.js +84 -149
- package/ccw/dist/config/provider-models.js.map +1 -1
- package/ccw/dist/config/storage-paths.d.ts.map +1 -1
- package/ccw/dist/config/storage-paths.js +23 -5
- package/ccw/dist/config/storage-paths.js.map +1 -1
- package/ccw/dist/core/auth/csrf-middleware.js +3 -3
- package/ccw/dist/core/auth/csrf-middleware.js.map +1 -1
- package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
- package/ccw/dist/core/dashboard-generator.js +3 -1
- package/ccw/dist/core/dashboard-generator.js.map +1 -1
- package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/claude-routes.js +206 -14
- package/ccw/dist/core/routes/claude-routes.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/commands-routes.d.ts +7 -0
- package/ccw/dist/core/routes/commands-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/commands-routes.js +480 -0
- package/ccw/dist/core/routes/commands-routes.js.map +1 -0
- package/ccw/dist/core/routes/model-routes.d.ts +11 -0
- package/ccw/dist/core/routes/model-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/model-routes.js +112 -0
- package/ccw/dist/core/routes/model-routes.js.map +1 -0
- package/ccw/dist/core/routes/nav-status-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/nav-status-routes.js +84 -1
- package/ccw/dist/core/routes/nav-status-routes.js.map +1 -1
- package/ccw/dist/core/routes/provider-routes.d.ts +11 -0
- package/ccw/dist/core/routes/provider-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/provider-routes.js +67 -0
- package/ccw/dist/core/routes/provider-routes.js.map +1 -0
- package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/skills-routes.js +219 -7
- package/ccw/dist/core/routes/skills-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +58 -6
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +13 -0
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/mcp-server/index.js +2 -2
- package/ccw/dist/mcp-server/index.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts +48 -11
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +146 -50
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/cli-config-manager.d.ts +1 -13
- package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
- package/ccw/dist/tools/cli-config-manager.js +3 -27
- package/ccw/dist/tools/cli-config-manager.js.map +1 -1
- package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-core.js +7 -2
- package/ccw/dist/tools/cli-executor-core.js.map +1 -1
- package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.d.ts +11 -0
- package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.js +82 -2
- package/ccw/dist/tools/cli-history-store.js.map +1 -1
- package/ccw/dist/tools/command-registry.d.ts +7 -0
- package/ccw/dist/tools/command-registry.d.ts.map +1 -1
- package/ccw/dist/tools/command-registry.js +14 -1
- package/ccw/dist/tools/command-registry.js.map +1 -1
- package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -1
- package/ccw/dist/tools/generate-module-docs.js +11 -7
- package/ccw/dist/tools/generate-module-docs.js.map +1 -1
- package/ccw/dist/tools/litellm-executor.d.ts +1 -0
- package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-executor.js +11 -9
- package/ccw/dist/tools/litellm-executor.js.map +1 -1
- package/ccw/dist/types/skill-types.d.ts +97 -0
- package/ccw/dist/types/skill-types.d.ts.map +1 -0
- package/ccw/dist/types/skill-types.js +6 -0
- package/ccw/dist/types/skill-types.js.map +1 -0
- package/ccw/src/commands/cli.ts +36 -5
- package/ccw/src/commands/issue.ts +81 -26
- package/ccw/src/config/litellm-api-config-manager.ts +5 -3
- package/ccw/src/config/litellm-provider-models.ts +222 -0
- package/ccw/src/config/provider-models.ts +91 -190
- package/ccw/src/config/storage-paths.ts +20 -5
- package/ccw/src/core/auth/csrf-middleware.ts +3 -3
- package/ccw/src/core/dashboard-generator.ts +3 -1
- package/ccw/src/core/routes/claude-routes.ts +233 -15
- package/ccw/src/core/routes/cli-routes.ts +2 -3
- package/ccw/src/core/routes/commands-routes.ts +620 -0
- package/ccw/src/core/routes/nav-status-routes.ts +95 -1
- package/ccw/src/core/routes/provider-routes.ts +78 -0
- package/ccw/src/core/routes/skills-routes.ts +266 -45
- package/ccw/src/core/routes/system-routes.ts +102 -50
- package/ccw/src/core/server.ts +13 -0
- package/ccw/src/mcp-server/index.ts +2 -2
- package/ccw/src/templates/dashboard-css/18-cli-settings.css +35 -0
- package/ccw/src/templates/dashboard-css/37-commands.css +193 -0
- package/ccw/src/templates/dashboard-js/components/navigation.js +4 -0
- package/ccw/src/templates/dashboard-js/i18n.js +116 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +249 -4
- package/ccw/src/templates/dashboard-js/views/commands-manager.js +503 -0
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +7 -7
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2 -7
- package/ccw/src/templates/dashboard-js/views/skills-manager.js +164 -23
- package/ccw/src/templates/dashboard.html +7 -0
- package/ccw/src/tools/claude-cli-tools.ts +170 -56
- package/ccw/src/tools/cli-config-manager.ts +2 -33
- package/ccw/src/tools/cli-executor-core.ts +8 -2
- package/ccw/src/tools/cli-history-store.ts +92 -2
- package/ccw/src/tools/command-registry.ts +16 -1
- package/ccw/src/tools/generate-module-docs.ts +11 -7
- package/ccw/src/tools/litellm-executor.ts +13 -9
- package/ccw/src/types/skill-types.ts +99 -0
- package/package.json +1 -1
- package/.claude/commands/enhance-prompt.md +0 -93
- package/.claude/commands/memory/code-map-memory.md +0 -687
- package/.claude/commands/memory/docs.md +0 -615
- package/.claude/commands/memory/load-skill-memory.md +0 -182
- package/.claude/commands/memory/skill-memory.md +0 -525
- package/.claude/commands/memory/swagger-docs.md +0 -773
- package/.claude/commands/memory/tech-research-rules.md +0 -310
- package/.claude/commands/memory/workflow-skill-memory.md +0 -517
- package/.claude/commands/task/breakdown.md +0 -208
- package/.claude/commands/task/create.md +0 -152
- package/.claude/commands/task/execute.md +0 -270
- package/.claude/commands/task/replan.md +0 -441
- package/.claude/commands/version.md +0 -254
- package/.claude/commands/workflow/action-plan-verify.md +0 -485
- package/.claude/commands/workflow/brainstorm/api-designer.md +0 -587
- package/.claude/commands/workflow/brainstorm/data-architect.md +0 -220
- package/.claude/commands/workflow/brainstorm/product-manager.md +0 -200
- package/.claude/commands/workflow/brainstorm/product-owner.md +0 -200
- package/.claude/commands/workflow/brainstorm/scrum-master.md +0 -200
- package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
- package/.claude/commands/workflow/brainstorm/system-architect.md +0 -389
- package/.claude/commands/workflow/brainstorm/ui-designer.md +0 -221
- package/.claude/commands/workflow/brainstorm/ux-expert.md +0 -221
- package/.claude/commands/workflow/debug.md +0 -331
- package/.claude/commands/workflow/develop-with-file.md +0 -1044
- package/.claude/skills/ccw-loop/README.md +0 -303
- package/.claude/skills/skill-generator/templates/script-bash.md +0 -277
- package/.claude/skills/skill-generator/templates/script-python.md +0 -198
- package/.codex/prompts/debug.md +0 -318
- package/ccw/src/core/routes/mcp-routes.ts.backup +0 -549
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Convert brainstorm session output to parallel-dev-cycle input with idea selection and context enrichment
|
|
3
|
+
argument-hint: SESSION="<brainstorm-session-id>" [--idea=<index>] [--auto]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brainstorm to Cycle Adapter
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Bridge workflow that converts **brainstorm-with-file** output to **parallel-dev-cycle** input. Reads synthesis.json, allows user to select an idea, and formats it as an enriched TASK description.
|
|
11
|
+
|
|
12
|
+
**Core workflow**: Load Session → Select Idea → Format Task → Launch Cycle
|
|
13
|
+
|
|
14
|
+
## Inputs
|
|
15
|
+
|
|
16
|
+
| Argument | Required | Description |
|
|
17
|
+
|----------|----------|-------------|
|
|
18
|
+
| SESSION | Yes | Brainstorm session ID (e.g., `BS-rate-limiting-2025-01-28`) |
|
|
19
|
+
| --idea | No | Pre-select idea by index (0-based, from top_ideas) |
|
|
20
|
+
| --auto | No | Auto-select top-scored idea without confirmation |
|
|
21
|
+
|
|
22
|
+
## Output
|
|
23
|
+
|
|
24
|
+
Launches `/parallel-dev-cycle` with enriched TASK containing:
|
|
25
|
+
- Primary recommendation or selected idea
|
|
26
|
+
- Key strengths and challenges
|
|
27
|
+
- Suggested implementation steps
|
|
28
|
+
- Alternative approaches for reference
|
|
29
|
+
|
|
30
|
+
## Execution Process
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
Phase 1: Session Loading
|
|
34
|
+
├─ Validate session folder exists
|
|
35
|
+
├─ Read synthesis.json
|
|
36
|
+
├─ Parse top_ideas and recommendations
|
|
37
|
+
└─ Validate data structure
|
|
38
|
+
|
|
39
|
+
Phase 2: Idea Selection
|
|
40
|
+
├─ --auto mode → Select highest scored idea
|
|
41
|
+
├─ --idea=N → Select specified index
|
|
42
|
+
└─ Interactive → Present options, await selection
|
|
43
|
+
|
|
44
|
+
Phase 3: Task Formatting
|
|
45
|
+
├─ Build enriched task description
|
|
46
|
+
├─ Include context from brainstorm
|
|
47
|
+
└─ Generate parallel-dev-cycle command
|
|
48
|
+
|
|
49
|
+
Phase 4: Cycle Launch
|
|
50
|
+
├─ Confirm with user (unless --auto)
|
|
51
|
+
└─ Execute parallel-dev-cycle
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Implementation
|
|
55
|
+
|
|
56
|
+
### Phase 1: Session Loading
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
|
60
|
+
|
|
61
|
+
// Parse arguments
|
|
62
|
+
const args = "$ARGUMENTS"
|
|
63
|
+
const sessionId = "$SESSION"
|
|
64
|
+
const ideaIndexMatch = args.match(/--idea=(\d+)/)
|
|
65
|
+
const preSelectedIdea = ideaIndexMatch ? parseInt(ideaIndexMatch[1]) : null
|
|
66
|
+
const isAutoMode = args.includes('--auto')
|
|
67
|
+
|
|
68
|
+
// Validate session
|
|
69
|
+
const sessionFolder = `.workflow/.brainstorm/${sessionId}`
|
|
70
|
+
const synthesisPath = `${sessionFolder}/synthesis.json`
|
|
71
|
+
const brainstormPath = `${sessionFolder}/brainstorm.md`
|
|
72
|
+
|
|
73
|
+
function fileExists(p) {
|
|
74
|
+
try { return bash(`test -f "${p}" && echo "yes"`).includes('yes') } catch { return false }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!fileExists(synthesisPath)) {
|
|
78
|
+
console.error(`
|
|
79
|
+
## Error: Session Not Found
|
|
80
|
+
|
|
81
|
+
Session ID: ${sessionId}
|
|
82
|
+
Expected path: ${synthesisPath}
|
|
83
|
+
|
|
84
|
+
**Available sessions**:
|
|
85
|
+
`)
|
|
86
|
+
bash(`ls -1 .workflow/.brainstorm/ 2>/dev/null | head -10`)
|
|
87
|
+
return { status: 'error', message: 'Session not found' }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Load synthesis
|
|
91
|
+
const synthesis = JSON.parse(Read(synthesisPath))
|
|
92
|
+
|
|
93
|
+
// Validate structure
|
|
94
|
+
if (!synthesis.top_ideas || synthesis.top_ideas.length === 0) {
|
|
95
|
+
console.error(`
|
|
96
|
+
## Error: No Ideas Found
|
|
97
|
+
|
|
98
|
+
The brainstorm session has no top_ideas.
|
|
99
|
+
Please complete the brainstorm workflow first.
|
|
100
|
+
`)
|
|
101
|
+
return { status: 'error', message: 'No ideas in synthesis' }
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
console.log(`
|
|
105
|
+
## Brainstorm Session Loaded
|
|
106
|
+
|
|
107
|
+
**Session**: ${sessionId}
|
|
108
|
+
**Topic**: ${synthesis.topic}
|
|
109
|
+
**Completed**: ${synthesis.completed}
|
|
110
|
+
**Ideas Found**: ${synthesis.top_ideas.length}
|
|
111
|
+
`)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### Phase 2: Idea Selection
|
|
117
|
+
|
|
118
|
+
```javascript
|
|
119
|
+
let selectedIdea = null
|
|
120
|
+
let selectionSource = ''
|
|
121
|
+
|
|
122
|
+
// Auto mode: select highest scored
|
|
123
|
+
if (isAutoMode) {
|
|
124
|
+
selectedIdea = synthesis.top_ideas.reduce((best, idea) =>
|
|
125
|
+
idea.score > best.score ? idea : best
|
|
126
|
+
)
|
|
127
|
+
selectionSource = 'auto (highest score)'
|
|
128
|
+
|
|
129
|
+
console.log(`
|
|
130
|
+
**Auto-selected**: ${selectedIdea.title} (Score: ${selectedIdea.score}/10)
|
|
131
|
+
`)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Pre-selected by index
|
|
135
|
+
else if (preSelectedIdea !== null) {
|
|
136
|
+
if (preSelectedIdea >= synthesis.top_ideas.length) {
|
|
137
|
+
console.error(`
|
|
138
|
+
## Error: Invalid Idea Index
|
|
139
|
+
|
|
140
|
+
Requested: --idea=${preSelectedIdea}
|
|
141
|
+
Available: 0 to ${synthesis.top_ideas.length - 1}
|
|
142
|
+
`)
|
|
143
|
+
return { status: 'error', message: 'Invalid idea index' }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
selectedIdea = synthesis.top_ideas[preSelectedIdea]
|
|
147
|
+
selectionSource = `index ${preSelectedIdea}`
|
|
148
|
+
|
|
149
|
+
console.log(`
|
|
150
|
+
**Pre-selected**: ${selectedIdea.title} (Index: ${preSelectedIdea})
|
|
151
|
+
`)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Interactive selection
|
|
155
|
+
else {
|
|
156
|
+
// Display options
|
|
157
|
+
console.log(`
|
|
158
|
+
## Select Idea for Development
|
|
159
|
+
|
|
160
|
+
| # | Title | Score | Feasibility |
|
|
161
|
+
|---|-------|-------|-------------|
|
|
162
|
+
${synthesis.top_ideas.map((idea, i) =>
|
|
163
|
+
`| ${i} | ${idea.title.substring(0, 40)} | ${idea.score}/10 | ${idea.feasibility || 'N/A'} |`
|
|
164
|
+
).join('\n')}
|
|
165
|
+
|
|
166
|
+
**Primary Recommendation**: ${synthesis.recommendations?.primary?.substring(0, 60) || 'N/A'}
|
|
167
|
+
`)
|
|
168
|
+
|
|
169
|
+
// Build options for AskUser
|
|
170
|
+
const ideaOptions = synthesis.top_ideas.slice(0, 4).map((idea, i) => ({
|
|
171
|
+
label: `#${i}: ${idea.title.substring(0, 30)}`,
|
|
172
|
+
description: `Score: ${idea.score}/10 - ${idea.description?.substring(0, 50) || ''}`
|
|
173
|
+
}))
|
|
174
|
+
|
|
175
|
+
// Add primary recommendation option if different
|
|
176
|
+
if (synthesis.recommendations?.primary) {
|
|
177
|
+
ideaOptions.unshift({
|
|
178
|
+
label: "Primary Recommendation",
|
|
179
|
+
description: synthesis.recommendations.primary.substring(0, 60)
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const selection = AskUser({
|
|
184
|
+
questions: [{
|
|
185
|
+
question: "Which idea should be developed?",
|
|
186
|
+
header: "Idea",
|
|
187
|
+
multiSelect: false,
|
|
188
|
+
options: ideaOptions
|
|
189
|
+
}]
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
// Parse selection
|
|
193
|
+
if (selection.idea === "Primary Recommendation") {
|
|
194
|
+
// Use primary recommendation as task
|
|
195
|
+
selectedIdea = {
|
|
196
|
+
title: "Primary Recommendation",
|
|
197
|
+
description: synthesis.recommendations.primary,
|
|
198
|
+
key_strengths: synthesis.key_insights || [],
|
|
199
|
+
main_challenges: [],
|
|
200
|
+
next_steps: synthesis.follow_up?.filter(f => f.type === 'implementation').map(f => f.summary) || []
|
|
201
|
+
}
|
|
202
|
+
selectionSource = 'primary recommendation'
|
|
203
|
+
} else {
|
|
204
|
+
const match = selection.idea.match(/^#(\d+):/)
|
|
205
|
+
const idx = match ? parseInt(match[1]) : 0
|
|
206
|
+
selectedIdea = synthesis.top_ideas[idx]
|
|
207
|
+
selectionSource = `user selected #${idx}`
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
console.log(`
|
|
212
|
+
### Selected Idea
|
|
213
|
+
|
|
214
|
+
**Title**: ${selectedIdea.title}
|
|
215
|
+
**Source**: ${selectionSource}
|
|
216
|
+
**Description**: ${selectedIdea.description?.substring(0, 200) || 'N/A'}
|
|
217
|
+
`)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
### Phase 3: Task Formatting
|
|
223
|
+
|
|
224
|
+
```javascript
|
|
225
|
+
// Build enriched task description
|
|
226
|
+
function formatTask(idea, synthesis) {
|
|
227
|
+
const sections = []
|
|
228
|
+
|
|
229
|
+
// Main objective
|
|
230
|
+
sections.push(`# Main Objective\n\n${idea.title}`)
|
|
231
|
+
|
|
232
|
+
// Description
|
|
233
|
+
if (idea.description) {
|
|
234
|
+
sections.push(`# Description\n\n${idea.description}`)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Key strengths
|
|
238
|
+
if (idea.key_strengths?.length > 0) {
|
|
239
|
+
sections.push(`# Key Strengths\n\n${idea.key_strengths.map(s => `- ${s}`).join('\n')}`)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Main challenges (important for RA agent)
|
|
243
|
+
if (idea.main_challenges?.length > 0) {
|
|
244
|
+
sections.push(`# Main Challenges to Address\n\n${idea.main_challenges.map(c => `- ${c}`).join('\n')}`)
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Recommended steps
|
|
248
|
+
if (idea.next_steps?.length > 0) {
|
|
249
|
+
sections.push(`# Recommended Implementation Steps\n\n${idea.next_steps.map((s, i) => `${i + 1}. ${s}`).join('\n')}`)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Alternative approaches (for RA consideration)
|
|
253
|
+
if (synthesis.recommendations?.alternatives?.length > 0) {
|
|
254
|
+
sections.push(`# Alternative Approaches (for reference)\n\n${synthesis.recommendations.alternatives.map(a => `- ${a}`).join('\n')}`)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Key insights from brainstorm
|
|
258
|
+
if (synthesis.key_insights?.length > 0) {
|
|
259
|
+
const relevantInsights = synthesis.key_insights.slice(0, 3)
|
|
260
|
+
sections.push(`# Key Insights from Brainstorm\n\n${relevantInsights.map(i => `- ${i}`).join('\n')}`)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Source reference
|
|
264
|
+
sections.push(`# Source\n\nBrainstorm Session: ${synthesis.session_id}\nTopic: ${synthesis.topic}`)
|
|
265
|
+
|
|
266
|
+
return sections.join('\n\n')
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const enrichedTask = formatTask(selectedIdea, synthesis)
|
|
270
|
+
|
|
271
|
+
// Display formatted task
|
|
272
|
+
console.log(`
|
|
273
|
+
## Formatted Task for parallel-dev-cycle
|
|
274
|
+
|
|
275
|
+
\`\`\`markdown
|
|
276
|
+
${enrichedTask}
|
|
277
|
+
\`\`\`
|
|
278
|
+
`)
|
|
279
|
+
|
|
280
|
+
// Save task to session folder for reference
|
|
281
|
+
Write(`${sessionFolder}/cycle-task.md`, `# Generated Task\n\n**Generated**: ${getUtc8ISOString()}\n**Idea**: ${selectedIdea.title}\n**Selection**: ${selectionSource}\n\n---\n\n${enrichedTask}`)
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
### Phase 4: Cycle Launch
|
|
287
|
+
|
|
288
|
+
```javascript
|
|
289
|
+
// Confirm launch (unless auto mode)
|
|
290
|
+
let shouldLaunch = isAutoMode
|
|
291
|
+
|
|
292
|
+
if (!isAutoMode) {
|
|
293
|
+
const confirmation = AskUser({
|
|
294
|
+
questions: [{
|
|
295
|
+
question: "Launch parallel-dev-cycle with this task?",
|
|
296
|
+
header: "Launch",
|
|
297
|
+
multiSelect: false,
|
|
298
|
+
options: [
|
|
299
|
+
{ label: "Yes, launch cycle (Recommended)", description: "Start parallel-dev-cycle with enriched task" },
|
|
300
|
+
{ label: "No, just save task", description: "Save formatted task for manual use" }
|
|
301
|
+
]
|
|
302
|
+
}]
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
shouldLaunch = confirmation.launch.includes("Yes")
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (shouldLaunch) {
|
|
309
|
+
console.log(`
|
|
310
|
+
## Launching parallel-dev-cycle
|
|
311
|
+
|
|
312
|
+
**Task**: ${selectedIdea.title}
|
|
313
|
+
**Source Session**: ${sessionId}
|
|
314
|
+
`)
|
|
315
|
+
|
|
316
|
+
// Escape task for command line
|
|
317
|
+
const escapedTask = enrichedTask
|
|
318
|
+
.replace(/\\/g, '\\\\')
|
|
319
|
+
.replace(/"/g, '\\"')
|
|
320
|
+
.replace(/\$/g, '\\$')
|
|
321
|
+
.replace(/`/g, '\\`')
|
|
322
|
+
|
|
323
|
+
// Launch parallel-dev-cycle
|
|
324
|
+
// Note: In actual execution, this would invoke the skill
|
|
325
|
+
console.log(`
|
|
326
|
+
### Cycle Command
|
|
327
|
+
|
|
328
|
+
\`\`\`bash
|
|
329
|
+
/parallel-dev-cycle TASK="${escapedTask.substring(0, 100)}..."
|
|
330
|
+
\`\`\`
|
|
331
|
+
|
|
332
|
+
**Full task saved to**: ${sessionFolder}/cycle-task.md
|
|
333
|
+
`)
|
|
334
|
+
|
|
335
|
+
// Return success with cycle trigger
|
|
336
|
+
return {
|
|
337
|
+
status: 'success',
|
|
338
|
+
action: 'launch_cycle',
|
|
339
|
+
session_id: sessionId,
|
|
340
|
+
idea: selectedIdea.title,
|
|
341
|
+
task_file: `${sessionFolder}/cycle-task.md`,
|
|
342
|
+
cycle_command: `/parallel-dev-cycle TASK="${enrichedTask}"`
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
} else {
|
|
346
|
+
console.log(`
|
|
347
|
+
## Task Saved (Not Launched)
|
|
348
|
+
|
|
349
|
+
**Task file**: ${sessionFolder}/cycle-task.md
|
|
350
|
+
|
|
351
|
+
To launch manually:
|
|
352
|
+
\`\`\`bash
|
|
353
|
+
/parallel-dev-cycle TASK="$(cat ${sessionFolder}/cycle-task.md)"
|
|
354
|
+
\`\`\`
|
|
355
|
+
`)
|
|
356
|
+
|
|
357
|
+
return {
|
|
358
|
+
status: 'success',
|
|
359
|
+
action: 'saved_only',
|
|
360
|
+
session_id: sessionId,
|
|
361
|
+
task_file: `${sessionFolder}/cycle-task.md`
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Session Files
|
|
369
|
+
|
|
370
|
+
After execution:
|
|
371
|
+
|
|
372
|
+
```
|
|
373
|
+
.workflow/.brainstorm/{session-id}/
|
|
374
|
+
├── brainstorm.md # Original brainstorm
|
|
375
|
+
├── synthesis.json # Synthesis data (input)
|
|
376
|
+
├── perspectives.json # Perspectives data
|
|
377
|
+
├── ideas/ # Idea deep-dives
|
|
378
|
+
└── cycle-task.md # ⭐ Generated task (output)
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Task Format
|
|
382
|
+
|
|
383
|
+
The generated task includes:
|
|
384
|
+
|
|
385
|
+
| Section | Purpose | Used By |
|
|
386
|
+
|---------|---------|---------|
|
|
387
|
+
| Main Objective | Clear goal statement | RA: Primary requirement |
|
|
388
|
+
| Description | Detailed explanation | RA: Requirement context |
|
|
389
|
+
| Key Strengths | Why this approach | RA: Design decisions |
|
|
390
|
+
| Main Challenges | Known issues to address | RA: Edge cases, risks |
|
|
391
|
+
| Implementation Steps | Suggested approach | EP: Planning guidance |
|
|
392
|
+
| Alternatives | Other valid approaches | RA: Fallback options |
|
|
393
|
+
| Key Insights | Learnings from brainstorm | RA: Domain context |
|
|
394
|
+
|
|
395
|
+
## Error Handling
|
|
396
|
+
|
|
397
|
+
| Situation | Action |
|
|
398
|
+
|-----------|--------|
|
|
399
|
+
| Session not found | List available sessions, abort |
|
|
400
|
+
| synthesis.json missing | Suggest completing brainstorm first |
|
|
401
|
+
| No top_ideas | Report error, abort |
|
|
402
|
+
| Invalid --idea index | Show valid range, abort |
|
|
403
|
+
| Task too long | Truncate with reference to file |
|
|
404
|
+
|
|
405
|
+
## Examples
|
|
406
|
+
|
|
407
|
+
### Auto Mode (Quick Launch)
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
/brainstorm-to-cycle SESSION="BS-rate-limiting-2025-01-28" --auto
|
|
411
|
+
# → Selects highest-scored idea
|
|
412
|
+
# → Launches parallel-dev-cycle immediately
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Pre-Selected Idea
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
/brainstorm-to-cycle SESSION="BS-auth-system-2025-01-28" --idea=2
|
|
419
|
+
# → Selects top_ideas[2]
|
|
420
|
+
# → Confirms before launch
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Interactive Selection
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
/brainstorm-to-cycle SESSION="BS-caching-2025-01-28"
|
|
427
|
+
# → Displays all ideas with scores
|
|
428
|
+
# → User selects from options
|
|
429
|
+
# → Confirms and launches
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
## Integration Flow
|
|
433
|
+
|
|
434
|
+
```
|
|
435
|
+
brainstorm-with-file
|
|
436
|
+
│
|
|
437
|
+
▼
|
|
438
|
+
synthesis.json
|
|
439
|
+
│
|
|
440
|
+
▼
|
|
441
|
+
brainstorm-to-cycle ◄─── This command
|
|
442
|
+
│
|
|
443
|
+
▼
|
|
444
|
+
enriched TASK
|
|
445
|
+
│
|
|
446
|
+
▼
|
|
447
|
+
parallel-dev-cycle
|
|
448
|
+
│
|
|
449
|
+
▼
|
|
450
|
+
RA → EP → CD → VAS
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
**Now execute brainstorm-to-cycle** with session: $SESSION
|