brainstorm-with-file について
brainstorm-with-fileは、セッション文書にアイデアの変遷を記録するCodexのブレインストーミングワークフローです。複数の視点での探索、任意のウェブ調査、推敲、構造化された引き継ぎを支援します。
主な機能
- 01brainstorm.mdへのアイデア変遷の記録
- 02創造的・実践的・体系的な視点
- 03任意のウェブ調査
- 04反復的なアイデアの推敲と統合
- 05セッション継続と自動確認オプション
活用シーン
- 01製品や技術のアイデアを複数の視点から検討
- 02記録済みのブレインストーミングを継続・推敲
- 03テーマに関するパターンや着想の調査
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ catlog22/ claude-code-workflow --skill brainstorm-with-fileインストール後、Claude Code で/brainstorm-with-fileを入力して読み込まれたか確認します。
詳細
Codex Brainstorm-With-File プロンプト
概要
思考の進化を記録する対話型ブレインストーミングワークフローです。質問、複数の視点によるインライン分析、外部調査、反復的なブラッシュアップを通じて、最初のアイデアを発展させます。
コアワークフロー:シードアイデア → 展開 → 複数の視点で検討 → 調査 → ブラッシュアップ → 結晶化 → 次のステップ
主な機能:
- brainstorm.md:思考の進化をすべて記録したタイムライン
- 複数の視点による分析:創造的+実用的+体系的(順番にインラインで実施)
- 外部調査:
web.runによる、発想、パターン、ベストプラクティスのウェブ検索 - アイデアの展開:段階的な質問と検討
- 発散と収束のサイクル:選択肢を生成してから、有望な道筋に焦点を当てる
- 進捗の追跡:
functions.update_planによる、リアルタイムのフェーズ進捗の可視化 - 構造化された引き継ぎ:実行計画、課題の作成、または完了に向けた最終ゲート
自動モード
--yes または -y の場合:検討に関する決定を自動で確定し、推奨される視点を使用し、対話形式のスコープ設定を省略します。
クイックスタート
# Basic usage
/codex:brainstorm-with-file TOPIC="How to improve developer onboarding experience"
# With perspective selection
/codex:brainstorm-with-file TOPIC="New caching strategy" --perspectives=creative,pragmatic,systematic
# Continue existing session
/codex:brainstorm-with-file TOPIC="caching strategy" --continue
# Auto mode (skip confirmations)
/codex:brainstorm-with-file -y TOPIC="Plugin architecture ideas"
対象トピック
$TOPIC
設定
| フラグ | デフォルト | 説明 |
|---|---|---|
-y, --yes | false | すべての決定を自動で確定します |
--continue | false | 既存のセッションを続行します |
--perspectives | creative,pragmatic,systematic | カンマ区切りの視点リスト |
--max-ideas | 15 | 追跡するアイデアの最大数 |
セッション ID の形式:BS-{YYYY-MM-DD}-{slug}
- slug:小文字の英数字+CJK 文字、最大 40 文字
- date:YYYY-MM-DD(UTC+8)
- 続行モードの自動検出:セッションフォルダーと brainstorm.md が存在する場合 → 続行モード
ブレインストーミングの流れ
Step 0: Session Setup
├─ Parse topic, flags (--perspectives, --continue, -y)
├─ Generate session ID: BS-{date}-{slug}
├─ Create session folder (or detect existing → continue mode)
└─ functions.update_plan (5 phases: Seed → Explore → Refine → Converge → GATE)
Step 1: Seed Understanding
├─ Parse topic, identify brainstorm dimensions
├─ Role/perspective selection with user (or auto)
├─ Initial scoping via functions.request_user_input (mode, focus, constraints)
├─ Expand seed into exploration vectors
└─ Initialize brainstorm.md
Step 2: Divergent Exploration (Inline, No Agents)
├─ Detect codebase → search relevant modules, patterns
│ ├─ Run `ccw spec load --category exploration` (if spec system available)
│ └─ Use Grep, Glob, Read, mcp__ace-tool__search_context
├─ Multi-perspective analysis (serial, inline)
│ ├─ Creative perspective: innovation, cross-domain, challenge assumptions
│ ├─ Pragmatic perspective: feasibility, effort, blockers
│ └─ Systematic perspective: decomposition, patterns, scalability
├─ External research via web.run (optional — patterns, best practices, inspiration)
├─ Aggregate findings → perspectives.json + research.json
├─ Update brainstorm.md with Round 1
└─ Initial Idea Coverage Check
Step 3: Interactive Refinement (Multi-Round, max 6)
├─ Present current ideas and perspectives (Cumulative Context)
├─ Record findings to brainstorm.md BEFORE updating Current Ideas
├─ Gather user feedback via functions.request_user_input
├─ Process response:
│ ├─ Deep Dive → deeper inline analysis on selected ideas
│ ├─ Diverge → new inline analysis with different angles
│ ├─ Challenge → devil's advocate inline analysis
│ ├─ Merge → synthesize complementary ideas inline
│ ├─ 外部研究 → web.run for external inspiration/validation
│ └─ Converge → exit loop for synthesis
├─ Update brainstorm.md with round details
└─ Repeat until user selects converge or max rounds
Step 4: Convergence & Crystallization
├─ Consolidate all insights → synthesis.json
├─ Update brainstorm.md with final synthesis
├─ Batch top-idea review via functions.request_user_input
└─ MANDATORY Terminal Gate: 执行任务 / 产出Issue / 完成
├─ Execute Task → handoff-spec.json with implementation scope
├─ Create Issue → display issue creation command
└─ Done → end workflow
出力アーティファクト
フェーズ 1:シードの理解
| アーティファクト | 目的 |
|---|---|
brainstorm.md | セッションメタデータ、シードの展開、検討の方向性を記録して初期化します |
| セッション変数 | トピックの slug、ブレインストーミングモード、次元、検討の方向性 |
フェーズ 2:発散的な検討
| アーティファクト | 目的 |
|---|---|
exploration-codebase.json | コードベースのコンテキスト:関連ファイル、パターン、アーキテクチャ上の制約 |
perspectives/*.json | 各視点からの出力(創造的、実用的、体系的) |
perspectives.json | 統合結果(収束するテーマと対立するテーマを含む) |
更新された brainstorm.md | ラウンド 1:検討結果と複数の視点による分析 |
フェーズ 3:対話形式のブラッシュアップ
| アーティファクト | 目的 |
|---|---|
ideas/{idea-slug}.md | 選択したアイデアの詳細分析 |
ideas/merged-idea-{n}.md | 統合したアイデアのドキュメント |
更新された brainstorm.md | ラウンド 2~6:ユーザーからのフィードバック、アイデアの選択、ブラッシュアップのサイクル |
フェーズ 4:収束と結晶化
| アーティファクト | 目的 |
|---|---|
synthesis.json | 最終的な統合結果:主要なアイデア、推奨事項、洞察 |
最終版 brainstorm.md | 結論を含む、思考の進化の完全な記録 |
記録プロトコル
重要:ブレインストーミング中に以下の状況が発生した場合、直ちに brainstorm.md に記録しなければなりません。
| トリガー | 記録する内容 | 対象セクション |
|---|---|---|
| アイデアの生成 | アイデアの内容、発想元の視点、新規性/実現可能性の評価 | #### Ideas Generated |
| 視点の変更 | 以前の捉え方 → 新しい捉え方、変更のきっかけとなった理由 | #### Decision Log |
| ユーザーからのフィードバック | ユーザーの元の入力、選択/却下されたアイデア | #### User Input |
| 前提への異議 | 元の前提 → 異議を踏まえた結果、前提が維持されるか | #### Challenged Assumptions |
| アイデアの統合 | 元となったアイデア、統合したコンセプト、残したもの/除外したもの | #### Decision Log |
| スコープの調整 | 調整前/調整後のスコープ、変更のきっかけとなった理由 | #### Decision Log |
決定記録の形式
> **Decision**: [Description of the decision]
> - **Context**: [What triggered this decision]
> - **Options considered**: [Alternatives evaluated]
> - **Chosen**: [Selected approach] — **Reason**: [Rationale]
> - **Rejected**: [Why other options were discarded]
> - **Impact**: [Effect on brainstorming direction]
ナラティブ統合の形式
各ラウンドの更新後に追記します。
### Round N: Narrative Synthesis
**Starting point**: Based on previous round's [conclusions/questions], this round explored [starting point].
**Key progress**: [New ideas/findings] [confirmed/refuted/expanded] previous understanding of [topic area].
**Decision impact**: User selected [feedback type], directing brainstorming toward [adjusted/deepened/maintained].
**Current state**: After this round, top ideas are [updated idea rankings].
**Open directions**: [remaining exploration angles for next round]
実装の詳細
Phase 0: セッションの初期化
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
// Parse flags
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
const continueMode = $ARGUMENTS.includes('--continue')
const perspectivesMatch = $ARGUMENTS.match(/--perspectives[=\s]([\w,]+)/)
const selectedPerspectiveNames = perspectivesMatch
? perspectivesMatch[1].split(',')
: ['creative', 'pragmatic', 'systematic']
// Extract topic
const topic = $ARGUMENTS.replace(/--yes|-y|--continue|--perspectives[=\s][\w,]+|--max-ideas[=\s]\d+|TOPIC=/g, '').replace(/^["']|["']$/g, '').trim()
// Determine project root
const projectRoot = functions.exec_command('git rev-parse --show-toplevel 2>/dev/null || pwd').trim()
const slug = topic.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-').substring(0, 40)
const dateStr = getUtc8ISOString().substring(0, 10)
const sessionId = `BS-${dateStr}-${slug}`
const sessionFolder = `${projectRoot}/.workflow/.brainstorm/${sessionId}`
// Auto-detect continue: session folder + brainstorm.md exists → continue mode
// If continue → load brainstorm.md + perspectives, resume from last round
functions.exec_command(`mkdir -p ${sessionFolder}`)
// Initialize progress tracking (MANDATORY)
functions.update_plan([
{ 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" }
])
Phase 1: アイデアの把握
目的:最初のアイデアを解析し、探索の方向性とスコープの希望を特定して、ブレインストーミング文書を初期化します。
Step 1.1: アイデアの解析と次元の特定
トピックのキーワードをブレインストーミングの次元と照合します(次元のリファレンスを参照)。
// Match topic text against keyword lists from Dimensions Reference
// If multiple dimensions match, include all
// If none match, default to "technical" and "innovation"
const dimensions = identifyDimensions(topic, BRAINSTORM_DIMENSIONS)
Step 1.2: 役割の選択
トピックのキーワードに基づいて役割を推奨し、ユーザーに確認または変更してもらいます。
専門職の役割(トピックのキーワードに基づく推奨):
| 役割 | 視点の焦点 | キーワード |
|---|---|---|
| system-architect | アーキテクチャ、パターン | 架构, architecture, system, 系统, design pattern |
| product-manager | ビジネス価値、ロードマップ | 产品, product, feature, 功能, roadmap |
| ui-designer | ビジュアルデザイン、インタラクション | UI, 界面, interface, visual, 视觉 |
| ux-expert | ユーザー調査、ユーザビリティ | UX, 体验, experience, user, 用户 |
| data-architect | データモデリング、ストレージ | 数据, data, database, 存储, storage |
| test-strategist | 品質、テスト | 测试, test, quality, 质量, QA |
| subject-matter-expert | ドメイン知識 | 领域, domain, industry, 行业, expert |
シンプルな視点(代替手段 — 常に利用可能):
| 視点 | 焦点 | 最適な用途 |
|---|---|---|
| creative | イノベーション、分野横断 | 新しいアイデアの創出 |
| pragmatic | 実装、実現可能性 | アイデアの現実性の確認 |
| systematic | アーキテクチャ、構造 | ソリューションの整理 |
選択方法:
- 自動モード:キーワードの照合に基づいて、推奨される専門職の役割を上位3つ選択します
- 手動モード:推奨される役割と「シンプルな視点を使用」オプションを提示します
- 続行モード:前回のセッションで使用した役割を使用します
Step 1.3: 初期スコープの設定(新規セッションのみ)
新しいブレインストーミングセッションでは、探索の前にユーザーの希望を確認します(自動モードまたは続行モードではスキップ)。
if (!autoYes && !continueMode) {
// Single batch: Mode + Focus + Constraints (max 4 questions per call)
const scoping = functions.request_user_input({
questions: [
{
header: "Mode", // max 12 chars
question: "Select brainstorming intensity:",
multiSelect: false,
options: [
{ label: "Balanced (Recommended)", description: "Moderate, 3 perspectives" },
{ label: "Creative", description: "Fast, high novelty, 1 perspective" },
{ label: "Deep", description: "Comprehensive, 3 perspectives + deep refinement" }
]
},
{
header: "Focus",
question: "Select brainstorming focus areas:",
multiSelect: true,
options: generateFocusOptions(dimensions) // Dynamic based on dimensions
},
{
header: "Constraints",
question: "Any constraints to consider?",
multiSelect: true,
options: [
{ label: "Existing Arch", description: "Must fit current system" },
{ label: "Time Limited", description: "Short implementation timeline" },
{ label: "Resource Limited", description: "Limited team/budget" },
{ label: "No Constraints", description: "Blue-sky thinking" }
]
}
]
})
}
Step 1.4: アイデアを探索の方向性に展開
ブレインストーミングの探索を導く重要な質問を作成します。インラインで実施し、エージェントには委任しません。
探索の方向性:
- 核心となる問い:根本的な問題や機会は何ですか?
- ユーザーの視点:誰がどのような恩恵を受けますか?
- 技術的な観点:技術的に何がこれを可能にしますか?
- 代替アプローチ:ほかにどのような解決方法がありますか?
- 課題:何が問題を引き起こしたり、成功を妨げたりする可能性がありますか?
- イノベーションの観点:これを10倍優れたものにするには何が必要ですか?
- 統合:既存のシステムやプロセスにどのように適合しますか?
ユーザーの重点領域と制約に照らしてトピックをインラインで分析し、5~7個の探索の方向性を作成します。
Step 1.5: brainstorm.md の初期化
const brainstormMd = `# Brainstorm Session
**Session ID**: ${sessionId}
**Topic**: ${topic}
**Started**: ${getUtc8ISOString()}
**Dimensions**: ${dimensions.join(', ')}
**Mode**: ${brainstormMode}
## Table of Contents
- [Session Context](#session-context)
- [Current Ideas](#current-ideas)
- [Thought Evolution Timeline](#thought-evolution-timeline)
## Current Ideas
> To be populated after exploration.
## Session Context
- Focus areas: ${focusAreas.join(', ')}
- Perspectives: ${selectedPerspectiveNames.join(', ')}
- Constraints: ${constraints.join(', ')}
- Mode: ${brainstormMode}
## Exploration Vectors
${explorationVectors.map((v, i) => `${i+1}. ${v}`).join('\n')}
## Initial Decisions
> Record why these perspectives and focus areas were selected.
---
## Thought Evolution Timeline
> Rounds will be appended below as brainstorming progresses.
---
## Decision Trail
> Consolidated critical decisions across all rounds (populated in Phase 4).
`
Write(`${sessionFolder}/brainstorm.md`, brainstormMd)
成功基準:
- セッションフォルダーが作成され、brainstorm.md が初期化されている
- ブレインストーミングの次元が特定され、ユーザーの希望が記録されている
- 初期判断が記録されている:視点を選択した理由、および除外した選択肢とその理由
- 探索の方向性が作成されている
- 1~3個の視点が選択されている
Phase 2: 発散的な探索
目的:コードベースのコンテキストを収集し、複数の視点から分析して、多様な見解を導き出します。探索はすべてインラインで実施し、エージェントには委任しません。
Step 2.1: コードベースの検出と探索
const hasCodebase = functions.exec_command(`
test -f package.json && echo "nodejs" ||
test -f go.mod && echo "golang" ||
test -f Cargo.toml && echo "rust" ||
test -f pyproject.toml && echo "python" ||
test -f pom.xml && echo "java" ||
test -d src && echo "generic" ||
echo "none"
`).trim()
if (hasCodebase !== 'none') {
// 1. Read project metadata (if exists)
// - Run `ccw spec load --category exploration` (load project specs)
// - Run `ccw spec load --category debug` (known issues and root-cause notes)
// - .workflow/specs/*.md (project conventions)
// 2. Search codebase for relevant content
// Use: Grep, Glob, Read, or mcp__ace-tool__search_context
// Focus on: modules/components, patterns/structure, integration points, config/dependencies
// 3. Write findings
Write(`${sessionFolder}/exploration-codebase.json`, JSON.stringify({
project_type: hasCodebase,
relevant_files: [...], // [{path, relevance, summary}]
existing_patterns: [...], // [{pattern, files, description}]
architecture_constraints: [...], // Constraints found
integration_points: [...], // [{location, description}]
key_findings: [...], // Main insights from code search
_metadata: { timestamp: getUtc8ISOString(), exploration_scope: '...' }
}, null, 2))
}
Step 2.2: 複数の視点からの分析(順次、インライン)
選択した各視点から分析します。分析はすべて AI がインラインで実施し、エージェントは使用しません。
視点の定義:
| 視点 | 焦点 | タスク |
|---|---|---|
| Creative | イノベーション、分野横断 | 既成概念にとらわれず、分野横断的な発想のヒントを探り、前提に疑問を投げかけ、大胆なアイデアを生み出します |
| Pragmatic | 実装の現実性 | 実現可能性を評価し、既存のパターンやライブラリを特定し、複雑さを見積もり、障害となる要因を明らかにします |
| Systematic | アーキテクチャ思考 | 問題を分解し、アーキテクチャパターンを特定し、依存関係を整理し、スケーラビリティを検討します |
順次実行 — 各視点から順番に分析します。
const perspectives = ['creative', 'pragmatic', 'systematic']
perspectives.forEach(perspective => {
// Analyze inline using exploration-codebase.json as context
// Generate ideas from this perspective's focus
Write(`${sessionFolder}/perspectives/${perspective}.json`, JSON.stringify({
perspective: perspective,
ideas: [ // 3-5 ideas per perspective
{ title: '...', description: '...', novelty: 1-5, feasibility: 1-5, rationale: '...' }
],
key_findings: [...],
challenged_assumptions: [...],
open_questions: [...],
_metadata: { perspective, timestamp: getUtc8ISOString() }
}, null, 2))
})
ステップ 2.3: 多角的な調査結果の集約
// Update progress
functions.update_plan([{ id: "phase-2", title: "Phase 2: Divergent Exploration", status: "in_progress" }])
const synthesis = {
session_id: sessionId,
timestamp: getUtc8ISOString(),
topic,
// Individual perspective findings
creative: readJson(`${sessionFolder}/perspectives/creative.json`),
pragmatic: readJson(`${sessionFolder}/perspectives/pragmatic.json`),
systematic: readJson(`${sessionFolder}/perspectives/systematic.json`),
// Cross-perspective synthesis
synthesis: {
convergent_themes: [...], // What all perspectives agree on
conflicting_views: [...], // Where perspectives differ
unique_contributions: [...] // Insights unique to specific perspectives
},
// Aggregated for refinement
aggregated_ideas: [...], // Merged and deduplicated ideas from all perspectives
key_findings: [...] // Main insights across all perspectives
}
Write(`${sessionFolder}/perspectives.json`, JSON.stringify(synthesis, null, 2))
ステップ 2.3b: 外部リサーチ (任意)
外部からのインスピレーション、業界のベストプラクティス、先行事例を検索し、ブレインストーミングのコンテキストを充実させます。
// Triggered when: topic involves established patterns, industry trends, or competitive landscape
const researchQueries = generateResearchQueries(topic, dimensions)
researchQueries.forEach(query => {
const results = web.run({ search_query: query })
// Extract: patterns, inspiration, best practices, case studies
})
// Write research findings
Write(`${sessionFolder}/research.json`, JSON.stringify({
queries: researchQueries,
findings: [...], // [{source, insight, relevance_to_topic}]
inspiration: [...], // Cross-domain ideas from external sources
best_practices: [...],
_metadata: { timestamp: getUtc8ISOString() }
}, null, 2))
// Merge research findings into perspectives.json synthesis
// Update convergent_themes and unique_contributions with external evidence
ステップ 2.4: brainstorm.md の更新
ラウンドドキュメントパターンを使用して、探索結果を含むラウンド 1 を追記します。
ラウンド 1 のセクション (多角的な探索):
- 創造的観点: 新規性/インパクトの評価を伴う斬新なアイデア
- 実用的観点: 工数/リスクの評価を伴う実践的なアプローチ
- 体系的観点: トレードオフ分析を伴うアーキテクチャの選択肢
- 観点の統合: 収束するテーマ、対立、独自の貢献
ステップ 2.5: 初期アイデアカバレッジの確認
// Check exploration vectors against Round 1 findings
appendToBrainstorm(`
#### Initial Idea Coverage Check (Post-Exploration)
${explorationVectors.map((vector, i) => {
const status = assessCoverage(vector, explorationFindings)
return `- ${status.icon} Vector ${i+1}: ${vector} — ${status.detail}`
}).join('\n')}
> Next rounds will focus on uncovered and in-progress vectors.
`)
成功基準:
- コードベースのコンテキストを含む exploration-codebase.json が作成されている (コードベースが存在する場合)
- 各観点について perspectives/*.json が作成されている
- 集約された調査結果と統合を含む perspectives.json が作成されている
- brainstorm.md がラウンド 1 の結果で更新されている
- 初期アイデアカバレッジの確認が完了している
- 主要な調査結果が記録されている (根拠と評価を含む)
フェーズ 3: インタラクティブな絞り込み
目的: 複数ラウンドのユーザー主導の探索サイクルを通じて、アイデアを反復的に絞り込みます。最大ラウンド数: 6。すべての分析はインラインで行います。
自動モードの動作 (--yes):
- バランス/ディープモード: 自動ラウンドを 2 回実行 (上位 2 件のアイデアに対するディープダイブを 1 回、上位 3 件のアイデアに対するチャレンジを 1 回) した後、自動収束
- クリエイティブモード: 自動ラウンドを 1 回実行 (発散を 1 回) した後、自動収束
- ユーザーの方向性プロンプトをスキップし、アイデアのスコアに基づいて自動選択
累積コンテキストのルール: 各ラウンドの分析には、それまでのすべての調査結果をコンテキストとして含める MUST。決して単独で分析せず、常に次に基づいて構築します:
- 前のラウンドのアイデアと評価
- それまでのすべてのラウンドからのユーザーフィードバック
- リサーチの調査結果 (ある場合)
- 挑戦された前提とその結果
続行前に記録するルール: 現在のアイデアを更新したり次のインタラクションを提示したりする BEFORE に、ラウンドの調査結果を brainstorm.md に書き込む MUST。
ステップ 3.1: 調査結果の提示とユーザーの方向性の収集
現在の理解の要約 (ラウンド >= 2、新しい調査結果を提示する BEFORE):
- 上位のアイデアと前回のラウンドの方向性について 1~2 文の要約を生成
- 例: 「これまでの上位のアイデア: [idea1]、[idea2]。前回のラウンドでは[深掘り/挑戦/統合]しました。最新の調査結果は次のとおりです:」
// Update progress
functions.update_plan([{ id: "phase-3", title: "Phase 3: Interactive Refinement", status: "in_progress" }])
if (!autoYes) {
// Dynamic options based on round context
const baseOptions = [
{ label: "Deep Dive", description: "Explore selected ideas in detail" },
{ label: "Diverge More", description: "Generate more ideas from different angles" },
{ label: "Challenge", description: "Devil's advocate — test ideas critically" },
{ label: "Merge Ideas", description: "Combine complementary ideas" }
]
// Add research option if not yet done or if new angles emerged
if (!researchDone || newAnglesEmerged) {
baseOptions.push({ label: "外部研究", description: "Search for external inspiration and best practices" })
}
// Always include converge as final option
baseOptions.push({ label: "Ready to Converge", description: "Sufficient ideas, proceed to synthesis" })
const feedback = functions.request_user_input({
questions: [{
header: "Direction", // max 12 chars
question: `Brainstorm round ${round}: What would you like to do next?`,
multiSelect: false,
options: baseOptions.slice(0, 4) // max 4 options per schema
}]
})
}
ステップ 3.2: ユーザー応答の処理
記録チェックポイント: 選択されたオプションに関係なく、brainstorm.md に記録する MUST:
- ユーザーの元の選択と表現
- ブレインストーミングの方向性への影響
- 方向性が変わった場合は、完全な決定記録を記録
| 応答 | アクション |
|---|---|
| ディープダイブ | どのアイデアを探索するかを尋ねます。インライン分析: 概念の詳述、要件/依存関係の特定、課題の分析、PoC アプローチの提案、成功指標の定義。ideas/{idea-slug}.md に書き込みます。 |
| さらに発散 | 異なる角度からのインライン分析: 代替の枠組み、領域横断的なインスピレーション、what-if シナリオ、制約の緩和。新しいアイデアを生成します。 |
| チャレンジ | インラインの悪魔の代弁者分析: アイデアごとに 3 つの最も強力な反論、前提への挑戦、失敗シナリオ、競合する代替案、生存可能性の評価 (1~5)。 |
| アイデアの統合 | どのアイデアを統合するかを尋ねます。インライン統合: 補完的な要素の特定、矛盾の解消、統一された概念の作成、強みの保持。ideas/merged-idea-{n}.md に書き込みます。 |
| 外部研究 | トピック固有のクエリで web.run を実行します。検索対象: 業界のパターン、競合ソリューション、ベストプラクティス、学術研究。調査結果を現在のラウンドに統合します。research.json を更新します。 |
| 収束の準備完了 | 結論を出す理由を記録します。ループを終了 → フェーズ 4。 |
ステップ 3.3: 選択したアイデアのディープダイブ
ユーザーが「ディープダイブ」を選択した場合、包括的なインライン分析を提供します:
// For each selected idea, analyze inline
selectedIdeas.forEach(idea => {
const deepDive = {
title: idea.title,
detailed_description: '...', // Elaborated concept
technical_requirements: [...], // Implementation needs
dependencies: [...], // What this depends on
challenges: [ // Risk/challenge matrix
{ challenge: '...', severity: 'high|medium|low', mitigation: '...' }
],
poc_approach: '...', // Proof-of-concept suggestion
success_metrics: [...], // How to measure success
source_perspectives: [...] // Which perspectives contributed
}
Write(`${sessionFolder}/ideas/${ideaSlug}.md`, formatIdeaMarkdown(deepDive))
})
ステップ 3.4: 悪魔の代弁者によるチャレンジ
ユーザーが「チャレンジ」を選択した場合、インラインの批判的分析を実行します:
selectedIdeas.forEach(idea => {
const challenge = {
idea: idea.title,
objections: [...], // 3+ strongest objections
challenged_assumptions: [...], // Core assumptions tested
failure_scenarios: [...], // When/how this fails
alternatives: [...], // Competitive/alternative solutions
survivability_rating: 1-5, // How well idea survives challenge
strengthened_version: '...' // Improved version post-challenge
}
// Record in brainstorm.md
})
ステップ 3.5:複数のアイデアを統合する
ユーザーが「統合」を選択したら、インラインで統合します。
const merged = {
title: '...', // New merged concept name
description: '...', // Unified concept description
source_ideas: [...], // Which ideas were merged
elements_from_each: [...], // What was taken from each source
contradictions_resolved: [...], // How conflicts were handled
combined_strengths: [...], // New combined advantages
implementation_considerations: '...'
}
Write(`${sessionFolder}/ideas/merged-idea-${n}.md`, formatMergedIdeaMarkdown(merged))
ステップ 3.6:各ラウンドを記録する
ラウンド記録パターンを使用して、brainstorm.md を更新します。
思考の進化のタイムラインに、ユーザーの方向性、決定ログ、生成・更新されたアイデア、分析結果、検証された前提、未解決項目、ナラティブの統合を追記します。
置き換え(追記ではありません):
| セクション | 更新ルール |
|---|---|
## Current Ideas | 最新の順位付け済みアイデアリストで上書きします |
## Table of Contents | 新しい Round N セクションへのリンクを追加して更新します |
成功基準:
- 各ラウンドのユーザーフィードバックを処理している
- brainstorm.md がすべての改善ラウンドの内容で更新されている
- 選択した詳細な検討対象のアイデアが
ideas/フォルダーにある - 終了条件に到達している(ユーザーが収束を選択するか、最大ラウンド数に達している)
フェーズ 4:収束と具体化
目的:最終的なアイデアを統合し、結論と推奨事項を作成して、次のステップを提示します。
ステップ 4.1:知見を統合する
const synthesis = {
session_id: sessionId,
topic,
completed: getUtc8ISOString(),
total_rounds: roundCount,
top_ideas: [ // Top 5 ranked ideas
{
title: '...', description: '...',
source_perspective: '...',
score: 1-10, // Final viability score
novelty: 1-5, // Innovation rating
feasibility: 1-5, // Implementation feasibility
key_strengths: [...],
main_challenges: [...],
next_steps: [...],
review_status: 'accepted|modified|rejected|pending'
}
],
parked_ideas: [...], // Ideas for future consideration
key_insights: [...], // Key learnings from brainstorming
recommendations: {
primary: '...', // Best path forward
alternatives: [...] // Other viable options
},
follow_up: [ // Suggested next steps
{ type: 'implement|research|validate', summary: '...' }
],
decision_trail: [ // Consolidated from all phases
{ round: 1, decision: '...', context: '...', chosen: '...', reason: '...', impact: '...' }
]
}
Write(`${sessionFolder}/synthesis.json`, JSON.stringify(synthesis, null, 2))
ステップ 4.2:brainstorm.md を最終更新する
統合と結論:
- エグゼクティブサマリー:ブレインストーミングの結果の概要
- トップアイデア:説明と長所・課題を含む順位付け済みリスト
- 主要な推奨事項:明確な根拠を示した最善の進め方
- 代替アプローチ:トレードオフ分析を含む、ほかの実行可能な選択肢
- 保留中のアイデア:今後の検討事項と、その検討を開始するきっかけ
- 主な知見:プロセスから得られた重要な学び
現在のアイデア(最終版):
| 小見出し | 内容 |
|---|---|
| トップアイデア | 長所・課題とともにスコア順に順位付け |
| アイデアの進化 | トップアイデアが各ラウンドでどのように発展したか |
| 主な知見 | 今後の参考となる有益な学び |
決定の経緯:
| 小見出し | 内容 |
|---|---|
| 重要な決定 | 結果を左右した重要な決定 |
| 方向性の変更 | 根拠とともに示す、スコープや重点の調整のタイムライン |
| トレードオフ | 主なトレードオフと、特定の進め方を選んだ理由 |
セッション統計:ラウンド総数、生成されたアイデア数、課題を乗り越えたアイデア数、使用した視点、生成された成果物。
ステップ 4.3:トップアイデアを対話形式で確認する(自動モードではスキップ)
トップアイデアをまとめて確認します(1 回の呼び出しにつき最大 4 つの質問となるため、トップアイデアを適切にグループ化します)。
// Update progress
functions.update_plan([{ id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "in_progress" }])
if (!autoYes) {
// Batch review: up to 4 ideas per functions.request_user_input call
const batchSize = 4
for (let batch = 0; batch < rankedIdeas.length; batch += batchSize) {
const batchIdeas = rankedIdeas.slice(batch, batch + batchSize)
const review = functions.request_user_input({
questions: batchIdeas.map((idea, i) => ({
header: `Idea #${batch + i + 1}`, // max 12 chars
question: `"${idea.title}" (score: ${idea.score}). Your decision:`,
multiSelect: false,
options: [
{ label: "Accept", description: "Keep in final recommendations" },
{ label: "Modify", description: "Adjust scope or priority" },
{ label: "Reject", description: "Remove from recommendations" },
{ label: "Accept Rest", description: "Accept all remaining ideas" }
]
}))
})
// Process: Accept → "accepted" | Modify → gather text → "modified" | Reject → "rejected"
// Accept Rest → mark all remaining as "accepted", break outer loop
// Record review decisions to brainstorm.md Decision Log + update synthesis.json
}
}
確認の要約(brainstorm.md に追記):
### Top Idea Review Summary
| # | Idea | Score | Novelty | Feasibility | Review Status | Notes |
|---|------|-------|---------|-------------|---------------|-------|
| 1 | [title] | 8 | 4 | 3 | Accepted | |
| 2 | [title] | 7 | 5 | 2 | Modified | [notes] |
| 3 | [title] | 6 | 3 | 4 | Rejected | [reason] |
ステップ 4.4:必須の最終ゲート(完了後の次のステップ)
重要:このゲートは必ず実行してください。この functions.request_user_input の呼び出しを行わずにワークフローを終了してはなりません。
// Update progress — mark phase 4 complete, activate terminal gate
functions.update_plan([
{ id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "completed" },
{ id: "next-step", title: "GATE: Post-Completion Next Step", status: "in_progress" }
])
const nextStep = functions.request_user_input({
questions: [{
header: "Next Step", // max 12 chars
question: "Brainstorming complete. What would you like to do next?",
multiSelect: false,
options: [
{ label: "Execute Task", description: "Build implementation scope and handoff spec from top ideas" },
{ label: "Create Issue", description: "Convert top ideas into trackable issues" },
{ label: "Done", description: "End workflow, all artifacts saved" }
]
}]
})
// Handle next step
if (nextStep === "Execute Task") {
// Build implementation scope from accepted ideas
// Step A: Identify scope items from top ideas
// Step B: Generate handoff-spec.json with implementation details
// Step C: Write handoff-spec.json to session folder
Write(`${sessionFolder}/handoff-spec.json`, JSON.stringify({
session_id: sessionId,
topic,
scope_items: acceptedIdeas.map(idea => ({
title: idea.title,
description: idea.description,
implementation_approach: idea.next_steps,
priority: idea.score >= 8 ? 'high' : idea.score >= 5 ? 'medium' : 'low',
estimated_complexity: idea.feasibility <= 2 ? 'high' : idea.feasibility <= 4 ? 'medium' : 'low'
})),
recommended_workflow: 'workflow-lite-plan or workflow-plan',
_metadata: { generated: getUtc8ISOString(), source_session: sessionId }
}, null, 2))
// Display: "Handoff spec created. Run /workflow-lite-plan to execute."
} else if (nextStep === "Create Issue") {
// Display command for user to run manually
// "/issue:from-brainstorm ${sessionFolder}" or "/issue:new ..."
}
// Mark terminal gate complete
functions.update_plan([
{ id: "next-step", title: "GATE: Post-Completion Next Step", status: "completed" }
])
成功基準:
- synthesis.json が作成され、完全な統合内容が含まれている
- brainstorm.md がすべての結論を含む形で完成している
- 最終ゲートが実行され、ユーザーが次のステップを選択している
- 「タスクを実行」を選択した場合、実装範囲を記載した handoff-spec.json が作成されている
- セッションが完了し、すべての成果物を利用できる
テンプレート
ラウンド記録パターン
各ラウンドでは、brainstorm.md で次の構成を使用します。
### Round N - [DeepDive|Diverge|Challenge|Merge] (timestamp)
#### User Input
What the user indicated they wanted to focus on
#### Decision Log
#### Ideas Generated
New ideas from this round with ratings
#### Analysis Results
Detailed findings from this round's analysis
- Finding 1 (evidence: file:line or rationale)
- Finding 2 (evidence: file:line or rationale)
#### Challenged Assumptions
- ~~Previous assumption~~ → New understanding
- Reason: Why the assumption was wrong
#### Open Items
Remaining questions or exploration directions
#### Narrative Synthesis
brainstorm.md の進化の概要
- ヘッダー:セッション ID、トピック、開始時刻、観点、モード
- セッションのコンテキスト:重点分野、視点、制約
- 探索の方向性:探索を導く重要な質問
- 初期の決定:これらの視点と重点分野を選んだ理由
- 思考の進化のタイムライン:ラウンドごとの調査結果
- Round 1:探索結果 + 決定ログ + ナラティブの統合
- Round 2-N:現在のアイデアの概要 + ユーザーフィードバック + 方向性の調整 + 新しいアイデア + 決定ログ + ナラティブの統合
- 決定の経緯:全ラウンドにわたる重要な決定を統合した記録
- 統合と結論:要約、トップアイデア、推奨事項
- 現在のアイデア(最終版):統合された順位付け済みアイデア
- セッション統計:完了したラウンド数、生成されたアイデア数、作成された成果物
参考資料
出力構造
{projectRoot}/.workflow/.brainstorm/BS-{date}-{slug}/
├── brainstorm.md # Complete thought evolution timeline
├── exploration-codebase.json # Phase 2: Codebase context
├── perspectives/ # Phase 2: Individual perspective outputs
│ ├── creative.json
│ ├── pragmatic.json
│ └── systematic.json
├── perspectives.json # Phase 2: Aggregated findings with synthesis
├── research.json # Phase 2/3: External research findings (if web.run used)
├── synthesis.json # Phase 4: Final synthesis
├── handoff-spec.json # Phase 4: Implementation scope (if "Execute Task" selected)
└── ideas/ # Phase 3: Individual idea deep-dives
├── idea-1.md
├── idea-2.md
└── merged-idea-1.md
| ファイル | フェーズ | 説明 |
|---|---|---|
brainstorm.md | 1-4 | セッションのメタデータ → 思考の進展 → 結論 |
exploration-codebase.json | 2 | コードベースのコンテキスト:関連ファイル、パターン、制約 |
perspectives/*.json | 2 | 視点ごとのアイデア生成結果 |
perspectives.json | 2 | 視点を横断して統合した知見 |
research.json | 2-3 | 外部調査:パターン、ベストプラクティス、着想 |
ideas/*.md | 3 | 個別のアイデアの詳細な検討と統合したアイデア |
synthesis.json | 4 | 最終的な統合:主要なアイデア、推奨事項、知見 |
handoff-spec.json | 4 | 実装範囲と引き継ぎ(タスク実行を選択した場合) |
ブレインストーミングの次元
| 次元 | キーワード | 説明 |
|---|---|---|
| 技術 | 技術、技術、実装、コード、実装、アーキテクチャ | 実装アプローチ |
| UX | ユーザー、ユーザー、体験、UX、UI、体験、インタラクション | ユーザー向けの設計アイデア |
| ビジネス | 事業、ビジネス、価値、ROI、価値、市場 | ビジネスモデルの革新 |
| イノベーション | 革新、イノベーション、斬新、創造的、新規性 | 画期的なアイデア |
| 実現可能性 | 実現可能、実現可能、実用的、現実的、現実 | 現実的なアプローチ |
| 拡張性 | 拡張、規模、成長、パフォーマンス、性能 | 大規模なソリューション |
| セキュリティ | セキュリティ、セキュリティ、リスク、保護、リスク | セキュリティ上の考慮事項 |
ブレインストーミングの視点
| 視点 | 焦点 | 最適な用途 |
|---|---|---|
| 創造的 | イノベーション、分野横断的な着想、前提への挑戦 | 斬新で意外性のあるアイデアの生成 |
| 実践的 | 実装の実現可能性、工数の見積もり、阻害要因 | アイデアの現実性の確認 |
| 体系的 | 問題の分解、パターン、拡張性、アーキテクチャ | ソリューションの整理と構造化 |
ブレインストーミングのモード
| モード | 強度 | 視点 | 説明 |
|---|---|---|---|
| 創造的 | 高い新規性 | 1つの視点 | 迅速に、斬新なアイデアに集中します |
| バランス型 | 混合 | 3つの視点 | 適度でバランスの取れた探索(デフォルト) |
| ディープ | 包括的 | 3つの視点+詳細な改善 | 複数ラウンドにわたって徹底的に調査します |
コラボレーションパターン
| パターン | 用途 | 説明 |
|---|---|---|
| 並列発散 | 新しいトピック | 包括的に網羅するため、すべての視点を順番に検討します |
| 段階的な詳細検討 | 有望なアイデア | 1つの視点が詳しく掘り下げ、ほかの視点が批評します |
| ディベートモード | 議論の分かれるアプローチ | 賛成・反対の立場からインラインで分析します |
| 統合モード | 決定の準備が整った状態 | すべての視点から得た知見をインラインで統合します |
コンテキストのオーバーフロー対策
視点ごとの制限:
- 主分析の出力:3000語未満
- サブドキュメント(ある場合):各2000語未満
- サブドキュメントの最大数:視点ごとに5件
統合時の保護:
- 分析の合計が100KBを超える場合、統合では主分析ファイルのみを読み込みます(サブドキュメントは読み込みません)
- 大きなアイデアは自動的に
ideas/フォルダー内の個別のアイデアドキュメントに分割されます
復旧手順:
- 出力が途中で切れていないか、オーバーフローしていないか確認します
- 範囲を縮小します:視点を減らすか、トピックを簡潔にします
- より焦点を絞った出力を得るために、構造化ブレインストーミングモードを使用します
- 複雑なトピックを複数のセッションに分割します
エラー処理
| 状況 | アクション | 復旧方法 |
|---|---|---|
| コードベースが検出されない | 通常のフローで、トピックのみをブレインストーミングします | exploration-codebase.json を使わずに続行します |
| コードベースの検索に失敗する | 利用可能なコンテキストで続行します | brainstorm.md に制限事項を記録します |
| ウェブ調査に失敗する | 外部の調査結果なしで続行します | brainstorm.md に記録し、インライン分析に頼ります |
| 調査結果とアイデアが食い違う | 競合する証拠として提示します | どの方向性を追求するかはユーザーに委ねます |
| 良いアイデアがない | 問題を捉え直すか、制約を調整します | 新しい探索の切り口を試します |
| 視点が食い違う | トレードオフの選択肢として提示します | ユーザーに希望する選択肢を選んでもらいます |
| 最大ラウンド数に到達(6) | 統合フェーズに強制移行します | 未解決の質問を強調します |
| セッションフォルダーが競合する | タイムスタンプのサフィックスを追加します | 一意のフォルダーを作成します |
| ユーザーがタイムアウトする | 状態を保存し、再開コマンドを表示します | --continue を使って再開します |
ベストプラクティス
基本原則
- コードを変更しない:このスキルは読み取り専用です。分析とアイデアのドキュメントを作成しますが、ソースコードは決して変更しません。
- 決定事項をすぐに記録する:決定が行われた時点で、Decision Record 形式を使って記録します
- 証拠に基づく:コードベースのパターンに言及するアイデアには、ファイル名と行番号の証拠を含めます
- 意見の相違を受け入れる:視点の相違から、重要なトレードオフが明らかになることはよくあります
開始前
- トピックを明確に定義する:トピックを詳細に定めると、検討する次元をより適切に特定できます
- ユーザーのコンテキスト:ユーザーの好みを理解することで、ブレインストーミングの強度を調整できます
- スコープを把握する:期間やスコープへの期待を明確にすることで、適切な探索レベルを設定できます
ブレインストーミング中
- 視点を確認する:改善ラウンドの前に、すべての視点からの結果を確認します
- 前提を記録する:後で修正できるよう、正しいと思っていることを追跡します
- 継続モードを使う:セッションを再開し、前回の探索を発展させます
- 慎重に反復する:各改善ラウンドで、アイデアを有意義に前進させます
- アイデアの進化を追跡する:ラウンドを重ねる中でアイデアがどう変化したかを記録します
ドキュメント作成の実践
- タイムラインを明確にする:追跡しやすいよう、明確なタイムスタンプを使います
- 進化を追跡する:アイデアがどのように発展し、変化したかを記録します
- 複数の視点を統合する:共通するテーマや相反するテーマを記録します
- アクション項目:具体的で実装可能な推奨事項を作成します
使用する場面
次のような場合は brainstorm-with-file を使ってください:
- トピックについて新しいアイデアや解決策を生み出す
- 可能性を複数の視点から探る必要がある
- アイデアの発展過程が分かる、記録された思考の変遷が必要である
- 実装を決める前に創造的な解決策を探る
- アイデアを洗練するために、発散と収束のサイクルが必要である
次のような場合は、別の方法を検討してください:
- 既存のコードやアーキテクチャを分析する →
analyze-with-fileを使います - 特定のバグを診断する必要がある →
debug-with-fileを使います - 要件を含む複雑な計画を立てる →
collaborative-plan-with-fileを使います - 実装を始める準備ができている →
lite-planを使います
次のトピックについて、ブレインストーミングを開始してください:$TOPIC
重要:このスキルで行うのはブレインストーミングのみです。分析、視点、統合のドキュメントを作成しますが、コードの実行、ソースファイルの変更、他のスキルの自動起動は決して行いません。後続の操作はすべて、提案されたコマンドをユーザーが手動で実行する必要があります。