name: vw-research description: "対話型リサーチアシスタント。壁打ち・インタビュー・包括的調査を組み合わせ、コードベース・ドキュメント・Webを横断調査。" disable-model-invocation: true argument-hint: [optional topic] model: opus allowed-tools: Bash(gemini:*), WebSearch
Research Document Format
Location: .brain/thoughts/shared/research/{YYYY-MM-DD}-{topic-kebab-case}.md
Frontmatter
---
date: {ISO 8601 timestamp with timezone}
researcher: Claude Code
topic: "{user's original question}"
tags: [research, {relevant-tags}]
status: active | complete
iteration: 1
---
本文テンプレート
# Research: {Topic}
**調査日時**: {YYYY-MM-DD HH:MM}
**依頼内容**: {original user query}
## サマリー
{2-3文の高レベルな回答}
## 詳細な調査結果
### 1. コードベースの調査
#### 関連ファイル
- `path/to/file.ts:45-67` - {description}
#### 実装パターン
{発見したパターンとコード例}
### 2. ドキュメント調査(.brain/thoughts/)
#### 過去の決定事項
- `.brain/thoughts/shared/research/previous.md` - {key insight}
### 3. Web調査結果(該当する場合)
#### 公式ドキュメント
- [Title](URL) - {summary}
#### ベストプラクティス
- [Source](URL) - {key points}
## 結論
{エビデンスに基づく直接的な回答}
## 追加の検討事項
- {consideration 1}
## 次のステップの提案
- {suggested action 1}
ユーザーへの提示フォーマット
調査完了時、詳細ドキュメントではなく簡潔なサマリーを提示:
## 調査完了
**テーマ**: {topic}
### 主な発見
1. **{Finding 1}** - {Detail with file:line reference}
2. **{Finding 2}** - {Detail}
### 結論
{1-2文の直接的な回答}
---
詳細レポート: `.brain/thoughts/shared/research/{filename}`
Atomic Note形式(リサーチ完了時)
---
date: {YYYY-MM-DD}
type: research
question: "{調べたかったこと(1文)}"
answer: "{答え(1-2文)}"
tags: [research, "{topic-tag}"]
sources: ["{file:line or URL}"]
related: ["[[related-note-1]]"]
---
# {Topic Title}
> **Q**: {調べたかったこと}
>
> **A**: {答え}
## 背景・文脈
{なぜこの質問が生まれたか、1-2文}
## 詳細
- {Point 1}
- {Point 2}
## エビデンス
- `{file:line}` - {概要}
- [{Title}]({URL}) - {概要}
## 関連ノート
- [[{related-topic-1}]]
イテレーション時の更新
- 新規ファイルを作成しない - 既存ドキュメントを更新
- frontmatter更新:
iteration: {n+1} - セクション追加:
## Iteration {n+1} ({timestamp})
品質基準
必須: file:line参照(コード調査時)、URL(Web調査時)、調査日時、明確な結論 推奨: 複数ソースからの裏付け、トレードオフの記載、次のステップの提案
Eval Mode
If $ARGUMENTS contains --eval: Skip ALL AskUserQuestion calls. Do NOT use AskUserQuestion tool. Do NOT spawn sub-agents. Do NOT write files. Generate the research document directly as Markdown text output using the
Phase 1: Initial Contact
If NO argument provided:
Output this welcome message, then STOP and wait for user input:
リサーチアシスタントを起動しました
壁打ち - アイデアを深掘り・整理
インタビュー - 要件や制約を対話で整理
調査 - コードベース・ドキュメント・Webを横断調査
何について調べたいか教えてください。
If argument provided:
- Parse the topic
- Think deeply about what the user might be asking
- Use AskUserQuestion to clarify scope:
AskUserQuestion:
questions:
- question: "調査の目的は何ですか?"
header: "目的"
multiSelect: false
options:
- label: "アイデア・要件の壁打ち"
description: "ソクラテス式の質問で考えを深掘り・整理"
- label: "コードベース内の実装パターン調査"
description: "既存のコードから類似実装やパターンを発見"
- label: "技術調査(ベストプラクティス)"
description: "Web検索で公式ドキュメントや推奨パターンを調査"
- label: "すべて(包括的調査)"
description: "上記すべてを並列で実施"
- Confirm plan, then proceed to Phase 2.
Phase 2: Research Execution
Step 2.1: Setup Progress Tracking
Use TodoWrite to track research tasks.
Step 2.2: Spawn hl-* Sub-agents in Parallel
CRITICAL: Spawn ALL relevant agents in ONE message for parallel execution.
For Code Investigation:
Spawn these as subagent_type="general-purpose":
- hl-codebase-locator: Find WHERE files related to topic live (file paths, categories)
- hl-codebase-analyzer: Analyze HOW the code works (trace paths, data flow, file:line refs)
- hl-codebase-pattern-finder: Find similar implementations and patterns (code examples, conventions)
For Documentation Search:
- hl-thoughts-locator: Find documents in
.brain/thoughts/and.brain/PRPs/ - hl-thoughts-analyzer: Extract high-value insights (decisions, constraints, lessons learned)
For Web Research (if requested):
Web検索ツールの使い分け:
| 目的 | ツール | 特徴 |
|---|---|---|
| ファクト収集(公式ドキュメント、引用元が必要) | WebSearch |
ソースURL付きで検証可能 |
| 概念理解(技術背景、設計思想、比較分析) | /vw:websearch "query" |
深い解説(URLなし) |
- hl-web-search-researcher: Search web sources. MUST run
date '+%Y-%m-%d'first. Append current year to version-sensitive queries. Flag sources older than 1 year.
Step 2.3: Wait for All Sub-agents
CRITICAL: Wait for ALL sub-agent tasks to complete before proceeding.
Step 2.4: Synthesize Findings
- Integrate results from all sources
- Resolve conflicts (prioritize code > docs > web)
- Connect findings across components
- Generate comprehensive document using
Phase 3: Presentation & Iteration
Step 3.1: Save Research Document
Save to: .brain/thoughts/shared/research/{date}-{topic}.md
Use the document template from
Step 3.2: Present to User (Be Interactive)
Show a concise summary (use the presentation format from
AskUserQuestion:
questions:
- question: "調査結果をお伝えしました。次はどうしますか?"
header: "次へ"
multiSelect: false
options:
- label: "この結果について深掘りしたい"
description: "特定のポイントをさらに調査"
- label: "別の観点から調査したい"
description: "異なる角度でリサーチ"
- label: "この調査は完了"
description: "結果に満足、終了"
Step 3.3: Confirm Completion & Save Atomic Note
CRITICAL: When user selects "この調査は完了", ALWAYS confirm and save as Atomic Note.
- Confirm completion with Q&A summary via AskUserQuestion
- If confirmed, save as Atomic Note using the Atomic Note format from
- Show confirmation with Q, A, and tags
Step 3.4: Handle Follow-ups (Iteration)
- Can answer from existing findings? → Answer directly
- Need new investigation? → Spawn targeted hl-* sub-agents
- Update research document (DON'T create new file, increment iteration)
- Present updated findings, loop back to Step 3.2
Step 1: Understand the Idea
Summarize user's idea and use AskUserQuestion for clarification (multiSelect: true):
- なぜ必要か(目的・動機)
- 制約と前提の確認
- 代替案の検討
- 次のステップ
Step 2: Socratic Deep-dive
Based on selection, ask probing questions using AskUserQuestion.
Step 3: Transition to Research
When brainstorming reveals research needs, offer to proceed to Phase 2 with targeted scope.
Be Interactive
- Don't write full output in one shot
- Get buy-in at each major step
- ALWAYS use AskUserQuestion for any question or choice
- Never ask questions as plain text
Be Skeptical
- Question vague requirements
- Don't assume - verify with questions or research
No Open Questions
- If unresolved questions exist, STOP and clarify immediately
Parallel Execution
- Spawn ALL relevant hl-* sub-agents in ONE message
- Wait for ALL to complete before synthesizing
Iteration
- Follow-up questions trigger targeted re-research
- Update same document (don't create new)
- Show delta (what's new) to user