/ccw-workflow:workflow:brainstorm-with-file [-y|--yes] [-c|--continue] [-m|--mode creative|structured] \"idea or topic\"from ccw-workflow
Interactive brainstorming with multi-CLI collaboration, idea expansion, and documented thought evolution
Ships in ccw-workflow. Installing the plugin adds it to Claude Code.
When --yes or -y: Auto-confirm decisions, use recommended roles, balanced exploration mode.
# Basic usage
/ccw-workflow:workflow:brainstorm-with-file "如何重新设计用户通知系统"
# With options
/ccw-workflow:workflow:brainstorm-with-file --continue "通知系统" # Continue existing
/ccw-workflow:workflow:brainstorm-with-file -y -m creative "创新的AI辅助功能" # Creative auto mode
/ccw-workflow:workflow:brainstorm-with-file -m structured "优化缓存策略" # Goal-oriented mode
Context Source: cli-explore-agent + Multi-CLI perspectives (Gemini/Claude or Professional Roles)
Output Directory: .workflow/.brainstorm/{session-id}/
Core Innovation: Diverge-Converge cycles with documented thought evolution
| Phase | Artifact | Description |
|---|---|---|
| 1 | brainstorm.md | Complete thought evolution timeline (initialized) |
| 1 | Session variables | Dimensions, roles, exploration vectors |
| 2 | exploration-codebase.json | Codebase context from cli-explore-agent |
| 2 | perspectives.json | Multi-CLI perspective findings (creative/pragmatic/systematic) |
| 2 | Updated brainstorm.md | Round 2 multi-perspective exploration |
| 3 | ideas/{idea-slug}.md | Deep-dive analysis for selected ideas |
| 3 | Updated brainstorm.md | Round 3-6 refinement cycles |
| 4 | synthesis.json | Final synthesis with top ideas, recommendations |
| 4 | Final brainstorm.md | Complete thought evolution with conclusions |
| 4.5 | brainstorm-dashboard.html | Interactive visualization of synthesis results |
.workflow/.brainstorm/BS-{date}-{slug}/
├── brainstorm.md # ⭐ Complete thought evolution timeline
├── exploration-codebase.json # Phase 2: Codebase context
├── perspectives.json # Phase 2: Multi-CLI findings
├── synthesis.json # Phase 4: Final synthesis
├── brainstorm-dashboard.html # Phase 4.5: Interactive visualization
└── ideas/ # Phase 3: Individual idea deep-dives
├── idea-1.md
├── idea-2.md
└── merged-idea-1.md
┌─────────────────────────────────────────────────────────────────────────┐
│ INTERACTIVE BRAINSTORMING WORKFLOW │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ Phase 1: Seed Understanding │
│ ├─ Parse initial idea/topic │
│ ├─ Identify dimensions (technical, UX, business, etc.) │
│ ├─ Select roles (professional or simple perspectives) │
│ ├─ Initial scoping questions │
│ ├─ Expand into exploration vectors │
│ └─ Initialize brainstorm.md │
│ │
│ Phase 2: Divergent Exploration │
│ ├─ cli-explore-agent: Codebase context (FIRST) │
│ ├─ Multi-CLI Perspectives (AFTER exploration) │
│ │ ├─ Creative (Gemini): Innovation, cross-domain │
│ │ ├─ Pragmatic (Claude): Implementation, feasibility │
│ │ └─ Systematic (Agent): Architecture, structure │
│ └─ Aggregate diverse viewpoints │
│ │
│ Phase 3: Interactive Refinement (Multi-Round) │
│ ├─ Present multi-perspective findings │
│ ├─ User selects promising directions │
│ ├─ Actions: Deep dive | Generate more | Challenge | Merge │
│ ├─ Update brainstorm.md with evolution │
│ └─ Repeat diverge-converge cycles (max 6 rounds) │
│ │
│ Phase 4: Convergence & Crystallization │
│ ├─ Synthesize best ideas │
│ ├─ Resolve conflicts between perspectives │
│ ├─ Generate actionable conclusions │
│ ├─ Offer next steps (plan/issue/analyze/export) │
│ └─ Final brainstorm.md update │
│ │
└─────────────────────────────────────────────────────────────────────────┘
Extract idea/topic from $ARGUMENTS
Generate session ID: BS-{date}-{slug} (date: YYYY-MM-DD UTC+8; slug: lowercase, alphanumeric + Chinese, max 40 chars)
Define session folder: .workflow/.brainstorm/{session-id}
Parse command options:
-c or --continue for session continuation-m or --mode for brainstorm mode (creative/structured/balanced)-y or --yes for auto-approval modeAuto-detect mode: If session folder + brainstorm.md exist → continue mode
Create directory structure: {session-folder}/ideas/
Create Progress Tracking (TodoWrite — MANDATORY):
TodoWrite([
{ id: "phase-1", title: "Phase 1: Seed Understanding", status: "in_progress" },
{ id: "phase-2", title: "Phase 2: Divergent Exploration", status: "pending" },
{ id: "phase-3", title: "Phase 3: Interactive Refinement", status: "pending" },
{ id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "pending" },
{ id: "next-step", title: "GATE: Post-Completion Next Step", status: "pending" }
])
"in_progress" when entering each phase, "completed" when donenext-step is a terminal gate — workflow is NOT complete until this todo is "completed"Session Variables: sessionId, sessionFolder, brainstormMode (creative|structured|balanced), autoMode (boolean), mode (new|continue)
Parse Seed & Identify Dimensions
Role Selection
Initial Scoping Questions (if new session + not auto mode)
Expand Seed into Exploration Vectors
Bash({
command: `ccw cli -p "
Given the initial idea: '${idea_or_topic}'
User focus areas: ${userFocusAreas.join(', ')}
Constraints: ${constraints.join(', ')}
Generate 5-7 exploration vectors (questions/directions) to expand this idea:
1. Core question: What is the fundamental problem/opportunity?
2. User perspective: Who benefits and how?
3. Technical angle: What enables this technically?
4. Alternative approaches: What other ways could this be solved?
5. Challenges: What could go wrong or block success?
6. Innovation angle: What would make this 10x better?
7. Integration: How does this fit with existing systems/processes?
Output as structured exploration vectors for multi-perspective analysis.
" --tool gemini --mode analysis --model gemini-2.5-flash`,
run_in_background: false
})
## Artifact Index section with relative links ([name](./file)) to all planned artifacts (exploration-codebase.json, perspectives.json, synthesis.json, ideas/). Update this section as each artifact is created.TodoWrite: Update phase-1 → "completed", phase-2 → "in_progress"
Agent({
subagent_type: "ccw-workflow:cli-explore-agent",
run_in_background: false,
description: `Explore codebase for brainstorm: ${topicSlug}`,
prompt: `
## Brainstorm Context
Topic: ${idea_or_topic}
Dimensions: ${dimensions.join(', ')}
Mode: ${brainstormMode}
Session: ${sessionFolder}
## MANDATORY FIRST STEPS
1. Run: ccw tool exec get_modules_by_depth '{}'
2. Search for code related to topic keywords
3. Read: .workflow/project-tech.json (if exists)
## Exploration Focus
- Identify existing implementations related to the topic
- Find patterns that could inspire solutions
- Map current architecture constraints
- Locate integration points
## Output
Write findings to: ${sessionFolder}/exploration-codebase.json
Schema:
{
"relevant_files": [{"path": "...", "relevance": "high|medium|low", "rationale": "..."}],
"existing_patterns": [],
"architecture_constraints": [],
"integration_points": [],
"inspiration_sources": [],
"_metadata": { "exploration_type": "brainstorm-codebase", "timestamp": "..." }
}
`
})
Build shared context from exploration results:
const explorationContext = `
PRIOR EXPLORATION CONTEXT (from cli-explore-agent):
- Key files: ${explorationResults.relevant_files.slice(0,5).map(f => f.path).join(', ')}
- Existing patterns: ${explorationResults.existing_patterns.slice(0,3).join(', ')}
- Architecture constraints: ${explorationResults.architecture_constraints.slice(0,3).join(', ')}
- Integration points: ${explorationResults.integration_points.slice(0,3).join(', ')}`
Launch 3 parallel CLI calls (run_in_background: true each), one per perspective:
| Perspective | Tool | PURPOSE | Key TASK bullets | EXPECTED | CONSTRAINTS |
|---|---|---|---|---|---|
| Creative | Gemini CLI | Generate innovative ideas | Challenge assumptions, cross-domain inspiration, moonshot + practical ideas | 5+ creative ideas with novelty/impact ratings | structured mode: keep feasible |
| Pragmatic | Claude CLI | Implementation reality | Evaluate feasibility, estimate complexity, identify blockers, incremental approach | 3-5 practical approaches with effort/risk ratings | Current tech stack |
| Systematic | cli-explore-agent | Architectural thinking | Decompose problems, identify patterns, map dependencies, scalability | Problem decomposition, 2-3 approaches with tradeoffs | Existing architecture |
Launch Creative + Pragmatic as parallel CLI calls, Systematic as Agent:
// Creative perspective (Gemini CLI, run_in_background: true)
Bash({
command: `ccw cli -p "
PURPOSE: Creative brainstorming for '${idea_or_topic}' - Generate innovative ideas
Success: 5+ creative ideas with novelty/impact ratings
${explorationContext}
TASK:
• Challenge assumptions and find cross-domain inspiration
• Generate moonshot + practical ideas
• Rate each idea on novelty and impact
MODE: analysis
CONTEXT: @**/* | Topic: ${idea_or_topic}
EXPECTED: 5+ creative ideas with novelty/impact ratings
CONSTRAINTS: ${brainstormMode === 'structured' ? 'Keep feasible' : 'Think big'}
" --tool gemini --mode analysis`,
run_in_background: true
})
// Pragmatic perspective (Claude CLI, run_in_background: true)
Bash({
command: `ccw cli -p "
PURPOSE: Pragmatic brainstorming for '${idea_or_topic}' - Implementation reality check
Success: 3-5 practical approaches with effort/risk ratings
${explorationContext}
TASK:
• Evaluate feasibility of explored concepts
• Estimate complexity and identify blockers
• Suggest incremental approach
MODE: analysis
CONTEXT: @**/* | Topic: ${idea_or_topic}
EXPECTED: 3-5 practical approaches with effort/risk ratings
CONSTRAINTS: Current tech stack
" --tool claude --mode analysis`,
run_in_background: true
})
// Systematic perspective (cli-explore-agent, run_in_background: false)
Agent({
subagent_type: "ccw-workflow:cli-explore-agent",
run_in_background: false,
description: `Systematic brainstorm: ${topicSlug}`,
prompt: `
## Brainstorm Context
Topic: ${idea_or_topic}
Dimensions: ${dimensions.join(', ')}
Session: ${sessionFolder}
## Prior Exploration Context
${explorationContext}
## Systematic Analysis Focus
- Decompose the problem into architectural components
- Identify patterns and anti-patterns in existing code
- Map dependencies and integration points
- Evaluate scalability of proposed approaches
- Generate 2-3 architectural approaches with tradeoffs
## Output
Return structured analysis with: problem_decomposition, approaches[] (each with description, pros, cons, complexity), dependency_map, scalability_assessment
`
})
// ⚠️ STOP POINT: Wait for all CLI hook callbacks + agent result before continuing
Aggregate Multi-Perspective Findings
Update brainstorm.md with Round 2 multi-perspective exploration and synthesis
Guideline: Delegate complex tasks to agents (cli-explore-agent, code-developer, universal-executor) or CLI calls. Avoid direct analysis/execution in main process.
Present Current State: Extract top ideas from perspectives.json with title, source, description, novelty/feasibility ratings
Gather User Direction (AskUserQuestion)
Execute User-Selected Action
| Action | Tool | Output | Key Tasks |
|---|---|---|---|
| Deep Dive | Gemini CLI | ideas/{slug}.md | Elaborate concept, requirements, challenges, POC approach, metrics, dependencies |
| Generate More | Selected CLI | Updated perspectives.json | New angles from unexplored vectors |
| Challenge | Claude CLI | Challenge results | 3 objections per idea, challenge assumptions, failure scenarios, survivability (1-5) |
| Merge | Gemini CLI | ideas/merged-{slug}.md | Complementary elements, resolve contradictions, unified concept |
Deep Dive CLI Call:
Bash({
command: `ccw cli -p "
PURPOSE: Deep dive analysis on idea '${idea.title}'
Success: Comprehensive understanding with actionable next steps
TASK:
• Elaborate the core concept in detail
• Identify implementation requirements
• List potential challenges and mitigations
• Suggest proof-of-concept approach
• Define success metrics
• Map related/dependent features
MODE: analysis
CONTEXT: @**/*
Original idea: ${idea.description}
Source perspective: ${idea.source}
EXPECTED: Detailed concept, technical requirements, risk matrix, MVP definition, success criteria, recommendation (pursue/pivot/park)
CONSTRAINTS: Focus on actionability
" --tool gemini --mode analysis`,
run_in_background: false
})
Devil's Advocate CLI Call:
Bash({
command: `ccw cli -p "
PURPOSE: Devil's advocate - rigorously challenge these brainstorm ideas
Success: Uncover hidden weaknesses and strengthen viable ideas
IDEAS TO CHALLENGE:
${ideas.map((idea, i) => `${i+1}. ${idea.title}: ${idea.brief}`).join('\n')}
TASK:
• For each idea, identify 3 strongest objections
• Challenge core assumptions
• Identify scenarios where this fails
• Consider competitive/alternative solutions
• Rate survivability after challenge (1-5)
MODE: analysis
EXPECTED: Per-idea challenge report, critical weaknesses, survivability ratings, modified/strengthened versions
CONSTRAINTS: Be genuinely critical, not just contrarian
" --tool claude --mode analysis`,
run_in_background: false
})
Merge Ideas CLI Call:
Bash({
command: `ccw cli -p "
PURPOSE: Synthesize multiple ideas into unified concept
Success: Coherent merged idea that captures best elements
IDEAS TO MERGE:
${selectedIdeas.map((idea, i) => `
${i+1}. ${idea.title} (${idea.source})
${idea.description}
Strengths: ${idea.strengths.join(', ')}
`).join('\n')}
TASK:
• Identify complementary elements
• Resolve contradictions
• Create unified concept preserving key strengths
• Assess viability of merged idea
MODE: analysis
EXPECTED: Merged concept, elements from each source, contradictions resolved, implementation considerations
CONSTRAINTS: Don't force incompatible ideas together
" --tool gemini --mode analysis`,
run_in_background: false
})
TodoWrite: Update phase-2 → "completed" (after first round enters Phase 3), phase-3 → "in_progress"
TodoWrite (on exit loop): Update phase-3 → "completed", phase-4 → "in_progress"
synthesis.json Schema: session_id, topic, completed (timestamp), total_rounds, top_ideas[], parked_ideas[], key_insights[], recommendations (primary/alternatives/not_recommended), follow_up[]
## Artifact Index with relative links to all produced files (exploration-codebase.json, perspectives.json, synthesis.json, each ideas/*.md)Trigger: synthesis.json exists, top_ideas.length >= 2, not --yes mode.
Generate a self-contained brainstorm-dashboard.html in the session folder:
const synthesis = JSON.parse(Read(`${sessionFolder}/synthesis.json`))
if (synthesis.top_ideas?.length >= 2 && !autoYes) {
// Generate brainstorm-dashboard.html with:
// 1. Idea Cards Grid — each idea as a card with:
// - Title, description, source_perspective badge
// - Score / Novelty / Feasibility rating bars
// - Strengths list, challenges list
// 2. Perspective Comparison — 3-column layout:
// - Creative (Gemini) | Pragmatic (Claude) | Systematic (Agent)
// - Ideas grouped by source perspective
// 3. Evolution Timeline — round-by-round progression:
// - Each round as a timeline node
// - Ideas introduced, merged, parked per round
// 4. Key Insights — callout cards with icons
// 5. Recommendations — primary highlighted, alternatives listed
// Design tokens (self-contained, dark theme):
const tokens = {
'--bg-primary': '#0d1117',
'--bg-card': '#161b22',
'--border': '#30363d',
'--text-primary': '#c9d1d9',
'--text-secondary': '#7d8590',
'--color-green': '#3fb950',
'--color-blue': '#58a6ff',
'--color-purple': '#d2a8ff',
'--color-yellow': '#d29922',
'--color-red': '#f85149',
'--font-sans': 'system-ui, -apple-system, sans-serif',
'--font-mono': 'ui-monospace, monospace'
}
Write(`${sessionFolder}/brainstorm-dashboard.html`, generateDashboardHTML(synthesis, tokens))
// Inform user
Tell user: "Brainstorm dashboard generated. Open in browser to review:"
Tell user: ` → ${sessionFolder}/brainstorm-dashboard.html`
}
HTML Requirements:
Skip: If only 1 top idea or --yes mode, skip dashboard generation.
MANDATORY GATE: Next Step Selection — workflow MUST NOT end without executing this step.
TodoWrite: Update phase-4 → "completed", next-step → "in_progress"
CRITICAL: This AskUserQuestion is a terminal gate. The workflow is INCOMPLETE if this question is not asked. After displaying synthesis (step 2), you MUST immediately proceed here.
Call AskUserQuestion (single-select, header: "Next Step"):
Handle user selection:
"创建实施计划" → Build structured handoff & invoke lite-plan:
Step A: Build Implementation Scope from synthesis.json top ideas:
const synthesis = JSON.parse(Read(`${sessionFolder}/synthesis.json`))
const topIdeas = synthesis.top_ideas.filter(i => i.score >= 6).slice(0, 5)
const implScope = topIdeas.map(idea => ({
objective: idea.title,
rationale: idea.description,
priority: idea.score >= 8 ? 'high' : 'medium',
target_files: [], // brainstorm has no specific file targets — lite-plan will explore
acceptance_criteria: idea.next_steps || [],
change_summary: idea.strengths?.join('; ') || idea.description
}))
Step B: Build Structured Handoff & Invoke Skill:
const handoff = {
source: 'brainstorm-with-file',
session_id: sessionId,
session_folder: sessionFolder,
summary: synthesis.recommendations?.primary || synthesis.topic,
implementation_scope: implScope,
code_anchors: [], // brainstorm has no code anchors — lite-plan will explore
key_files: [],
key_findings: synthesis.key_insights?.slice(0, 5) || [],
decision_context: []
}
const handoffBlock = `## Prior Brainstorm (${sessionId})
```json:handoff-spec ${JSON.stringify(handoff, null, 2)} ```
${synthesis.recommendations?.primary || synthesis.topic}
${implScope.map((item, i) => `${i+1}. ${item.objective} [${item.priority}]
).join('\n')}Skill({ skill: "workflow-lite-plan", args: handoffBlock })
If Skill invocation is omitted, the workflow is BROKEN.
4. After Skill invocation, brainstorm-with-file is complete
**"产出Issue"** → Convert top ideas to issues:
1. For each idea in synthesis.top_ideas (top 3):
- Build issue JSON: `{title: idea.title, context: idea.description + '\n' + idea.next_steps.join('\n'), priority: idea.score >= 8 ? 2 : 3, source: 'brainstorm', labels: dimensions}`
- Create via: `Skill({ skill: "issue:from-brainstorm", args: "${sessionFolder}/synthesis.json" })`
2. Display created issue IDs
**"深入分析"** → Launch analysis on top idea:
1. Build analysis topic from top idea title + description
2. **Invoke Skill tool immediately**:
```javascript
Skill({ skill: "workflow:analyze-with-file", args: `${topIdea.title}: ${topIdea.description}` })
```
**"完成"** → No further action needed.
**TodoWrite**: Update `next-step` → `"completed"` after user selection is handled
## Configuration
### Brainstorm Dimensions
| Dimension | Keywords |
|-----------|----------|
| technical | 技术, technical, implementation, code, 实现, architecture |
| ux | 用户, user, experience, UX, UI, 体验, interaction |
| business | 业务, business, value, ROI, 价值, market |
| innovation | 创新, innovation, novel, creative, 新颖 |
| feasibility | 可行, feasible, practical, realistic, 实际 |
| scalability | 扩展, scale, growth, performance, 性能 |
| security | 安全, security, risk, protection, 风险 |
### Role Selection
**Professional Roles**:
| Role | CLI Tool | Focus Area | Keywords |
|------|----------|------------|----------|
| system-architect | Claude | Architecture, patterns | 架构, architecture, system, 系统, design pattern |
| product-manager | Gemini | Business value, roadmap | 产品, product, feature, 功能, roadmap |
| ui-designer | Gemini | Visual design, interaction | UI, 界面, interface, visual, 视觉 |
| ux-expert | Claude | User research, usability | UX, 体验, experience, user, 用户 |
| data-architect | Claude | Data modeling, storage | 数据, data, database, 存储, storage |
| test-strategist | Gemini | Quality, testing | 测试, test, quality, 质量, QA |
| subject-matter-expert | Gemini | Domain knowledge | 领域, domain, industry, 行业, expert |
| product-owner | Claude | Priority, scope | 优先, priority, scope, 范围, backlog |
| scrum-master | Gemini | Process, collaboration | 敏捷, agile, scrum, sprint, 迭代 |
**Simple Perspectives** (fallback):
| Perspective | CLI Tool | Focus |
|-------------|----------|-------|
| creative | Gemini | Innovation, cross-domain |
| pragmatic | Claude | Implementation, feasibility |
| systematic | cli-explore-agent | Architecture, structure |
**Selection Strategy**: Auto mode → top 3 professional roles | Manual mode → recommended roles + "Use simple perspectives" option | Continue mode → roles from previous session
## Error Handling
| Error | Resolution |
|-------|------------|
| cli-explore-agent fails | Continue with empty exploration context |
| CLI timeout | Retry with shorter prompt, or skip perspective |
| No good ideas | Reframe problem, adjust constraints, try new angles |
| User disengaged | Summarize progress, offer break point with resume |
| Perspectives conflict | Present as tradeoff, let user decide |
| Max rounds reached | Force synthesis, highlight unresolved questions |
| All ideas fail challenge | Return to divergent phase with new constraints |
---
**Now execute brainstorm-with-file for**: $ARGUMENTS
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
38 commands in this plugin
/ccwMain workflow orchestrator - analyze intent, select workflow, execute command chain in main process/ccw-coordinatorCommand orchestration tool - analyze requirements, recommend chain, execute sequentially with state persistence/issue:convert-to-planconvert-to-planConvert planning artifacts (lite-plan, workflow session, markdown) to issue solutions/issue:issue:discoverissue:discoverDiscover potential issues from multiple perspectives (bug, UX, test, quality, security, performance, maintainability, best-practices) using CLI explore. Supports Exa external research for security and best-practices perspectives./issue:issue:discover-by-promptissue:discover-by-promptDiscover 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)./issue:executeexecuteExecute queue with DAG-based parallel orchestration (one commit per solution)npx claudepluginhub nx1-org/platformnex-abilities --plugin ccw-workflow2 plugins ship this exact command · first indexed Nov 17, 2026