Deep Research — Adversarial Ensemble v2
Conduct autonomous multi-agent research on topic: $ARGUMENTS
Argument Parsing
Format: /research-ensemble [topic] or /research-ensemble [topic] [level] [domain]
Examples:
/research-ensemble kubernetes vs nomad → standard, auto-domain (tech)
/research-ensemble creatine safety deep → deep, auto-domain (health)
/research-ensemble creatine safety deep health → deep, health
/research-ensemble market analysis for SaaS standard business → standard, business
Defaults: level=standard, domain=auto-detect, report_language=English
Report language: Use REPORT_LANGUAGE if set. Otherwise honor an explicit language request from the user. If neither is present, write reports, headings, progress logs, and user summaries in English. Russian output is only for an explicit Russian request or REPORT_LANGUAGE=ru.
Level Definitions
| Level |
Agents |
Time |
When to use |
| standard |
6 (3 Scouts + Critic + Synthesizer + Fact-Checker) |
30-60 min |
Most research tasks |
| deep |
12-15 (full ensemble, 3 cycles with reflections) |
1-4 hours |
Serious research with verification, health, architecture decisions |
Domain Auto-Detection
If domain not specified, detect by keywords in topic:
| Keywords |
Domain |
| framework, API, library, database, architecture, kubernetes, docker, code, deploy, CI/CD, microservice, react, python, rust |
tech |
| market, competitors, pricing, startup, revenue, business model, ROI, SaaS, funding, GTM |
business |
| supplement, dosage, biomarker, sleep, exercise, nutrition, health, vitamin, protocol, longevity, creatine, omega |
health |
| firewall, SSH, vulnerability, CVE, hardening, pentest, encryption, TLS, WAF, security, DDoS |
security |
| everything else |
general |
Execution
Step 0: Preparation
- Parse arguments: extract
{TOPIC}, {LEVEL}, {DOMAIN}
- Create slug from topic: lowercase, replace spaces with underscores, truncate to 50 chars
- Determine
{REPORT_LANGUAGE} from REPORT_LANGUAGE, then explicit user request, then default English
- Create output directory structure:
research_output/{topic_slug}/
├── _PROGRESS_LOG.md
├── streams/
│ └── data/
├── deep_dives/ # deep level only
├── reviews/
├── figures/
- Initialize
_PROGRESS_LOG.md:
# Research Log
**Topic:** {TOPIC}
**Level:** {LEVEL}
**Domain:** {DOMAIN}
**Report language:** {REPORT_LANGUAGE}
**Started:** {TIMESTAMP}
**Output:** research_output/{topic_slug}/
- Read domain configuration:
${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/domains.md
- Read Exa search guide:
${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/exa-search-guide.md
- If domain=health AND level=deep: check for user profile at
./research_profiles/my_profile.md. If not found, research runs in universal mode without personalization.
Step 1: Dispatch Workflow
Based on {LEVEL}:
- standard → Read and follow
${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/standard-workflow.md
- deep → Read and follow
${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/deep-workflow.md
Step 2: Finalization
After workflow completes:
- Verify all expected files exist (
ls the output directory)
- Read the TL;DR section from synthesis.md
- Generate PDF report (same language as the report files; default English):
python3 "${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/generate-pdf-report.py" \
"research_output/{topic_slug}" "{TOPIC}" "{LEVEL}" "{DOMAIN}" "{REPORT_LANGUAGE}"
The script outputs the absolute path to the generated PDF. Save it as {PDF_PATH}.
- Show user summary:
## Research Complete
**Topic:** {TOPIC}
**Level:** {LEVEL} | **Domain:** {DOMAIN}
**Report language:** {REPORT_LANGUAGE}
**Output:** research_output/{topic_slug}/
### Files
- synthesis.md — main report
- reviews/_fact_check.md — fact check
- reviews/_critic_review.md — critic review
- unknowns_and_next.md — open questions and next steps
- **report.pdf** — final PDF report
[+ any additional files depending on level/domain]
### Key Takeaways
[TL;DR section from synthesis.md]
### PDF Report
{PDF_PATH}
Critical Rules
- Output language follows
{REPORT_LANGUAGE}. All agents write files, reports, conclusions, headings, and comments in the selected report language. Default is English. Use Russian only when the user explicitly asks for Russian or REPORT_LANGUAGE=ru. Exa/WebSearch queries may use English for better coverage. Proper names and technical terms may remain in their original language when useful.
- Every agent writes to files. Nothing is kept only in memory. If an agent fails to write, ORCHESTRATOR writes from the agent's output.
- Exa is primary search. WebSearch is a fallback. See exa-search-guide.md for strategies.
- All subagents launched via Agent tool with
subagent_type: "general-purpose" and run_in_background: true.
- Parallel launches in ONE message. Multiple Agent calls in a single message for independent agents.
- ORCHESTRATOR reads agent prompt templates from
references/agent-prompts/, substitutes variables, and passes as Agent prompt.
- Variable substitution: Replace
{TOPIC}, {DOMAIN}, {OUTPUT_DIR}, {STREAM_FILES}, {REASONING_STYLE}, {USER_PROFILE}, {REPORT_LANGUAGE} in agent prompts before dispatching.
Agent Prompt Loading
To dispatch an agent:
- Read the agent prompt template:
${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/agent-prompts/{role}.md
- Read domain-specific config from
domains.md for the current {DOMAIN}
- Substitute all
{VARIABLES} in the template with actual values
- Launch via Agent tool with the substituted prompt
- After completion, verify output file exists — if not, write from agent's returned output
1---2name: research-ensemble3description: Multi-agent adversarial research with Exa AI. Two levels: standard (3-5 agents, 30-60 min) and deep (10-15 agents, full ensemble with 3 cycles). Triggers: "research X", "исследуй", "deep research", "find out about", "compare options for", "deep dive into", "gather information on", "write a report about", "проанализируй", "разберись в", "investigate", "analyze topic", "сравни варианты", "изучи тему"4---56# Deep Research — Adversarial Ensemble v278Conduct autonomous multi-agent research on topic: **$ARGUMENTS**910## Argument Parsing1112Format: `/research-ensemble [topic]` or `/research-ensemble [topic] [level] [domain]`1314Examples:15- `/research-ensemble kubernetes vs nomad` → standard, auto-domain (tech)16- `/research-ensemble creatine safety deep` → deep, auto-domain (health)17- `/research-ensemble creatine safety deep health` → deep, health18- `/research-ensemble market analysis for SaaS standard business` → standard, business1920**Defaults:** level=standard, domain=auto-detect, report_language=English2122**Report language:** Use `REPORT_LANGUAGE` if set. Otherwise honor an explicit language request from the user. If neither is present, write reports, headings, progress logs, and user summaries in English. Russian output is only for an explicit Russian request or `REPORT_LANGUAGE=ru`.2324### Level Definitions2526| Level | Agents | Time | When to use |27|-------|--------|------|-------------|28| **standard** | 6 (3 Scouts + Critic + Synthesizer + Fact-Checker) | 30-60 min | Most research tasks |29| **deep** | 12-15 (full ensemble, 3 cycles with reflections) | 1-4 hours | Serious research with verification, health, architecture decisions |3031### Domain Auto-Detection3233If domain not specified, detect by keywords in topic:3435| Keywords | Domain |36|----------|--------|37| framework, API, library, database, architecture, kubernetes, docker, code, deploy, CI/CD, microservice, react, python, rust | **tech** |38| market, competitors, pricing, startup, revenue, business model, ROI, SaaS, funding, GTM | **business** |39| supplement, dosage, biomarker, sleep, exercise, nutrition, health, vitamin, protocol, longevity, creatine, omega | **health** |40| firewall, SSH, vulnerability, CVE, hardening, pentest, encryption, TLS, WAF, security, DDoS | **security** |41| everything else | **general** |4243## Execution4445### Step 0: Preparation46471. Parse arguments: extract `{TOPIC}`, `{LEVEL}`, `{DOMAIN}`482. Create slug from topic: lowercase, replace spaces with underscores, truncate to 50 chars493. Determine `{REPORT_LANGUAGE}` from `REPORT_LANGUAGE`, then explicit user request, then default English504. Create output directory structure:5152```53research_output/{topic_slug}/54├── _PROGRESS_LOG.md55├── streams/56│ └── data/57├── deep_dives/ # deep level only58├── reviews/59├── figures/60```61625. Initialize `_PROGRESS_LOG.md`:6364```markdown65# Research Log6667**Topic:** {TOPIC}68**Level:** {LEVEL}69**Domain:** {DOMAIN}70**Report language:** {REPORT_LANGUAGE}71**Started:** {TIMESTAMP}72**Output:** research_output/{topic_slug}/73```74756. Read domain configuration: `${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/domains.md`767. Read Exa search guide: `${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/exa-search-guide.md`778. If domain=health AND level=deep: check for user profile at `./research_profiles/my_profile.md`. If not found, research runs in universal mode without personalization.7879### Step 1: Dispatch Workflow8081Based on `{LEVEL}`:8283- **standard** → Read and follow `${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/standard-workflow.md`84- **deep** → Read and follow `${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/deep-workflow.md`8586### Step 2: Finalization8788After workflow completes:89901. Verify all expected files exist (`ls` the output directory)912. Read the TL;DR section from synthesis.md923. Generate PDF report (same language as the report files; default English):9394```bash95python3 "${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/generate-pdf-report.py" \96 "research_output/{topic_slug}" "{TOPIC}" "{LEVEL}" "{DOMAIN}" "{REPORT_LANGUAGE}"97```9899The script outputs the absolute path to the generated PDF. Save it as `{PDF_PATH}`.1001014. Show user summary:102103```104## Research Complete105106**Topic:** {TOPIC}107**Level:** {LEVEL} | **Domain:** {DOMAIN}108**Report language:** {REPORT_LANGUAGE}109**Output:** research_output/{topic_slug}/110111### Files112- synthesis.md — main report113- reviews/_fact_check.md — fact check114- reviews/_critic_review.md — critic review115- unknowns_and_next.md — open questions and next steps116- **report.pdf** — final PDF report117[+ any additional files depending on level/domain]118119### Key Takeaways120[TL;DR section from synthesis.md]121122### PDF Report123{PDF_PATH}124```125126## Critical Rules1271281. **Output language follows `{REPORT_LANGUAGE}`.** All agents write files, reports, conclusions, headings, and comments in the selected report language. Default is English. Use Russian only when the user explicitly asks for Russian or `REPORT_LANGUAGE=ru`. Exa/WebSearch queries may use English for better coverage. Proper names and technical terms may remain in their original language when useful.1292. **Every agent writes to files.** Nothing is kept only in memory. If an agent fails to write, ORCHESTRATOR writes from the agent's output.1303. **Exa is primary search.** WebSearch is a fallback. See exa-search-guide.md for strategies.1314. **All subagents launched via Agent tool** with `subagent_type: "general-purpose"` and `run_in_background: true`.1325. **Parallel launches in ONE message.** Multiple Agent calls in a single message for independent agents.1336. **ORCHESTRATOR reads agent prompt templates** from `references/agent-prompts/`, substitutes variables, and passes as Agent prompt.1347. **Variable substitution:** Replace `{TOPIC}`, `{DOMAIN}`, `{OUTPUT_DIR}`, `{STREAM_FILES}`, `{REASONING_STYLE}`, `{USER_PROFILE}`, `{REPORT_LANGUAGE}` in agent prompts before dispatching.135136## Agent Prompt Loading137138To dispatch an agent:1391401. Read the agent prompt template: `${CLAUDE_PLUGIN_ROOT}/skills/research-ensemble/references/agent-prompts/{role}.md`1412. Read domain-specific config from `domains.md` for the current `{DOMAIN}`1423. Substitute all `{VARIABLES}` in the template with actual values1434. Launch via Agent tool with the substituted prompt1445. After completion, verify output file exists — if not, write from agent's returned output