| description |
|---|
Execute a multi-expert research swarm - analyzes your prompt, spawns 3-10 specialized expert agents in parallel, and compiles a comprehensive report |
The user wants to research: $ARGUMENTS
Analyze the user's request to determine:- Topic Domain: What field/industry is this? (tech, science, business, creative, etc.)
- Complexity Level: Simple topic (3-4 experts) vs complex multi-faceted topic (8-10 experts)
- Required Perspectives: What angles need coverage?
- Technical/Implementation
- Strategic/Business
- User/UX perspective
- Research/Academic
- Industry/Practitioner
- Historical/Contextual
- Comparative/Competitive
- Future/Trend analysis
- Risk/Security
- Creative/Design
- Expert Count: Determine optimal number (3-10 based on complexity)
- Research Depth: What level of detail is needed?
<phase1_expert_design>
Create 3-10 expert personas, each with:
- Name: Memorable, professional name
- Title: Specific role/title
- Specialty: Area of expertise (2-5 words)
- Focus: What aspect of the topic they'll research
Expert Design Rules:
- Each expert must have a DISTINCT angle (no overlap)
- Cover the full spectrum of the topic
- Include both theoretical and practical perspectives
- Consider short-term and long-term implications
- Balance technical depth with accessibility
Example Expert Personas for a "Build a SaaS" prompt:
- Sarah Chen - Senior Software Architect - Backend Infrastructure & Scalability
- Marcus Johnson - Product Strategy Lead - Market Fit & Business Model
- Dr. Emily Rodriguez - UX Research Director - User Experience & Interface Design
- James Liu - DevOps Engineer - Deployment & CI/CD Pipelines
- Aisha Patel - Security Consultant - Data Protection & Compliance
- Thomas Berg - Financial Analyst - Pricing Strategy & Revenue Models
</phase1_expert_design>
<phase2_parallel_execution>
For each expert persona, create a sub-agent using the Task tool with subagent_type="librarian" or "general-purpose" based on the research needs.
Critical: Spawn ALL experts in a SINGLE MESSAGE for true parallel execution.
Each expert receives:
You are [Name], a [Title], specializing in [Specialty].
Your Task:
Research the following topic from YOUR specific expert perspective: $ARGUMENTS
Your Focus Areas:
- [Specific angle 1]
- [Specific angle 2]
- [Specific angle 3]
Research Requirements:
1. Thoroughly investigate your domain of expertise as it relates to this topic
2. Find real-world examples, best practices, and current trends
3. Identify potential challenges and solutions from your perspective
4. Provide actionable insights and recommendations
5. Include specific tools, frameworks, or methodologies when relevant
Output Format:
Provide your findings as a structured report with:
- **Executive Summary** (2-3 sentences)
- **Key Findings** (bullet points)
- **Detailed Analysis** (comprehensive coverage)
- **Recommendations** (actionable items)
- **Sources & References** (if applicable)
Constraints:
- Focus ONLY on your expertise area
- Be thorough but concise
- Include specific, concrete details (avoid vague generalizations)
- Consider both current state and future trends
</phase2_parallel_execution>
<phase3_report_compilation>
Once all expert agents complete their research, synthesize their findings into a unified report.
Report Structure:
# Comprehensive Research Report: [Topic]
**Generated:** [Timestamp]
**Research Prompt:** $ARGUMENTS
---
## 1. Executive Summary
[2-3 paragraph high-level overview synthesizing all expert findings]
---
## 2. Expert Panel Overview
### Experts Consulted:
| Expert | Title | Specialty | Focus Area |
|--------|-------|-----------|------------|
| [Name 1] | [Title 1] | [Specialty 1] | [Focus 1] |
| [Name 2] | [Title 2] | [Specialty 2] | [Focus 2] |
| ... | ... | ... | ... |
---
## 3. Individual Expert Reports
### 3.1 [Expert 1 Name] - [Title]
**Specialty:** [Specialty]
[Full expert report content]
---
### 3.2 [Expert 2 Name] - [Title]
**Specialty:** [Specialty]
[Full expert report content]
---
[Continue for all experts...]
---
## 4. Cross-Analysis & Synthesis
### 4.1 Common Themes
- [Theme 1 with supporting evidence from multiple experts]
- [Theme 2 with supporting evidence from multiple experts]
### 4.2 Conflicting Perspectives
- [Area of disagreement] - [Expert A view] vs [Expert B view]
- Resolution recommendation: [synthesized approach]
### 4.3 Critical Dependencies
- [Dependency 1]: How different aspects rely on each other
- [Dependency 2]: Sequential or parallel considerations
---
## 5. Strategic Recommendations
### Immediate Actions (0-30 days)
1. [Action 1 based on expert consensus]
2. [Action 2 based on expert consensus]
### Short-term Priorities (1-6 months)
1. [Priority 1]
2. [Priority 2]
### Long-term Considerations (6+ months)
1. [Consideration 1]
2. [Consideration 2]
---
## 6. Risk Assessment
| Risk | Severity | Mitigation Strategy | Expert Source |
|------|----------|-------------------|---------------|
| [Risk 1] | High/Med/Low | [Strategy] | [Expert Name] |
| [Risk 2] | High/Med/Low | [Strategy] | [Expert Name] |
---
## 7. Resource Requirements
### Personnel
- [Role needed] - [Expert recommendation]
### Tools & Technologies
- [Tool 1] - [Purpose and expert recommendation]
### Budget Considerations
- [Cost area] - [Expert input]
---
## 8. Conclusion
[Synthesized final thoughts and next steps]
---
**Report compiled from [N] expert research agents**
**Execution time:** [Duration]</phase3_report_compilation>
Save the final report to: ./.swarm-reports/[timestamp]-[topic-slug].md
Console Output Format:
═══════════════════════════════════════════════════════════════
🐝 SWARM RESEARCH COMPLETE
═══════════════════════════════════════════════════════════════
Topic: [Topic from $ARGUMENTS]
Experts Deployed: [N] parallel agents
Execution Time: [Duration]
Panel of Experts:
┌─────┬────────────────────┬──────────────────────────────┐
│ No. │ Expert │ Specialty │
├─────┼────────────────────┼──────────────────────────────┤
│ 1 │ [Name 1] │ [Specialty 1] │
│ 2 │ [Name 2] │ [Specialty 2] │
│ ... │ ... │ ... │
└─────┴────────────────────┴──────────────────────────────┘
📊 Report saved to: ./.swarm-reports/[filename].md
═══════════════════════════════════════════════════════════════
EXECUTIVE SUMMARY
═══════════════════════════════════════════════════════════════
[2-3 paragraph summary]
═══════════════════════════════════════════════════════════════
KEY RECOMMENDATIONS
═══════════════════════════════════════════════════════════════
• [Key rec 1]
• [Key rec 2]
• [Key rec 3]
═══════════════════════════════════════════════════════════════
- Read and deeply analyze the user's prompt: $ARGUMENTS
- Determine the domain, complexity, and required perspectives
- Design 3-10 expert personas with unique, complementary angles
- Define specific research focus for each expert
Spawn ALL expert agents in ONE message using multiple Task tool calls:
<example_execution> Use Task tool for Expert 1 (subagent_type="librarian", prompt="You are [Name]...") Use Task tool for Expert 2 (subagent_type="librarian", prompt="You are [Name]...") Use Task tool for Expert 3 (subagent_type="librarian", prompt="You are [Name]...") ... (All Task calls in a single message for true parallelization) </example_execution>
Wait for all agents to complete.
- Collect all expert reports
- Synthesize findings into the comprehensive report structure
- Identify cross-cutting themes, conflicts, and dependencies
- Generate strategic recommendations
- Create the reports directory if it doesn't exist:
!mkdir -p ./.swarm-reports/ - Save to file and present summary
<critical_rules>
MUST DO:
- Spawn all experts in a SINGLE MESSAGE for true parallel execution
- Give each expert a UNIQUE, SPECIFIC angle (no overlap)
- Include both theoretical and practical perspectives
- Synthesize findings - don't just concatenate reports
- Identify conflicts between experts and propose resolutions
- Create
./.swarm-reports/directory BEFORE attempting to save the report - Save full report to disk for reference
MUST NOT DO:
- Spawn experts sequentially (defeats the purpose)
- Create overlapping expert roles
- Simply concatenate reports without synthesis
- Ignore conflicts between expert perspectives
- Skip the cross-analysis phase
- Return only a summary without the full report
</critical_rules>
Example Usage:
User: /swarm How should I architect a real-time chat application for 100k concurrent users?
Expert Panel Generated (6 experts):
- Dr. Elena Volkov - Distributed Systems Architect - Scalability & Load Balancing
- Marcus Chen - WebSocket Specialist - Real-time Communication Protocols
- Sarah O'Brien - Database Performance Expert - Data Persistence & Caching
- James Park - DevOps Engineer - Infrastructure & Auto-scaling
- Aisha Rahman - Security Architect - Authentication & Data Protection
- Tom Bradley - Frontend Performance Lead - Client-side Optimization
Each expert researches their domain in parallel. Final report synthesizes all findings with specific recommendations for the chat architecture.
Another Example:
User: /swarm What are the best strategies for reducing customer churn in a B2B SaaS?
Expert Panel Generated (5 experts):
- Jennifer Walsh - Customer Success Strategist - Retention Programs & Health Scoring
- Dr. Michael Torres - Behavioral Data Analyst - Churn Prediction & Analytics
- Lisa Chang - Product-Led Growth Expert - In-app Engagement & Activation
- Robert Klein - Pricing Strategy Consultant - Pricing Model Impact on Retention
- Amanda Foster - Support Operations Manager - Customer Experience & Issue Resolution
<success_criteria>
- User prompt analyzed and understood
- 3-10 expert personas created with distinct angles
- All experts spawned in parallel (single message)
- All expert reports collected
- Cross-analysis performed (themes, conflicts, dependencies identified)
- Strategic recommendations generated
- Full report saved to
./.swarm-reports/ - Console summary presented with key findings
</success_criteria>