deep-research
Conduct multi-agent deep research on a topic with parallel web searches and synthesis
What this skill does
# Deep Research Command
You are orchestrating a **multi-agent deep research workflow** that produces comprehensive, well-cited research reports.
## Command Workflow
When the user invokes `/stepwise-research:deep-research <topic>`, follow these steps:
### 1. Clarification Phase (Only if Needed)
If the research topic is **ambiguous or unclear**, ask 1-2 clarifying questions using the AskUserQuestion tool:
- What specific aspect should be prioritized?
- What timeframe or context is relevant?
- Are there specific sources to include/exclude?
**Skip this step if:**
- Topic is explicit (e.g., "research Docker containerization security")
- User has provided clear context
- Query is self-contained
### 2. Analyze Query Complexity
Determine the complexity level of the research query to decide how many workers to spawn:
**Query Types:**
- **Simple definition** (e.g., "What is Docker?"): 1 worker
- **How-to guide** (e.g., "How does JWT work?"): 1-2 workers
- **Comparison (2 items)** (e.g., "React vs Vue"): 2-3 workers
- **Comparison (3+ items)** (e.g., "Compare top 5 databases"): 3-5 workers
- **State-of-the-art** (e.g., "Current state of WebAssembly"): 4-6 workers
- **Multi-faceted analysis** (e.g., "Analyze enterprise AI adoption"): 5-8 workers
- **Controversial topic** (e.g., "Pros and cons of microservices"): 4-6 workers (ensure balanced perspectives)
### 3. Generate Sub-Questions
Break the research query into 2-6 focused sub-questions based on complexity:
**Example for simple query** ("What is Docker?"):
- Sub-question 1: What is Docker and what problem does it solve?
**Example for comparison** ("PostgreSQL vs MySQL"):
- Sub-question 1: PostgreSQL architecture and performance characteristics
- Sub-question 2: MySQL architecture and performance characteristics
- Sub-question 3: Real-world benchmarks and case studies comparing both
**Example for complex research** ("State of WebAssembly adoption"):
- Sub-question 1: WebAssembly capabilities and features in 2026
- Sub-question 2: Major frameworks and tools supporting WebAssembly
- Sub-question 3: Enterprise adoption case studies and success stories
- Sub-question 4: Performance benchmarks and limitations
- Sub-question 5: Security considerations and best practices
- Sub-question 6: Future roadmap and emerging use cases
**Guidelines:**
- Each sub-question should be independently researchable
- Together they should provide comprehensive coverage
- Avoid overlapping questions
- Focus on different aspects or perspectives
### 4. Spawn Research Workers in Parallel
Use the `Task` tool to spawn multiple `stepwise-research:research-worker` agents **in a single message** to enable parallel execution.
**Critical:** All worker spawns MUST be in the same response to enable parallel execution.
For each sub-question, spawn a worker:
```
Task:
subagent_type: "stepwise-research:research-worker"
description: "Research [sub-question summary]"
prompt: "Research the following focused question:
Question: [sub-question]
Context: [relevant context from main query]
Instructions:
- Execute 3-5 web searches with progressively refined queries
- Start broad (1-6 word queries) then narrow based on results
- Fetch full content from 5-10 promising sources
- Prioritize .gov, .edu, peer-reviewed, and official documentation
- Return compressed findings with citations in this format:
## Findings: [Sub-Question]
### Key Insight 1: [Title]
[2-4 sentence summary]
**Sources:** [1] [2]
### Key Insight 2: [Title]
[2-4 sentence summary]
**Sources:** [3] [4]
[Continue for 3-6 key insights]
## Bibliography
[1] Source Title - URL
[2] Source Title - URL
...
## Research Metadata
- Queries executed: [N]
- Sources fetched: [M]
- Coverage assessment: [Complete | Partial | Limited]
- Gaps identified: [Any areas needing follow-up]
"
```
Repeat this Task call for each sub-question in the same message.
### 5. Monitor Worker Progress
Wait for all workers to complete. Each worker will:
- Execute 3-5 web searches with progressively refined queries
- Fetch full content from 5-10 sources
- Compress findings into 3-6 key insights
- Return structured findings with citations
**Do not proceed to synthesis until all workers have completed.**
### 6. Synthesize Findings
After all workers complete, synthesize their findings into a coherent research report:
**Synthesis Process:**
1. **Read all worker outputs** from the task results
2. **Identify themes** across worker findings:
- What patterns emerge?
- What do multiple sources agree on?
- What contradictions exist?
3. **Cross-reference findings:**
- Map insights to multiple sources
- Flag claims supported by only one source
- Identify areas of consensus vs disagreement
4. **Detect gaps:**
- Are there important aspects not covered?
- Are some claims weakly supported?
- Do we need additional research?
**If critical gaps exist:**
- Spawn 1-2 additional workers with targeted questions
- Wait for their findings
- Incorporate into synthesis
**Don't over-research:** If you have 10-15+ quality sources and coverage of main themes, proceed to report generation.
### 7. Generate Research Report
Use the `generate-report` script to create the report with proper YAML frontmatter and structure.
**Step 7a: Synthesize content**
Before calling the script, prepare the content for each section:
1. **Executive Summary**: 3-5 sentence overview answering the research question directly
2. **Detailed Findings**: Organized by theme with subsections, citing sources as `[N]`
3. **Cross-References and Contradictions**: 2-3 paragraphs discussing areas of consensus, disagreements between sources, and evolution of thinking on the topic
4. **Conclusions**: 3-5 bullet points summarizing key takeaways
5. **Bibliography**: Numbered list `[N] Source Title - URL`
**Quality Guidelines:**
- **Synthesis, not concatenation:** Don't just copy-paste worker findings. Weave them into a coherent narrative.
- **Multiple citations per claim:** Aim for 2-3 sources per major claim.
- **Balanced perspectives:** Include contrarian views if they exist.
- **Source diversity:** Mix .gov, .edu, industry blogs, official docs.
- **Clarity:** Write for a technical audience but explain jargon.
- **No fluff:** Every sentence should provide value.
**Step 7b: Generate report file**
Compute the sanitized filename:
- Convert topic to lowercase
- Replace spaces with hyphens
- Remove special characters (keep only alphanumeric and hyphens)
- Truncate to 60 characters max
- Append date suffix: `[sanitized-topic]-YYYY-MM-DD.md`
Then call the script:
```bash
research/skills/deep-research/scripts/generate-report \
--title "Research on [Topic]" \
--query "[Original research question]" \
--keywords "[keyword1,keyword2,keyword3,...]" \
--agent-count [N] \
--source-count [M] \
--output-file "thoughts/shared/research/[sanitized-topic]-[YYYY-MM-DD].md" \
--executive-summary "[synthesized executive summary]" \
--findings "[synthesized detailed findings with citations]" \
--cross-references "[cross-references and contradictions analysis]" \
--conclusions "[synthesized conclusions]" \
--bibliography "[numbered bibliography entries]"
```
**All parameters are required except** `--executive-summary`, `--findings`, `--cross-references`, `--conclusions`, and `--bibliography` (which are optional but should always be provided for a complete report).
The script:
- Validates required parameters
- Generates YAML frontmatter (title, date, query, keywords, status, agent_count, source_count)
- Creates the report with all sections
- Adds a generation timestamp footer
- Creates parent directories if needed
### 8. Citation Verification
After generating the report, spawn the `stepwise-research:citation-analyst` agent:
```
Task:
subagent_type: "stepwise-research:citation-analyst"
description: "Verify citations"
prompt: "Analyze the research report at [report_pathRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.