claude-code-workflow 7.2.29 → 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.
- package/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json +2 -2
- package/.ccw/workflows/cli-templates/schemas/task-schema.json +14 -7
- package/.claude/agents/action-planning-agent.md +7 -4
- package/.claude/agents/cli-explore-agent.md +77 -63
- package/.claude/agents/cli-lite-planning-agent.md +11 -10
- package/.claude/agents/issue-plan-agent.md +421 -426
- package/.claude/commands/workflow/spec/setup.md +1 -1
- package/.claude/commands/workflow-skill.md +130 -0
- package/.claude/skills/ccw-chain/SKILL.md +92 -0
- package/.claude/skills/ccw-chain/chains/ccw-cycle.json +31 -0
- package/.claude/skills/ccw-chain/chains/ccw-exploration.json +58 -0
- package/.claude/skills/ccw-chain/chains/ccw-issue.json +44 -0
- package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +71 -0
- package/.claude/skills/ccw-chain/chains/ccw-main.json +65 -0
- package/.claude/skills/ccw-chain/chains/ccw-standard.json +51 -0
- package/.claude/skills/ccw-chain/chains/ccw-team.json +15 -0
- package/.claude/skills/ccw-chain/chains/ccw-with-file.json +47 -0
- package/.claude/skills/ccw-chain/specs/auto-mode.md +47 -0
- package/.claude/skills/chain-loader/SKILL.md +78 -0
- package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -0
- package/.claude/skills/chain-loader/phases/02-design-graph.md +73 -0
- package/.claude/skills/chain-loader/phases/03-generate-validate.md +75 -0
- package/.claude/skills/chain-loader/specs/chain-schema.md +126 -0
- package/.claude/skills/chain-loader/specs/design-patterns.md +99 -0
- package/.claude/skills/chain-loader/templates/chain-json.md +63 -0
- package/.claude/skills/review-cycle/phases/review-module.md +764 -764
- package/.claude/skills/review-cycle/phases/review-session.md +775 -775
- package/.claude/skills/workflow-multi-cli-plan/SKILL.md +2 -2
- package/.claude/skills/workflow-plan/SKILL.md +1 -0
- package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
- package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
- package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -422
- package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
- package/.claude/skills/workflow-plan/phases/05-plan-verify.md +395 -395
- package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +407 -407
- package/.claude/skills/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -426
- package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +493 -493
- package/.codex/skills/analyze-with-file/SKILL.md +383 -134
- package/.codex/skills/brainstorm/SKILL.md +3 -3
- package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
- package/.codex/skills/clean/SKILL.md +1 -1
- package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
- package/.codex/skills/investigate/orchestrator.md +24 -0
- package/.codex/skills/issue-discover/SKILL.md +374 -361
- package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
- package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
- package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
- package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
- package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
- package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
- package/.codex/skills/review-cycle/SKILL.md +31 -12
- package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
- package/.codex/skills/security-audit/orchestrator.md +29 -0
- package/.codex/skills/session-sync/SKILL.md +1 -1
- package/.codex/skills/ship/orchestrator.md +24 -0
- package/.codex/skills/spec-add/SKILL.md +5 -5
- package/.codex/skills/spec-generator/SKILL.md +33 -2
- package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
- package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
- package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
- package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
- package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
- package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
- package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
- package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
- package/.codex/skills/spec-setup/SKILL.md +669 -669
- package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
- package/.codex/skills/team-brainstorm/SKILL.md +259 -259
- package/.codex/skills/team-coordinate/SKILL.md +359 -359
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-designer/SKILL.md +27 -1
- package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
- package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
- package/.codex/skills/team-designer/phases/04-validation.md +1 -1
- package/.codex/skills/team-executor/SKILL.md +218 -218
- package/.codex/skills/team-frontend/SKILL.md +227 -227
- package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
- package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
- package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
- package/.codex/skills/team-issue/SKILL.md +269 -269
- package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
- package/.codex/skills/team-motion-design/SKILL.md +222 -222
- package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
- package/.codex/skills/team-perf-opt/SKILL.md +258 -258
- package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
- package/.codex/skills/team-planex/SKILL.md +216 -216
- package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
- package/.codex/skills/team-review/SKILL.md +227 -227
- package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
- package/.codex/skills/team-tech-debt/SKILL.md +206 -206
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-testing/SKILL.md +237 -237
- package/.codex/skills/team-ui-polish/SKILL.md +218 -218
- package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
- package/.codex/skills/team-uidesign/SKILL.md +219 -219
- package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
- package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-ux-improve/SKILL.md +227 -227
- package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
- package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
- package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
- package/.codex/skills/workflow-execute/SKILL.md +5 -5
- package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
- package/.codex/skills/workflow-plan/SKILL.md +3 -3
- package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
- package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
- package/README.md +14 -0
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +16 -0
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/chain-loader.d.ts +2 -0
- package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
- package/ccw/dist/commands/chain-loader.js +11 -0
- package/ccw/dist/commands/chain-loader.js.map +1 -0
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +52 -1
- package/ccw/dist/commands/install.js.map +1 -1
- package/ccw/dist/commands/launcher.d.ts +2 -0
- package/ccw/dist/commands/launcher.d.ts.map +1 -0
- package/ccw/dist/commands/launcher.js +434 -0
- package/ccw/dist/commands/launcher.js.map +1 -0
- package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/litellm-api-routes.js +0 -23
- package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
- package/ccw/dist/tools/chain-loader.d.ts +10 -0
- package/ccw/dist/tools/chain-loader.d.ts.map +1 -0
- package/ccw/dist/tools/chain-loader.js +1054 -0
- package/ccw/dist/tools/chain-loader.js.map +1 -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/dist/tools/json-builder.js +20 -0
- package/ccw/dist/tools/json-builder.js.map +1 -1
- package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
- package/ccw/dist/tools/skill-context-loader.js +12 -26
- package/ccw/dist/tools/skill-context-loader.js.map +1 -1
- package/ccw/dist/types/chain-types.d.ts +112 -0
- package/ccw/dist/types/chain-types.d.ts.map +1 -0
- package/ccw/dist/types/chain-types.js +5 -0
- package/ccw/dist/types/chain-types.js.map +1 -0
- package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
- package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
- package/ccw/dist/utils/chain-visualizer.js +164 -0
- package/ccw/dist/utils/chain-visualizer.js.map +1 -0
- package/ccw/scripts/prepublish-clean.mjs +0 -1
- package/package.json +1 -3
- package/.claude/commands/cli/cli-init.md +0 -441
- package/.claude/commands/cli/codex-review.md +0 -361
- package/.claude/commands/flow-create.md +0 -663
- package/.claude/skills/team-edict.zip +0 -0
- package/ccw-litellm/README.md +0 -180
- package/ccw-litellm/pyproject.toml +0 -35
- package/ccw-litellm/src/ccw_litellm/__init__.py +0 -47
- package/ccw-litellm/src/ccw_litellm/cli.py +0 -108
- package/ccw-litellm/src/ccw_litellm/clients/__init__.py +0 -12
- package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +0 -270
- package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +0 -198
- package/ccw-litellm/src/ccw_litellm/config/__init__.py +0 -22
- package/ccw-litellm/src/ccw_litellm/config/loader.py +0 -343
- package/ccw-litellm/src/ccw_litellm/config/models.py +0 -162
- package/ccw-litellm/src/ccw_litellm/interfaces/__init__.py +0 -14
- package/ccw-litellm/src/ccw_litellm/interfaces/embedder.py +0 -52
- package/ccw-litellm/src/ccw_litellm/interfaces/llm.py +0 -45
|
@@ -228,7 +228,7 @@ const topic = isRole
|
|
|
228
228
|
|
|
229
229
|
```javascript
|
|
230
230
|
if (executionMode === null) {
|
|
231
|
-
const modeAnswer = request_user_input({
|
|
231
|
+
const modeAnswer = functions.request_user_input({
|
|
232
232
|
questions: [{
|
|
233
233
|
question: "Choose brainstorming mode:",
|
|
234
234
|
header: "Mode",
|
|
@@ -324,7 +324,7 @@ TOPIC: ${topic}" --tool gemini --mode analysis --rule planning-breakdown-task-st
|
|
|
324
324
|
features.forEach(f => console.log(` - [${f.id}] ${f.title}`))
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
const answer = request_user_input({
|
|
327
|
+
const answer = functions.request_user_input({
|
|
328
328
|
questions: [{
|
|
329
329
|
question: "Approve brainstorm framework?",
|
|
330
330
|
header: "Validate",
|
|
@@ -339,7 +339,7 @@ TOPIC: ${topic}" --tool gemini --mode analysis --rule planning-breakdown-task-st
|
|
|
339
339
|
if (answer.Validate === "Cancel") return
|
|
340
340
|
if (answer.Validate === "Modify Roles") {
|
|
341
341
|
// Allow user to adjust via request_user_input
|
|
342
|
-
const roleAnswer = request_user_input({
|
|
342
|
+
const roleAnswer = functions.request_user_input({
|
|
343
343
|
questions: [{
|
|
344
344
|
question: "Select roles for analysis:",
|
|
345
345
|
header: "Roles",
|
|
@@ -8,15 +8,18 @@ argument-hint: "TOPIC=\"<idea or topic>\" [--perspectives=creative,pragmatic,sys
|
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
11
|
-
Interactive brainstorming workflow with **documented thought evolution**. Expands initial ideas through questioning, inline multi-perspective analysis, and iterative refinement.
|
|
11
|
+
Interactive brainstorming workflow with **documented thought evolution**. Expands initial ideas through questioning, inline multi-perspective analysis, external research, and iterative refinement.
|
|
12
12
|
|
|
13
|
-
**Core workflow**: Seed Idea → Expand → Multi-Perspective Explore →
|
|
13
|
+
**Core workflow**: Seed Idea → Expand → Multi-Perspective Explore → Research → Refine → Crystallize → Next Step
|
|
14
14
|
|
|
15
15
|
**Key features**:
|
|
16
16
|
- **brainstorm.md**: Complete thought evolution timeline
|
|
17
17
|
- **Multi-perspective analysis**: Creative + Pragmatic + Systematic (serial, inline)
|
|
18
|
+
- **External research**: Web search for inspiration, patterns, and best practices via `web.run`
|
|
18
19
|
- **Idea expansion**: Progressive questioning and exploration
|
|
19
20
|
- **Diverge-Converge cycles**: Generate options then focus on best paths
|
|
21
|
+
- **Progress tracking**: `functions.update_plan` for real-time phase progress visibility
|
|
22
|
+
- **Structured handoff**: Terminal gate with execution planning, issue creation, or completion
|
|
20
23
|
|
|
21
24
|
## Auto Mode
|
|
22
25
|
|
|
@@ -62,12 +65,13 @@ When `--yes` or `-y`: Auto-confirm exploration decisions, use recommended perspe
|
|
|
62
65
|
Step 0: Session Setup
|
|
63
66
|
├─ Parse topic, flags (--perspectives, --continue, -y)
|
|
64
67
|
├─ Generate session ID: BS-{slug}-{date}
|
|
65
|
-
|
|
68
|
+
├─ Create session folder (or detect existing → continue mode)
|
|
69
|
+
└─ functions.update_plan (5 phases: Seed → Explore → Refine → Converge → GATE)
|
|
66
70
|
|
|
67
71
|
Step 1: Seed Understanding
|
|
68
72
|
├─ Parse topic, identify brainstorm dimensions
|
|
69
73
|
├─ Role/perspective selection with user (or auto)
|
|
70
|
-
├─ Initial scoping (mode, focus
|
|
74
|
+
├─ Initial scoping via functions.request_user_input (mode, focus, constraints)
|
|
71
75
|
├─ Expand seed into exploration vectors
|
|
72
76
|
└─ Initialize brainstorm.md
|
|
73
77
|
|
|
@@ -79,18 +83,21 @@ Step 2: Divergent Exploration (Inline, No Agents)
|
|
|
79
83
|
│ ├─ Creative perspective: innovation, cross-domain, challenge assumptions
|
|
80
84
|
│ ├─ Pragmatic perspective: feasibility, effort, blockers
|
|
81
85
|
│ └─ Systematic perspective: decomposition, patterns, scalability
|
|
82
|
-
├─
|
|
86
|
+
├─ External research via web.run (optional — patterns, best practices, inspiration)
|
|
87
|
+
├─ Aggregate findings → perspectives.json + research.json
|
|
83
88
|
├─ Update brainstorm.md with Round 1
|
|
84
89
|
└─ Initial Idea Coverage Check
|
|
85
90
|
|
|
86
91
|
Step 3: Interactive Refinement (Multi-Round, max 6)
|
|
87
|
-
├─ Present current ideas and perspectives
|
|
88
|
-
├─
|
|
92
|
+
├─ Present current ideas and perspectives (Cumulative Context)
|
|
93
|
+
├─ Record findings to brainstorm.md BEFORE updating Current Ideas
|
|
94
|
+
├─ Gather user feedback via functions.request_user_input
|
|
89
95
|
├─ Process response:
|
|
90
96
|
│ ├─ Deep Dive → deeper inline analysis on selected ideas
|
|
91
97
|
│ ├─ Diverge → new inline analysis with different angles
|
|
92
98
|
│ ├─ Challenge → devil's advocate inline analysis
|
|
93
99
|
│ ├─ Merge → synthesize complementary ideas inline
|
|
100
|
+
│ ├─ 外部研究 → web.run for external inspiration/validation
|
|
94
101
|
│ └─ Converge → exit loop for synthesis
|
|
95
102
|
├─ Update brainstorm.md with round details
|
|
96
103
|
└─ Repeat until user selects converge or max rounds
|
|
@@ -98,8 +105,11 @@ Step 3: Interactive Refinement (Multi-Round, max 6)
|
|
|
98
105
|
Step 4: Convergence & Crystallization
|
|
99
106
|
├─ Consolidate all insights → synthesis.json
|
|
100
107
|
├─ Update brainstorm.md with final synthesis
|
|
101
|
-
├─
|
|
102
|
-
└─
|
|
108
|
+
├─ Batch top-idea review via functions.request_user_input
|
|
109
|
+
└─ MANDATORY Terminal Gate: 执行任务 / 产出Issue / 完成
|
|
110
|
+
├─ Execute Task → handoff-spec.json with implementation scope
|
|
111
|
+
├─ Create Issue → display issue creation command
|
|
112
|
+
└─ Done → end workflow
|
|
103
113
|
```
|
|
104
114
|
|
|
105
115
|
## Output Artifacts
|
|
@@ -193,7 +203,7 @@ const selectedPerspectiveNames = perspectivesMatch
|
|
|
193
203
|
const topic = $ARGUMENTS.replace(/--yes|-y|--continue|--perspectives[=\s][\w,]+|--max-ideas[=\s]\d+|TOPIC=/g, '').replace(/^["']|["']$/g, '').trim()
|
|
194
204
|
|
|
195
205
|
// Determine project root
|
|
196
|
-
const projectRoot =
|
|
206
|
+
const projectRoot = functions.exec_command('git rev-parse --show-toplevel 2>/dev/null || pwd').trim()
|
|
197
207
|
|
|
198
208
|
const slug = topic.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-').substring(0, 40)
|
|
199
209
|
const dateStr = getUtc8ISOString().substring(0, 10)
|
|
@@ -202,7 +212,16 @@ const sessionFolder = `${projectRoot}/.workflow/.brainstorm/${sessionId}`
|
|
|
202
212
|
|
|
203
213
|
// Auto-detect continue: session folder + brainstorm.md exists → continue mode
|
|
204
214
|
// If continue → load brainstorm.md + perspectives, resume from last round
|
|
205
|
-
|
|
215
|
+
functions.exec_command(`mkdir -p ${sessionFolder}`)
|
|
216
|
+
|
|
217
|
+
// Initialize progress tracking (MANDATORY)
|
|
218
|
+
functions.update_plan([
|
|
219
|
+
{ id: "phase-1", title: "Phase 1: Seed Understanding", status: "in_progress" },
|
|
220
|
+
{ id: "phase-2", title: "Phase 2: Divergent Exploration", status: "pending" },
|
|
221
|
+
{ id: "phase-3", title: "Phase 3: Interactive Refinement", status: "pending" },
|
|
222
|
+
{ id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "pending" },
|
|
223
|
+
{ id: "next-step", title: "GATE: Post-Completion Next Step", status: "pending" }
|
|
224
|
+
])
|
|
206
225
|
```
|
|
207
226
|
|
|
208
227
|
### Phase 1: Seed Understanding
|
|
@@ -255,43 +274,37 @@ For new brainstorm sessions, gather user preferences before exploration (skipped
|
|
|
255
274
|
|
|
256
275
|
```javascript
|
|
257
276
|
if (!autoYes && !continueMode) {
|
|
258
|
-
//
|
|
259
|
-
const
|
|
260
|
-
questions: [
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
{ label: "Existing Architecture", description: "Must fit current system" },
|
|
290
|
-
{ label: "Time Constraints", description: "Short implementation timeline" },
|
|
291
|
-
{ label: "Resource Constraints", description: "Limited team/budget" },
|
|
292
|
-
{ label: "No Constraints", description: "Blue-sky thinking" }
|
|
293
|
-
]
|
|
294
|
-
}]
|
|
277
|
+
// Single batch: Mode + Focus + Constraints (max 4 questions per call)
|
|
278
|
+
const scoping = functions.request_user_input({
|
|
279
|
+
questions: [
|
|
280
|
+
{
|
|
281
|
+
header: "Mode", // max 12 chars
|
|
282
|
+
question: "Select brainstorming intensity:",
|
|
283
|
+
multiSelect: false,
|
|
284
|
+
options: [
|
|
285
|
+
{ label: "Balanced (Recommended)", description: "Moderate, 3 perspectives" },
|
|
286
|
+
{ label: "Creative", description: "Fast, high novelty, 1 perspective" },
|
|
287
|
+
{ label: "Deep", description: "Comprehensive, 3 perspectives + deep refinement" }
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
header: "Focus",
|
|
292
|
+
question: "Select brainstorming focus areas:",
|
|
293
|
+
multiSelect: true,
|
|
294
|
+
options: generateFocusOptions(dimensions) // Dynamic based on dimensions
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
header: "Constraints",
|
|
298
|
+
question: "Any constraints to consider?",
|
|
299
|
+
multiSelect: true,
|
|
300
|
+
options: [
|
|
301
|
+
{ label: "Existing Arch", description: "Must fit current system" },
|
|
302
|
+
{ label: "Time Limited", description: "Short implementation timeline" },
|
|
303
|
+
{ label: "Resource Limited", description: "Limited team/budget" },
|
|
304
|
+
{ label: "No Constraints", description: "Blue-sky thinking" }
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
]
|
|
295
308
|
})
|
|
296
309
|
}
|
|
297
310
|
```
|
|
@@ -374,7 +387,7 @@ Write(`${sessionFolder}/brainstorm.md`, brainstormMd)
|
|
|
374
387
|
##### Step 2.1: Detect Codebase & Explore
|
|
375
388
|
|
|
376
389
|
```javascript
|
|
377
|
-
const hasCodebase =
|
|
390
|
+
const hasCodebase = functions.exec_command(`
|
|
378
391
|
test -f package.json && echo "nodejs" ||
|
|
379
392
|
test -f go.mod && echo "golang" ||
|
|
380
393
|
test -f Cargo.toml && echo "rust" ||
|
|
@@ -443,6 +456,9 @@ perspectives.forEach(perspective => {
|
|
|
443
456
|
##### Step 2.3: Aggregate Multi-Perspective Findings
|
|
444
457
|
|
|
445
458
|
```javascript
|
|
459
|
+
// Update progress
|
|
460
|
+
functions.update_plan([{ id: "phase-2", title: "Phase 2: Divergent Exploration", status: "in_progress" }])
|
|
461
|
+
|
|
446
462
|
const synthesis = {
|
|
447
463
|
session_id: sessionId,
|
|
448
464
|
timestamp: getUtc8ISOString(),
|
|
@@ -467,6 +483,32 @@ const synthesis = {
|
|
|
467
483
|
Write(`${sessionFolder}/perspectives.json`, JSON.stringify(synthesis, null, 2))
|
|
468
484
|
```
|
|
469
485
|
|
|
486
|
+
##### Step 2.3b: External Research (Optional)
|
|
487
|
+
|
|
488
|
+
Search for external inspiration, industry best practices, and prior art to enrich brainstorming context.
|
|
489
|
+
|
|
490
|
+
```javascript
|
|
491
|
+
// Triggered when: topic involves established patterns, industry trends, or competitive landscape
|
|
492
|
+
const researchQueries = generateResearchQueries(topic, dimensions)
|
|
493
|
+
|
|
494
|
+
researchQueries.forEach(query => {
|
|
495
|
+
const results = web.run({ search_query: query })
|
|
496
|
+
// Extract: patterns, inspiration, best practices, case studies
|
|
497
|
+
})
|
|
498
|
+
|
|
499
|
+
// Write research findings
|
|
500
|
+
Write(`${sessionFolder}/research.json`, JSON.stringify({
|
|
501
|
+
queries: researchQueries,
|
|
502
|
+
findings: [...], // [{source, insight, relevance_to_topic}]
|
|
503
|
+
inspiration: [...], // Cross-domain ideas from external sources
|
|
504
|
+
best_practices: [...],
|
|
505
|
+
_metadata: { timestamp: getUtc8ISOString() }
|
|
506
|
+
}, null, 2))
|
|
507
|
+
|
|
508
|
+
// Merge research findings into perspectives.json synthesis
|
|
509
|
+
// Update convergent_themes and unique_contributions with external evidence
|
|
510
|
+
```
|
|
511
|
+
|
|
470
512
|
##### Step 2.4: Update brainstorm.md
|
|
471
513
|
|
|
472
514
|
Append Round 1 with exploration results using the [Round Documentation Pattern](#round-documentation-pattern).
|
|
@@ -509,6 +551,14 @@ ${explorationVectors.map((vector, i) => {
|
|
|
509
551
|
- Creative mode: Run 1 auto-round (1× Diverge), then auto-converge
|
|
510
552
|
- Skip user direction prompts; auto-select based on idea scores
|
|
511
553
|
|
|
554
|
+
**Cumulative Context Rule**: Each round's analysis MUST include ALL prior findings as context. Never analyze in isolation — always build on:
|
|
555
|
+
- Previous rounds' ideas and ratings
|
|
556
|
+
- User feedback from all prior rounds
|
|
557
|
+
- Research findings (if any)
|
|
558
|
+
- Challenged assumptions and their outcomes
|
|
559
|
+
|
|
560
|
+
**Record-Before-Continue Rule**: MUST write round findings to brainstorm.md BEFORE updating Current Ideas or presenting next interaction.
|
|
561
|
+
|
|
512
562
|
##### Step 3.1: Present Findings & Gather User Direction
|
|
513
563
|
|
|
514
564
|
**Current Understanding Summary** (Round >= 2, BEFORE presenting new findings):
|
|
@@ -516,19 +566,32 @@ ${explorationVectors.map((vector, i) => {
|
|
|
516
566
|
- Example: "Top ideas so far: [idea1], [idea2]. Last round [deepened/challenged/merged]. Here are the latest findings:"
|
|
517
567
|
|
|
518
568
|
```javascript
|
|
569
|
+
// Update progress
|
|
570
|
+
functions.update_plan([{ id: "phase-3", title: "Phase 3: Interactive Refinement", status: "in_progress" }])
|
|
571
|
+
|
|
519
572
|
if (!autoYes) {
|
|
520
|
-
|
|
573
|
+
// Dynamic options based on round context
|
|
574
|
+
const baseOptions = [
|
|
575
|
+
{ label: "Deep Dive", description: "Explore selected ideas in detail" },
|
|
576
|
+
{ label: "Diverge More", description: "Generate more ideas from different angles" },
|
|
577
|
+
{ label: "Challenge", description: "Devil's advocate — test ideas critically" },
|
|
578
|
+
{ label: "Merge Ideas", description: "Combine complementary ideas" }
|
|
579
|
+
]
|
|
580
|
+
|
|
581
|
+
// Add research option if not yet done or if new angles emerged
|
|
582
|
+
if (!researchDone || newAnglesEmerged) {
|
|
583
|
+
baseOptions.push({ label: "外部研究", description: "Search for external inspiration and best practices" })
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// Always include converge as final option
|
|
587
|
+
baseOptions.push({ label: "Ready to Converge", description: "Sufficient ideas, proceed to synthesis" })
|
|
588
|
+
|
|
589
|
+
const feedback = functions.request_user_input({
|
|
521
590
|
questions: [{
|
|
522
|
-
header: "
|
|
523
|
-
id: "direction",
|
|
591
|
+
header: "Direction", // max 12 chars
|
|
524
592
|
question: `Brainstorm round ${round}: What would you like to do next?`,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
{ label: "Diverge More", description: "Generate more ideas from different angles" },
|
|
528
|
-
{ label: "Challenge", description: "Devil's advocate — test ideas critically" },
|
|
529
|
-
{ label: "Merge Ideas", description: "Combine complementary ideas" },
|
|
530
|
-
{ label: "Ready to Converge", description: "Sufficient ideas, proceed to synthesis" }
|
|
531
|
-
]
|
|
593
|
+
multiSelect: false,
|
|
594
|
+
options: baseOptions.slice(0, 4) // max 4 options per schema
|
|
532
595
|
}]
|
|
533
596
|
})
|
|
534
597
|
}
|
|
@@ -547,6 +610,7 @@ if (!autoYes) {
|
|
|
547
610
|
| **Diverge More** | Inline analysis with different angles: alternative framings, cross-domain inspiration, what-if scenarios, constraint relaxation. Generate new ideas. |
|
|
548
611
|
| **Challenge** | Inline devil's advocate analysis: 3 strongest objections per idea, challenge assumptions, failure scenarios, competitive alternatives, survivability rating (1-5). |
|
|
549
612
|
| **Merge Ideas** | Ask which ideas to merge. Inline synthesis: identify complementary elements, resolve contradictions, create unified concept, preserve strengths. Write to `ideas/merged-idea-{n}.md`. |
|
|
613
|
+
| **外部研究** | Execute `web.run` with topic-specific queries. Search for: industry patterns, competitive solutions, best practices, academic research. Merge findings into current round. Update `research.json`. |
|
|
550
614
|
| **Ready to Converge** | Record why concluding. Exit loop → Phase 4. |
|
|
551
615
|
|
|
552
616
|
##### Step 3.3: Deep Dive on Selected Ideas
|
|
@@ -698,25 +762,34 @@ Write(`${sessionFolder}/synthesis.json`, JSON.stringify(synthesis, null, 2))
|
|
|
698
762
|
|
|
699
763
|
##### Step 4.3: Interactive Top-Idea Review (skip in auto mode)
|
|
700
764
|
|
|
701
|
-
|
|
765
|
+
Batch review of top ideas (max 4 questions per call, so group top ideas accordingly):
|
|
702
766
|
|
|
703
767
|
```javascript
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
768
|
+
// Update progress
|
|
769
|
+
functions.update_plan([{ id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "in_progress" }])
|
|
770
|
+
|
|
771
|
+
if (!autoYes) {
|
|
772
|
+
// Batch review: up to 4 ideas per functions.request_user_input call
|
|
773
|
+
const batchSize = 4
|
|
774
|
+
for (let batch = 0; batch < rankedIdeas.length; batch += batchSize) {
|
|
775
|
+
const batchIdeas = rankedIdeas.slice(batch, batch + batchSize)
|
|
776
|
+
const review = functions.request_user_input({
|
|
777
|
+
questions: batchIdeas.map((idea, i) => ({
|
|
778
|
+
header: `Idea #${batch + i + 1}`, // max 12 chars
|
|
779
|
+
question: `"${idea.title}" (score: ${idea.score}). Your decision:`,
|
|
780
|
+
multiSelect: false,
|
|
781
|
+
options: [
|
|
782
|
+
{ label: "Accept", description: "Keep in final recommendations" },
|
|
783
|
+
{ label: "Modify", description: "Adjust scope or priority" },
|
|
784
|
+
{ label: "Reject", description: "Remove from recommendations" },
|
|
785
|
+
{ label: "Accept Rest", description: "Accept all remaining ideas" }
|
|
786
|
+
]
|
|
787
|
+
}))
|
|
788
|
+
})
|
|
789
|
+
// Process: Accept → "accepted" | Modify → gather text → "modified" | Reject → "rejected"
|
|
790
|
+
// Accept Rest → mark all remaining as "accepted", break outer loop
|
|
791
|
+
// Record review decisions to brainstorm.md Decision Log + update synthesis.json
|
|
792
|
+
}
|
|
720
793
|
}
|
|
721
794
|
```
|
|
722
795
|
|
|
@@ -730,25 +803,66 @@ for (const [index, idea] of rankedIdeas.entries()) {
|
|
|
730
803
|
| 3 | [title] | 6 | 3 | 4 | Rejected | [reason] |
|
|
731
804
|
```
|
|
732
805
|
|
|
733
|
-
##### Step 4.4: Post-Completion
|
|
806
|
+
##### Step 4.4: MANDATORY Terminal Gate (Post-Completion Next Step)
|
|
734
807
|
|
|
735
|
-
**
|
|
808
|
+
**CRITICAL**: This gate MUST execute. The workflow MUST NOT end without this `functions.request_user_input` call.
|
|
736
809
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
810
|
+
```javascript
|
|
811
|
+
// Update progress — mark phase 4 complete, activate terminal gate
|
|
812
|
+
functions.update_plan([
|
|
813
|
+
{ id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "completed" },
|
|
814
|
+
{ id: "next-step", title: "GATE: Post-Completion Next Step", status: "in_progress" }
|
|
815
|
+
])
|
|
816
|
+
|
|
817
|
+
const nextStep = functions.request_user_input({
|
|
818
|
+
questions: [{
|
|
819
|
+
header: "Next Step", // max 12 chars
|
|
820
|
+
question: "Brainstorming complete. What would you like to do next?",
|
|
821
|
+
multiSelect: false,
|
|
822
|
+
options: [
|
|
823
|
+
{ label: "Execute Task", description: "Build implementation scope and handoff spec from top ideas" },
|
|
824
|
+
{ label: "Create Issue", description: "Convert top ideas into trackable issues" },
|
|
825
|
+
{ label: "Done", description: "End workflow, all artifacts saved" }
|
|
826
|
+
]
|
|
827
|
+
}]
|
|
828
|
+
})
|
|
742
829
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
830
|
+
// Handle next step
|
|
831
|
+
if (nextStep === "Execute Task") {
|
|
832
|
+
// Build implementation scope from accepted ideas
|
|
833
|
+
// Step A: Identify scope items from top ideas
|
|
834
|
+
// Step B: Generate handoff-spec.json with implementation details
|
|
835
|
+
// Step C: Write handoff-spec.json to session folder
|
|
836
|
+
Write(`${sessionFolder}/handoff-spec.json`, JSON.stringify({
|
|
837
|
+
session_id: sessionId,
|
|
838
|
+
topic,
|
|
839
|
+
scope_items: acceptedIdeas.map(idea => ({
|
|
840
|
+
title: idea.title,
|
|
841
|
+
description: idea.description,
|
|
842
|
+
implementation_approach: idea.next_steps,
|
|
843
|
+
priority: idea.score >= 8 ? 'high' : idea.score >= 5 ? 'medium' : 'low',
|
|
844
|
+
estimated_complexity: idea.feasibility <= 2 ? 'high' : idea.feasibility <= 4 ? 'medium' : 'low'
|
|
845
|
+
})),
|
|
846
|
+
recommended_workflow: 'workflow-lite-plan or workflow-plan',
|
|
847
|
+
_metadata: { generated: getUtc8ISOString(), source_session: sessionId }
|
|
848
|
+
}, null, 2))
|
|
849
|
+
// Display: "Handoff spec created. Run /workflow-lite-plan to execute."
|
|
850
|
+
} else if (nextStep === "Create Issue") {
|
|
851
|
+
// Display command for user to run manually
|
|
852
|
+
// "/issue:from-brainstorm ${sessionFolder}" or "/issue:new ..."
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// Mark terminal gate complete
|
|
856
|
+
functions.update_plan([
|
|
857
|
+
{ id: "next-step", title: "GATE: Post-Completion Next Step", status: "completed" }
|
|
858
|
+
])
|
|
859
|
+
```
|
|
747
860
|
|
|
748
861
|
**Success Criteria**:
|
|
749
862
|
- synthesis.json created with complete synthesis
|
|
750
863
|
- brainstorm.md finalized with all conclusions
|
|
751
|
-
-
|
|
864
|
+
- Terminal gate executed with user's next-step choice
|
|
865
|
+
- If "Execute Task": handoff-spec.json created with implementation scope
|
|
752
866
|
- Session complete and all artifacts available
|
|
753
867
|
|
|
754
868
|
## Templates
|
|
@@ -812,7 +926,9 @@ Remaining questions or exploration directions
|
|
|
812
926
|
│ ├── pragmatic.json
|
|
813
927
|
│ └── systematic.json
|
|
814
928
|
├── perspectives.json # Phase 2: Aggregated findings with synthesis
|
|
929
|
+
├── research.json # Phase 2/3: External research findings (if web.run used)
|
|
815
930
|
├── synthesis.json # Phase 4: Final synthesis
|
|
931
|
+
├── handoff-spec.json # Phase 4: Implementation scope (if "Execute Task" selected)
|
|
816
932
|
└── ideas/ # Phase 3: Individual idea deep-dives
|
|
817
933
|
├── idea-1.md
|
|
818
934
|
├── idea-2.md
|
|
@@ -825,8 +941,10 @@ Remaining questions or exploration directions
|
|
|
825
941
|
| `exploration-codebase.json` | 2 | Codebase context: relevant files, patterns, constraints |
|
|
826
942
|
| `perspectives/*.json` | 2 | Per-perspective idea generation results |
|
|
827
943
|
| `perspectives.json` | 2 | Aggregated findings with cross-perspective synthesis |
|
|
944
|
+
| `research.json` | 2-3 | External research: patterns, best practices, inspiration |
|
|
828
945
|
| `ideas/*.md` | 3 | Individual idea deep-dives and merged ideas |
|
|
829
946
|
| `synthesis.json` | 4 | Final synthesis: top ideas, recommendations, insights |
|
|
947
|
+
| `handoff-spec.json` | 4 | Implementation scope and handoff (if Execute Task selected) |
|
|
830
948
|
|
|
831
949
|
### Brainstorm Dimensions
|
|
832
950
|
|
|
@@ -888,6 +1006,8 @@ Remaining questions or exploration directions
|
|
|
888
1006
|
|-----------|--------|----------|
|
|
889
1007
|
| No codebase detected | Normal flow, pure topic brainstorming | Proceed without exploration-codebase.json |
|
|
890
1008
|
| Codebase search fails | Continue with available context | Note limitation in brainstorm.md |
|
|
1009
|
+
| Web research fails | Continue without external findings | Note in brainstorm.md, rely on inline analysis |
|
|
1010
|
+
| Research conflicts with ideas | Present as competing evidence | Let user decide which direction to pursue |
|
|
891
1011
|
| No good ideas | Reframe problem or adjust constraints | Try new exploration angles |
|
|
892
1012
|
| Perspectives conflict | Present as tradeoff options | Let user select preferred direction |
|
|
893
1013
|
| Max rounds reached (6) | Force synthesis phase | Highlight unresolved questions |
|
|
@@ -437,7 +437,7 @@ REQUIREMENT: ${requirement}" --tool gemini --mode analysis --rule planning-break
|
|
|
437
437
|
waveTasks.forEach(t => console.log(` - [${t.id}] ${t.title}`))
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
-
const answer = request_user_input({
|
|
440
|
+
const answer = functions.request_user_input({
|
|
441
441
|
questions: [{
|
|
442
442
|
header: "验证",
|
|
443
443
|
id: "validation",
|
|
@@ -820,7 +820,7 @@ ${[...new Set(tasks.flatMap(t => (t.files_modified || '').split(';')).filter(Boo
|
|
|
820
820
|
|
|
821
821
|
```javascript
|
|
822
822
|
if (!AUTO_YES && failed.length > 0) {
|
|
823
|
-
const answer = request_user_input({
|
|
823
|
+
const answer = functions.request_user_input({
|
|
824
824
|
questions: [{
|
|
825
825
|
header: "下一步",
|
|
826
826
|
id: "next_step",
|
|
@@ -81,6 +81,20 @@ Utility subagents callable by the investigator agent during analysis phases:
|
|
|
81
81
|
|
|
82
82
|
## Phase Execution
|
|
83
83
|
|
|
84
|
+
### Progress Tracking Initialization
|
|
85
|
+
|
|
86
|
+
Before spawning any agent, initialize progress tracking for all phases:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
functions.update_plan([
|
|
90
|
+
{ id: "phase-1", title: "Phase 1: Root Cause Investigation", status: "in_progress" },
|
|
91
|
+
{ id: "phase-2", title: "Phase 2: Pattern Analysis", status: "pending" },
|
|
92
|
+
{ id: "phase-3", title: "Phase 3: Hypothesis Testing", status: "pending" },
|
|
93
|
+
{ id: "phase-4", title: "Phase 4: Implementation", status: "pending" },
|
|
94
|
+
{ id: "phase-5", title: "Phase 5: Verification & Report", status: "pending" }
|
|
95
|
+
])
|
|
96
|
+
```
|
|
97
|
+
|
|
84
98
|
### Phase 1: Root Cause Investigation
|
|
85
99
|
|
|
86
100
|
**Objective**: Spawn the investigator agent and assign the Phase 1 investigation task. Agent reproduces the bug, collects evidence, and runs initial diagnosis.
|
|
@@ -127,6 +141,8 @@ const p1Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
|
|
|
127
141
|
|----------|-------------|
|
|
128
142
|
| p1Result | Phase 1 completion summary with evidence, reproduction, initial diagnosis |
|
|
129
143
|
|
|
144
|
+
**Progress**: `functions.update_plan([{id: "phase-1", status: "completed"}, {id: "phase-2", status: "in_progress"}])`
|
|
145
|
+
|
|
130
146
|
---
|
|
131
147
|
|
|
132
148
|
### Phase 2: Pattern Analysis
|
|
@@ -169,6 +185,8 @@ const p2Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
|
|
|
169
185
|
|----------|-------------|
|
|
170
186
|
| p2Result | Pattern analysis section: scope classification, similar occurrences, scope justification |
|
|
171
187
|
|
|
188
|
+
**Progress**: `functions.update_plan([{id: "phase-2", status: "completed"}, {id: "phase-3", status: "in_progress"}])`
|
|
189
|
+
|
|
172
190
|
---
|
|
173
191
|
|
|
174
192
|
### Phase 3: Hypothesis Testing
|
|
@@ -218,6 +236,8 @@ const p3Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
|
|
|
218
236
|
|
|
219
237
|
If BLOCKED: close investigator and surface the diagnostic dump to the user. Do not proceed to Phase 4.
|
|
220
238
|
|
|
239
|
+
**Progress (on success)**: `functions.update_plan([{id: "phase-3", status: "completed"}, {id: "phase-4", status: "in_progress"}])`
|
|
240
|
+
|
|
221
241
|
---
|
|
222
242
|
|
|
223
243
|
### Phase 4: Implementation
|
|
@@ -261,6 +281,8 @@ const p4Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
|
|
|
261
281
|
|----------|-------------|
|
|
262
282
|
| p4Result | fix_applied section: files changed, regression test details, reproduction verified |
|
|
263
283
|
|
|
284
|
+
**Progress**: `functions.update_plan([{id: "phase-4", status: "completed"}, {id: "phase-5", status: "in_progress"}])`
|
|
285
|
+
|
|
264
286
|
---
|
|
265
287
|
|
|
266
288
|
### Phase 5: Verification & Report
|
|
@@ -303,6 +325,8 @@ const p5Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
|
|
|
303
325
|
|----------|-------------|
|
|
304
326
|
| p5Result | Completion status, test suite results, path to debug report file |
|
|
305
327
|
|
|
328
|
+
**Progress**: `functions.update_plan([{id: "phase-5", status: "completed"}])`
|
|
329
|
+
|
|
306
330
|
---
|
|
307
331
|
|
|
308
332
|
## Lifecycle Management
|