/magi-researchers:research-brainstormfrom magi-researchers
Generates and cross-validates research ideas using Gemini and Codex in parallel, then synthesizes results with Claude. Supports multiple domains, scoring modes, and depth levels.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /magi-researchers:research-brainstorm still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Generates and cross-validates research ideas using Gemini and Codex in parallel, then synthesizes results with Claude.
/research-brainstorm "research topic" [--domain physics|ai_ml|statistics|mathematics|paper] [--weights '{"novelty":0.4,...}'|adaptive] [--depth low|medium|high|max|auto] [--personas N] [--claude-only] [--substitute "Gemini -> Opus"]
$ARGUMENTS — The research topic and optional flags:
--domain — Research domain (physics, ai_ml, statistics, mathematics, paper). Auto-inferred if omitted.--weights — Scoring mode for finding ranking:
'{"novelty":0.4,"feasibility":0.2,"impact":0.2,"rigor":0.1,"scalability":0.1}'): Weighted scoring — dimensions novelty, feasibility, impact, rigor, scalability with values summing to 1.0.adaptive: Claude analyzes the prompt, adjusts domain defaults, and asks for user confirmation before scoring (see Step 0c).--depth — Controls review depth (default: medium):
low — Skip cross-review, go directly to synthesismedium — Standard one-shot cross-review (current behavior)high — Cross-review + evidence anchoring + adversarial debate roundmax — Hierarchical MAGI-in-MAGI: N persona subagents run parallel mini-MAGI pipelines, then meta-review + evidence anchoring + adversarial debate across all perspectivesauto — Adaptive depth: starts as medium, auto-escalates to high or deep based on cross-review disagreement signals (see T12)--personas N|auto — Number of domain-specialist subagents for --depth max (default: auto, range: 2-4). When auto, Claude analyzes the topic to determine the optimal persona count. Ignored for other depth levels.--claude-only — Replace all Gemini/Codex MCP calls with Claude Agent subagents. Use when external model endpoints are unavailable or for a Claude-only workflow. Two subagents with distinct cognitive styles (Creative-Divergent and Analytical-Convergent) ensure perspective diversity.--substitute "Agent -> Opus" — Replace a specific MAGI agent with a Claude (Opus) subagent. Accepted forms: "Gemini -> Opus", "Codex -> Opus". Can be specified multiple times. Use when a specific model hits rate limits but other models are still available. The substituted agent uses the same cognitive style mapping as --claude-only mode. If both agents are substituted, functionally equivalent to --claude-only. Mutually exclusive with --claude-only (if both provided, --claude-only takes precedence).model: "gemini-3.1-pro-preview" (preferred)model: "gemini-2.5-pro" (fallback)--substitute "Gemini -> Opus")model: "gpt-5.4" for all Codex MCP calls. Use mcp__codex-cli__brainstorm for ideation, mcp__codex-cli__ask-codex for analysis/review. If Codex fails 2+ times, fall back to a Claude Opus subagent with T1-AC cognitive style (same as --substitute "Codex -> Opus").@filepath in the prompt parameter to pass saved artifacts (e.g., @brainstorm/codex_ideas.md)
instead of pasting file content inline. The CLI tools read files directly, preventing context truncation.WebSearch tool directlysearch: true to mcp__gemini-cli__ask-gemini or mcp__gemini-cli__brainstorm callssearch: true to mcp__codex-cli__ask-codex or mcp__codex-cli__brainstorm callsWhen --claude-only is active, all Gemini/Codex MCP tool calls are replaced with Claude Agent subagents (subagent_type: general-purpose). The table below maps each original call to its replacement:
| Original Call | Replacement | Cognitive Style |
|---|---|---|
mcp__gemini-cli__brainstorm | Agent subagent A | Creative-Divergent: unconventional connections, "What if?" scenarios, wide exploration, questioning assumptions |
mcp__codex-cli__brainstorm | Agent subagent B | Analytical-Convergent: step-by-step feasibility, established methodologies, deep evaluation, practical constraints, risk assessment |
mcp__gemini-cli__ask-gemini | Agent subagent A | Same Creative-Divergent style |
mcp__codex-cli__ask-codex | Agent subagent B | Same Analytical-Convergent style |
Key rules for claude-only mode:
Read tool to access files (no @filepath syntax).gemini_ideas.md, codex_ideas.md, etc.) — add a header > Source: Claude Agent subagent (claude-only mode, {style}) to each output file.--depth max internal subagents: Within each persona's mini-MAGI pipeline, use Expansive Explorer (replaces Gemini) and Grounded Builder (replaces Codex) cognitive styles to maintain internal diversity.--substitute)When --substitute is used, only the specified agent's MCP calls are replaced with Claude Agent subagents. The replacement uses the same cognitive style and prompt structure as --claude-only mode:
| Substituted Agent | Replacement Cognitive Style |
|---|---|
| Gemini → Opus | Creative-Divergent (same as claude-only Gemini replacement) |
| Codex → Opus | Analytical-Convergent (same as claude-only Codex replacement) |
Key differences from --claude-only:
gemini_ideas.md, codex_ideas.md, etc.). Add header > Source: Claude Agent subagent (substituted for {Agent}, {CognitiveStyle}) to files written by substituted agents.--depth max internal subagents: the substituted agent uses Expansive Explorer (if Gemini) or Grounded Builder (if Codex).Substitution shorthand: Throughout this document, every
> **If \--claude-only`**:block also applies when the relevant agent is substituted via--substitute`. When only one agent is substituted, apply the replacement only to that agent's call — the other agent's call remains unchanged as an MCP tool call. Both can still execute in parallel.
Templates T1–T13 are defined in references/templates.md. Read that file when you need template definitions. Quick reference:
| ID | Name | Purpose |
|---|---|---|
| T1 | Cognitive Styles | CD, AC, EE, GB style directives |
| T2 | Review Instructions | T2-Science, T2-Feasibility review format with AGREE/DISAGREE/INSUFFICIENT verdicts |
| T3 | DCR Debate Framework | Defend/Concede/Revise + Concession Tax + Hybrid Tribunal |
| T4 | Mechanism Requirement | 1-2 sentence mechanism for each idea |
| T5 | Subagent Output Convention | File naming and header format |
| T6 | Subagent Prompt Structure | 6-part prompt template for claude-only subagents |
| T7 | Finding Summary Footer | 6-field compact reference block per finding |
| T8 | Synthesis Epilogue | Research Gaps, Non-Recommendations, Next Three Steps |
| T9 | Pre-flight Query | OpenAlex + WebSearch query format (uses scripts/openalex_search.py) |
| T10 | Persona Briefing | Persona-specific filtered briefing format |
| T11 | Evidence Anchoring | Disputed claim search + classification format |
| T12 | Depth Escalation Criteria | Contention score calculation + decision matrix (uses scripts/parse_verdicts.py) |
| T13 | Research Direction Document | 8-section structured research framing document (Step 0a output) |
When writing mathematical expressions in any output document (brainstorm ideas, synthesis, etc.):
$...$ for short expressions within a sentence (e.g., $x^2 + y^2 = r^2$)$$ on its own line, with the equation on a separate line:
$$
\mathcal{L} = -\frac{1}{4} F_{\mu\nu} F^{\mu\nu} + \bar{\psi}(i\gamma^\mu D_\mu - m)\psi
$$
$$..equation..$$ on a single line — always use line breaksHard requirement: Unicode math symbols (σ₁, π₁, ℝ, ∈, ≈, ², etc.) are NOT acceptable in any output document. They render inconsistently across viewers and break PDF export. Always use LaTeX equivalents:
$\sigma_1$,$\pi_1$,$\mathbb{R}$,$\in$,$\approx$,$^2$.
ALL artifacts MUST be written under {output_dir}/. Never write brainstorm files (*.md, *.json) directly to the project root, the user's working directory, or any path outside outputs/.
{output_dir} is the absolute path stored in .workspace.json at the output directory root.{output_dir} is uncertain (e.g., after context compression), recover it by reading .workspace.json:
Glob for outputs/*/.workspace.json. If multiple matches found, prefer the one whose topic field matches the current research topic. If still ambiguous, ask the user to confirm the output directory. If no .workspace.json is found, stop and ask the user to provide the output directory explicitly.Read the file and extract output_dir.{output_dir} path from .workspace.json. Never pass a relative path.{output_dir}/brainstorm/{filename} (absolute). Never use bare filenames like gemini_ideas.md — always use {output_dir}/brainstorm/gemini_ideas.md. This prevents subagents from writing to the user's working directory (CWD) instead of the output directory.Only the main agent (Layer 0) creates directories. All subagents (Layer 1 persona subagents, Layer 2 meta-reviewers, and any sub-subagents they spawn) are consumers of a pre-created directory structure, never creators.
Subagents MUST NOT:
outputs/ directories, .workspace.json files, or brainstorm/ folders.outputs/ — all persona_{i}/ subdirectories are pre-created by the main agent before subagent launch.brainstorm/ or any other directory in the project root or CWD.SKILL.md Step 0 instructions as applicable to themselves — subagents execute only their assigned pipeline steps (A through E for persona subagents, or the specific review/debate task for Layer 2 subagents).Subagent prompts MUST include this explicit negative instruction:
"DO NOT create any directories. DO NOT run Step 0 setup. All directories already exist. Write files ONLY to the exact absolute paths listed below."
Main agent pre-creates all directories before launching subagents:
--depth max: brainstorm/persona_{1..N}/ directories are created before Step 1-max-a.brainstorm/ is created in Step 0.Post-completion audit (main agent responsibility): After all subagents complete, the main agent MUST:
Glob for outputs/*_v*/ and compare against the expected single output directory.brainstorm/ directory in the project root.When this skill is invoked, follow these steps exactly:
Pipeline context detection: If this skill was invoked as a sub-skill from /research (i.e., {output_dir} was provided by the calling context and .workspace.json already exists at the output root), skip directory creation (items 2-8 below). Read {output_dir} from .workspace.json and use {output_dir}/brainstorm/ as the working directory. Only create a new versioned directory when invoked standalone.
Parse the research topic from $ARGUMENTS. If a --domain flag is provided, note the domain (physics, ai_ml, statistics, mathematics, paper). Otherwise, infer the domain from the topic.
Create the output directory: outputs/{sanitized_topic}_{YYYYMMDD}_v{N}/brainstorm/
outputs/{sanitized_topic}_{YYYYMMDD}_v*/ and set N = max existing + 1 (start at v1)..workspace.json at the output directory root (outputs/{sanitized_topic}_{YYYYMMDD}_v{N}/.workspace.json):
{
"output_dir": "{absolute_path_to_output_dir}",
"topic": "{original_topic}",
"domain": "{domain}",
"created_at": "{ISO-8601 timestamp}"
}
Use pwd or equivalent to resolve the absolute path. This file anchors all subsequent file writes.If a domain template exists at ${CLAUDE_PLUGIN_ROOT}/templates/domains/{domain}.md, read it for context.
Parse --weights — All weights.json files MUST conform to the schema at schemas/weights.schema.json. The exact structure has two required top-level keys (weights and _meta) with no additional properties:
--weights is a JSON object: Validate that keys are exactly {novelty, feasibility, impact, rigor, scalability} and values sum to 1.0. Save immediately to brainstorm/weights.json:
{
"weights": {
"novelty": 0.40,
"feasibility": 0.20,
"impact": 0.20,
"rigor": 0.10,
"scalability": 0.10
},
"_meta": {
"method": "explicit",
"domain": "<detected domain>"
}
}
Skip Step 0c entirely.--weights adaptive: Load domain defaults as a baseline reference only (do not save yet — Step 0c will handle saving after user confirmation):
physics: {"novelty": 0.30, "feasibility": 0.15, "impact": 0.25, "rigor": 0.20, "scalability": 0.10}ai_ml: {"novelty": 0.25, "feasibility": 0.25, "impact": 0.25, "rigor": 0.10, "scalability": 0.15}statistics: {"novelty": 0.25, "feasibility": 0.20, "impact": 0.20, "rigor": 0.25, "scalability": 0.10}mathematics: {"novelty": 0.35, "feasibility": 0.10, "impact": 0.20, "rigor": 0.30, "scalability": 0.05}paper: {"novelty": 0.20, "feasibility": 0.25, "impact": 0.30, "rigor": 0.15, "scalability": 0.10}--weights is omitted (default — holistic mode): Save immediately to brainstorm/weights.json:
{
"weights": null,
"_meta": {
"method": "holistic",
"domain": "<detected domain>"
}
}
Holistic format is exactly the above — weights is null (not an empty object, not omitted), _meta contains only method and domain. No other keys or variations.
Skip Step 0c entirely. In Step 1c / Step 1-max-d, Claude will rank findings using holistic expert judgment instead of numeric weighted scoring.Parse --depth: Accept low, medium, high, max, or auto (default: medium).
low — Skip Step 1b (cross-review), go directly to Step 1c (synthesis)medium — Standard one-shot cross-review (current default behavior)high — Cross-review + evidence anchoring + adversarial debate (Step 1b-ev + Step 1b+)max — Hierarchical MAGI-in-MAGI pipeline (Steps 1-max-a through 1-max-d replace Steps 1a/1b/1b+/1c)auto — Starts as medium, then escalates based on T2 disagreement signals (see Step 1b-esc and T12). Pre-flight (Step 0d) always runs for auto.Parse --personas N|auto: Accept integer 2-4 or the string auto (default: auto). Only used when --depth max; ignored otherwise.
auto: Defer persona count determination to Step 0b, where Claude analyzes the topic's complexity, number of distinct sub-disciplines, and methodological diversity to select the optimal N (2-4).Parse --claude-only: Boolean flag (default: false). When present, all Gemini/Codex MCP calls are replaced with Claude Agent subagents. See the Claude-Only Mode section above for the replacement table and cognitive style definitions.
Parse --substitute: Accept zero or more --substitute "Agent -> Opus" flags. Valid agent names: Gemini, Codex. Valid target: Opus. When specified, the named agent's MCP calls are replaced with Claude Agent subagents using the same cognitive style mappings as --claude-only mode (see Agent Substitution section). --substitute and --claude-only are mutually exclusive — if both are provided, --claude-only takes precedence. If both "Gemini -> Opus" and "Codex -> Opus" are specified, treat as equivalent to --claude-only.
Runs at all depths, unconditionally. This step produces a structured Research Direction Document through user-driven dialogue and AI-powered literature survey. The document serves as the foundation for all subsequent pipeline steps (persona casting, weight configuration, pre-flight, and brainstorming).
Phase 1 — Core Framing (user-driven dialogue):
Extract the user's research intent through focused questions. These questions target the document sections, not abstract assessment criteria.
Pre-assessment: Before asking questions, internally scan the user's original prompt for content that maps to document sections:
| Document Section | Detection Signals | If Present |
|---|---|---|
| Research Question | Clear interrogative, "I want to study X" | Pre-fill, confirm only |
| Motivation | "because", "gap in", "problem is" | Pre-fill, confirm only |
| Hypothesis | "I expect", "hypothesis is", "should show" | Pre-fill, skip |
| Expected Results | Specific metrics, predictions | Pre-fill, skip |
| Methodology | "using X method", "approach is" | Pre-fill, skip |
| Constraints | "limited to", "within", "only consider" | Pre-fill, skip |
Question rules:
Question bank (asked in order, skipping as needed):
Research Question (if not detected): "어떤 것을 알고 싶으신가요? 다음 중 가장 가까운 것은?"
Motivation (if not detected): "이 연구의 동기는 무엇인가요?"
Hypothesis (if not detected): "어떤 결과를 예상하시나요? 대략적인 추측도 좋습니다."
Methodology Scope (if not detected): "어떤 유형의 조사를 계획하시나요?"
Constraints (always ask): "중요한 경계 조건이 있나요? (포함/제외할 분야, 데이터셋, 계산 자원, 시간 제약 등)"
Phase 2 — Literature & Landscape Survey (AI-driven):
After Phase 1 dialogue completes, systematically search the existing literature using Phase 1 answers as query material.
Construct search queries from Phase 1 answers: extract key terms from the research question, methodology scope, and any domain-specific concepts mentioned.
Execute searches in parallel:
OpenAlex — primary topic search:
uv run python ${CLAUDE_PLUGIN_ROOT}/skills/research-brainstorm/scripts/openalex_search.py \
"{refined_research_question}" \
--filter "publication_year:>2021,type:article|review" \
--limit 10 --format md
OpenAlex — methodology search (if specific methodology was identified in Phase 1):
uv run python ${CLAUDE_PLUGIN_ROOT}/skills/research-brainstorm/scripts/openalex_search.py \
"{methodology_terms} {domain_terms}" \
--filter "publication_year:>2020" --sort "relevance_score:desc" \
--limit 5 --format md
WebSearch — recent developments: "{topic} recent advances 2024 2025 2026"
WebSearch — methodology (if specific methods identified): "{method_name} {domain} limitations comparison"
Source cap: 15 OpenAlex papers (combined, deduplicated) + 5 web sources = 20 total max.
Sparse result fallback (3-tier):
AI analysis — from gathered results, extract:
Phase 3 — Document Draft:
Synthesize Phase 1 user input with Phase 2 literature analysis into a structured Research Direction Document. Follow the T13 template format.
Section population:
| Section | Source |
|---|---|
| 1. Research Question | Phase 1 (user-provided or refined) |
| 2. Motivation & Context | Phase 1 + Phase 2 contextual grounding |
| 3. Hypothesis | Phase 1 (user-provided), contextualized with Phase 2 literature |
| 4. Expected Results | Phase 1 + Phase 2 (what similar work has found) |
| 5. Prior Work | Phase 2 (literature search results, 5-10 papers) |
| 5a. Methodological Landscape | Phase 2 (AI analysis of dominant approaches) |
| 6. Methodology Candidates | Phase 2 (informed by Phase 1 methodology scope) |
| 7. Success Criteria | Derived from sections 3+4 (Claude drafts, user validates in Phase 4) |
| 8. Constraints & Scope | Phase 1 (user-provided) |
Draft principles:
Save draft to brainstorm/research_direction.md.
Phase 4 — Review & Refinement (user dialogue):
Output:
Save brainstorm/research_direction.md with the following format (T13):
# Research Direction: {title}
## 1. Research Question
> {one-sentence refined research question}
## 2. Motivation & Context
{Why this question matters. What gap does it address? 2-3 paragraphs.}
## 3. Hypothesis
> {Falsifiable hypothesis or expected pattern/relationship.}
## 4. Expected Results
{What confirms the hypothesis? What refutes it?
Specific metrics, phenomena, or qualitative outcomes.}
## 5. Prior Work
| # | Paper | Year | Cited | Relevance |
|---|-------|------|-------|-----------|
| 1 | {title} | {year} | {N} | {1-2 sentence relevance note} |
| ... | ... | ... | ... | ... |
### 5a. Methodological Landscape
{Dominant approaches, strengths, limitations. 2-3 paragraphs.}
## 6. Methodology Candidates
| Approach | Description | Pros | Cons | Feasibility |
|----------|-------------|------|------|-------------|
| {name} | {2-3 sentences} | {advantages} | {limitations} | {High/Medium/Low} |
| ... | ... | ... | ... | ... |
## 7. Success Criteria
{Concrete, measurable evaluation criteria.}
## 8. Constraints & Scope
### In Scope
{...}
### Out of Scope
{...}
### Resource Constraints
{...}
---
## Metadata
- **Original prompt**: {user's original input verbatim}
- **Domain**: {detected or specified domain}
- **Document version**: {1, incremented after Phase 4 revisions}
- **Phase 2 sources**: {OpenAlex N papers + Web M sources}
Update .workspace.json: set topic to the Section 1 Research Question. If different from the original prompt, preserve the original as original_topic.
After the Research Direction Document is finalized, Claude analyzes the document and domain to assign specialist personas.
Persona definition format (all depth levels):
--depth max, optional for others)Personas complement the domain template — they do not override it.
If --claude-only: Relabel personas — "Gemini persona" → "Subagent A (T1-CD)", "Codex persona" → "Subagent B (T1-AC)". For --depth max internal roles: "Gemini" → "Expansive Explorer (T1-EE)", "Codex" → "Grounded Builder (T1-GB)". Include cognitive style directives in the persona file.
For --depth low|medium|high|auto (2 personas):
brainstorm/research_direction.md. Analyze the document's methodology candidates (Section 6), research gaps (Section 5a), and constraints (Section 8) to identify the key tensions and perspectives needed.brainstorm/personas.md.For --depth max (N personas):
--personas auto): Use the Research Direction Document's methodology candidates and prior work breadth to inform the decision.
brainstorm/personas.md.Skip unless
--weights adaptive: This step only runs when--weights adaptiveis explicitly specified. If--weightsis omitted (holistic mode) or a JSON object (explicit mode), weights are already saved in Step 0.
When --weights adaptive is specified, Claude analyzes the Research Direction Document to recommend topic-appropriate weights:
Analyze brainstorm/research_direction.md for research-nature signals. The structured document provides stronger signals than the raw topic string:
| Signal | Detection Source | Effect |
|---|---|---|
| Theoretical/Formal | Section 3 (hypothesis mentions proof/theorem), Section 6 (analytical methods) | rigor↑, feasibility↓ |
| Experimental/Empirical | Section 4 (empirical metrics), Section 6 (experimental methods) | feasibility↑, rigor↑ |
| Applied/Engineering | Section 2 (practical motivation), Section 8 (deployment constraints) | feasibility↑, scalability↑ |
| Exploratory/Innovative | Section 5a (identified gaps), Section 3 (novel hypothesis) | novelty↑, feasibility↓ |
| Practicality emphasis | Section 7 (practical success criteria) | feasibility↑, scalability↑ |
| Rigor emphasis | Section 7 (formal verification criteria) | rigor↑ |
| Impact emphasis | Section 2 (transformative motivation) | impact↑, novelty↑ |
| Narrow scope | Section 8 (tight constraints, single method) | rigor↑, feasibility↑ |
| Broad scope | Section 6 (multiple methodology candidates), Section 5 (interdisciplinary papers) | novelty↑, impact↑ |
Generate recommended weights: Starting from the domain baseline loaded in Step 0, apply adjustments based on detected signals:
Present a comparison table to the user:
Detected signals: [list of signals found in the research direction document]
| Dimension | Domain Default | Recommended | Adjustment Reason |
|---------------|---------------|-------------|------------------------------|
| novelty | 0.30 | 0.35 | +0.05 (exploratory research) |
| feasibility | 0.15 | 0.10 | -0.05 (theoretical focus) |
| impact | 0.25 | 0.25 | (no change) |
| rigor | 0.20 | 0.25 | +0.05 (formal methods) |
| scalability | 0.10 | 0.05 | -0.05 (narrow scope) |
After computing final weights, verify they sum to exactly 1.00 (round each to 2 decimal places if necessary; re-normalize if rounding causes drift). Display the sum in the comparison table.
AskUserQuestion:
If the user provides custom weights: validate that (1) keys are exactly {novelty, feasibility, impact, rigor, scalability}, and (2) values sum to 1.0 (within tolerance 0.01). If invalid, present the error and ask again. Maximum 1 retry; on continued failure, fall back to domain defaults with a note in weights.json.
brainstorm/weights.json with metadata based on the user's choice:
{
"weights": { <chosen weights> },
"_meta": {
"method": "<adaptive-recommended|domain-default|custom>",
"domain": "<detected domain>",
"domain_defaults": { <original domain baseline> },
"signals_detected": ["theoretical work", "narrow scope", ...],
"adjustments_applied": {
"rigor": "+0.05 (theoretical focus)",
"feasibility": "-0.05 (theoretical focus)"
}
}
}
method = "adaptive-recommended"method = "domain-default", signals_detected and adjustments_applied are still recorded for traceabilitymethod = "custom"--depth medium|high|max|auto)Skip if
--depth low: Pre-flight only runs at medium depth or above.
Create persona-specific briefings by combining the Research Direction Document's literature (Step 0a Phase 2) with targeted persona-specific searches. Do not re-run the same broad topic search that Phase 2 already executed — Pre-flight supplements, not duplicates.
Load baseline literature from brainstorm/research_direction.md (Sections 5 and 5a). This provides the general literature context already gathered in Step 0a Phase 2.
Persona-targeted searches — for each persona in brainstorm/personas.md, construct 1-2 search queries from the intersection of:
Execute in parallel:
"{theory_term} {domain} formal analysis"; for an empirical persona: "{method} benchmark comparison experimental").Save combined context to brainstorm/preflight_context.md following the T9 format:
research_direction.md Section 5) + persona-targeted new papers (deduplicated, clearly labeled).Create persona-specific briefings per T10:
--depth medium|high|auto: Create brainstorm/briefing_gemini.md and brainstorm/briefing_codex.md, each filtered by the persona's reasoning mandate and guiding question from brainstorm/personas.md.--depth max: Create brainstorm/briefing_persona_{i}.md for each of the N personas, filtered by each persona's expertise areas and guiding question.If
--claude-only:
- For
--depth medium|high|auto(2-model): Createbrainstorm/briefing_subagent_a.md(Creative-Divergent focus) andbrainstorm/briefing_subagent_b.md(Analytical-Convergent focus) with the same filtering logic.- For
--depth max(N-persona): Createbrainstorm/briefing_persona_{i}.mdfor each persona (same as non-claude-only mode — briefing is filtered by persona expertise, not by model cognitive style).
Validation: Verify preflight_context.md contains at least 3 academic references (combining Phase 2 and persona-targeted results). If the combined results are still sparse, note "Pre-flight: Limited literature context" but proceed. If no academic references exist at all, note "Pre-flight: No relevant context found — brainstorm will proceed without literature grounding" and skip briefing creation.
Execute these two calls simultaneously (in the same message). Prepend the assigned persona from brainstorm/personas.md to each prompt:
Each call includes: persona context, guiding question, domain template (if exists, via @{domain_template_path}), Research Direction Document (via @{output_dir}/brainstorm/research_direction.md), persona-specific briefing (if Step 0d ran, via @{output_dir}/brainstorm/briefing_{persona}.md), and T4 mechanism requirement. Use ideaCount: 12, includeAnalysis: true, methodology: "auto". Add to each prompt: "Read the Research Direction Document for the full research framing, hypothesis, and constraints. Generate ideas that are responsive to this research direction."
Each brainstorm prompt must begin with: "Before listing ideas, state in one sentence: 'Scope: [how you interpret this question's boundary and focus].'" This scope declaration is collected for divergence checking in synthesis.
Gemini: mcp__gemini-cli__brainstorm, model: "gemini-3.1-pro-preview" — Generate diverse, creative research ideas. Consider theoretical foundations, practical applications, novel approaches, and potential breakthroughs. If brainstorm/briefing_gemini.md exists, include via @{output_dir}/brainstorm/briefing_gemini.md and add: "Use the attached literature briefing as context — it highlights failure cases and unexplored alternatives. Let it inform but not constrain your ideation."
Codex: mcp__codex-cli__brainstorm, model: "gpt-5.4" — Generate implementation-focused research ideas. Consider feasibility, existing tools/libraries, computational requirements, and step-by-step approaches. If brainstorm/briefing_codex.md exists, include via @{output_dir}/brainstorm/briefing_codex.md and add: "Use the attached literature briefing as context — it highlights existing implementations and practical constraints. Let it inform but not constrain your ideation."
Note: If Codex MCP is unavailable, fall back to a Claude Opus subagent with T1-AC cognitive style (same as
--substitute "Codex -> Opus"), using the Codex persona and implementation-focused framing per T6.
If
--claude-only: Replace both calls with two Agent subagents (simultaneously), per T6:
- Subagent A (T1-CD, Gemini persona): Generate 12 diverse, creative research ideas. Consider theoretical foundations, practical applications, novel approaches, and potential breakthroughs. Apply T4. If
brainstorm/briefing_subagent_a.mdexists, include it via Read and add: "Use the attached literature briefing as context — let it inform but not constrain your ideation." Save tobrainstorm/gemini_ideas.mdper T5.- Subagent B (T1-AC, Codex persona): Generate 12 implementation-focused research ideas. Consider feasibility, existing tools/libraries, computational requirements, and step-by-step approaches. Apply T4. If
brainstorm/briefing_subagent_b.mdexists, include it via Read. Save tobrainstorm/codex_ideas.mdper T5.
Save results to:
brainstorm/gemini_ideas.md — Gemini's (or Subagent A's) raw output with header noting source, persona, and timestampbrainstorm/codex_ideas.md — Codex's (or Subagent B's) raw output with header noting source, persona, and timestampPost-generation validation (always, all depths):
After saving gemini_ideas.md and codex_ideas.md, verify each file is non-empty and contains at least 3 idea entries (separated by --- or numbered headers). If either file is empty or truncated:
--depth medium, --depth high, or --depth auto)If
--depth low: Skip this step entirely and proceed to Step 1c.
After both brainstorming results are saved, execute these two calls simultaneously. Prepend the assigned persona to each review prompt:
Gemini reviews Codex ideas (Round 1):
mcp__gemini-cli__ask-gemini(
prompt: "[Persona: {gemini_persona_name} — {gemini_persona_expertise}]\n\nApply T2-Science review to the following research ideas:\n\n@{output_dir}/brainstorm/codex_ideas.md",
model: "gemini-3.1-pro-preview" // fallback: "gemini-2.5-pro" → Claude
)
Codex reviews Gemini ideas (Round 1):
mcp__codex-cli__ask-codex(
prompt: "[Persona: {codex_persona_name} — {codex_persona_expertise}]\n\nApply T2-Feasibility review to the following research ideas:\n\n@{output_dir}/brainstorm/gemini_ideas.md",
model: "gpt-5.4"
)
Note: If Codex MCP is unavailable, fall back to a Claude Opus subagent with T1-AC cognitive style (same as
--substitute "Codex -> Opus"), using the Codex persona per T6.
If
--claude-only: Replace both calls with two Agent subagents (simultaneously), per T6:
- Subagent A (T1-CD, Gemini persona): Read
brainstorm/codex_ideas.md. Apply T2-Science review. Save tobrainstorm/gemini_review_of_codex.mdper T5.- Subagent B (T1-AC, Codex persona): Read
brainstorm/gemini_ideas.md. Apply T2-Feasibility review. Save tobrainstorm/codex_review_of_gemini.mdper T5.
Save results to:
brainstorm/gemini_review_of_codex.mdbrainstorm/codex_review_of_gemini.md--depth auto only)Skip unless
--depth auto: Readreferences/depth_auto.mdfor the full step definition. Usesscripts/parse_verdicts.pyto count verdicts and calculate contention score. Decision: contention < 0.30 → stay medium; 0.30-0.50 → escalate to high; >= 0.50 → escalate to deep.
--depth high+ or escalated from auto)Skip if
--depth lowor--depth medium(unless escalated from--depth auto).
After cross-review, search for real evidence on disputed claims per §EvidenceAnchoring and T11:
Read both review files and extract all ideas with DISAGREE or INSUFFICIENT verdicts.
claim_evidence.md is created. This can happen when --depth high is explicitly set on a topic with strong cross-model agreement.Prioritize: Select up to 5 disputed claims — DISAGREE first, then INSUFFICIENT; within each category, prioritize by idea ranking position.
For each disputed claim (execute searches in parallel where possible):
Save to brainstorm/claim_evidence.md per T11 format.
Summary statistics: At the end of claim_evidence.md, append:
## Evidence Summary
- Claims investigated: {n}
- Claims with supporting evidence: {n}
- Claims with contradicting evidence: {n}
- Claims with no direct evidence: {n}
If
--claude-only: All WebFetch and WebSearch calls are made by the main agent (subagents cannot use these tools). Complete evidence gathering before proceeding to debate.
--depth high or escalated from auto)If
--depth lowor--depth medium(and not escalated): Skip this step entirely.
After Round 1 cross-review (and evidence anchoring if --depth high+), Claude identifies the top 3 points of disagreement between Gemini and Codex (e.g., conflicting feasibility assessments, divergent novelty ratings, opposing recommendations). Save the disagreement summary to brainstorm/disagreements.md before the debate calls.
Execute Round 2 simultaneously:
Round 2 — Defend/Concede/Revise (execute simultaneously):
Each call includes: persona context, @{output_dir}/brainstorm/disagreements.md, T3 debate framework, own review, opposing review, and @{output_dir}/brainstorm/claim_evidence.md (if Step 1b-ev ran — instruct models to cite real evidence when defending or conceding).
mcp__gemini-cli__ask-gemini, model: "gemini-3.1-pro-preview", refs: @{output_dir}/brainstorm/gemini_review_of_codex.md + @{output_dir}/brainstorm/codex_review_of_gemini.md + (if exists) @{output_dir}/brainstorm/claim_evidence.mdmcp__codex-cli__ask-codex, model: "gpt-5.4", refs: @{output_dir}/brainstorm/codex_review_of_gemini.md + @{output_dir}/brainstorm/gemini_review_of_codex.md + (if exists) @{output_dir}/brainstorm/claim_evidence.mdIf
--claude-only: Replace both debate calls with two Agent subagents (simultaneously), per T6:
- Subagent A (T1-CD, Gemini persona): Read
brainstorm/disagreements.md,brainstorm/gemini_review_of_codex.md,brainstorm/codex_review_of_gemini.md, and (if exists)brainstorm/claim_evidence.md. Apply T3 debate framework. Cite real evidence fromclaim_evidence.mdwhen defending or conceding. Save tobrainstorm/debate_round2_gemini.mdper T5.- Subagent B (T1-AC, Codex persona): Read
brainstorm/disagreements.md,brainstorm/codex_review_of_gemini.md,brainstorm/gemini_review_of_codex.md, and (if exists)brainstorm/claim_evidence.md. Apply T3 debate framework. Cite real evidence fromclaim_evidence.mdwhen defending or conceding. Save tobrainstorm/debate_round2_codex.mdper T5.
Save results to:
brainstorm/debate_round2_gemini.mdbrainstorm/debate_round2_codex.md--depth auto, escalation to deep only)Skip unless
--depth autoescalated to deep. Readreferences/depth_auto.mdfor the full step definition. Pro/con argument pairs for the top 3 contested ideas, with role alternation to prevent positional bias.
--depth max only)If
--depthis notmax: Skip entirely. Use Steps 1a/1b/1b+/1c instead. Readreferences/depth_max.mdfor the complete Layer 1-3 pipeline:
- Step 1-max-a: Spawn N parallel persona subagents, each running a mini-MAGI (brainstorm + cross-review + conclusion)
- Step 1-max-b: Collect and consolidate persona outputs into
all_conclusions.md- Step 1-max-c: Meta-review + evidence anchoring (Phase B+) + adversarial debate
- Step 1-max-d: MELCHIOR Philosopher-Arbiter synthesis with Prior Declaration
If
--depth max: Skip — synthesis is produced by Step 1-max-d inreferences/depth_max.md.
MELCHIOR Active Synthesis Protocol (depth-conditional):
You are MELCHIOR — the third personality in the MAGI triad, not a neutral aggregator. Your role varies by depth:
--depth low — MELCHIOR as Curator: Select and present findings. You MUST add at least one [MELCHIOR] original observation that neither model raised. For each finding not selected for the top list, state why it was excluded.--depth medium — MELCHIOR as Critical Editor: You MUST revise at least one substantive claim from each model (a revision changes the recommended action, predicted outcome, or confidence level — phrasing changes do not count). Apply Convergence Interrogation (see below). Mark all original contributions with [MELCHIOR].--depth high — MELCHIOR as Adversarial Critic: For the top 2 findings, construct the strongest possible objection. If the objection is fatal, demote the finding and promote the next candidate. Rankings must reflect adversarial survival, not just model consensus. When claim_evidence.md exists, cite real-world evidence in objections.--depth auto — MELCHIOR role is determined by the escalation decision from Step 1b-esc:
--depth medium above)--depth high above)deep_investigation_{i}_pro.md and deep_investigation_{i}_con.md and adjudicate which side has stronger evidence; (2) explicitly state whether the deep investigation changed the idea's ranking vs. the pre-investigation assessment; (3) apply a stricter adversarial threshold — objections must cite real-world evidence from claim_evidence.md when available, not just model reasoning.Convergence Interrogation (mandatory for --depth medium|high or escalated auto):
For each finding that appears in both models' outputs, classify as:
Intertextual Addition (mandatory, all depths): You MUST add at least one perspective, connection, or counter-argument from your own knowledge that no model raised. Mark with [MELCHIOR]. This is NOT derived from model outputs — it is your independent intellectual contribution as the third MAGI personality.
gemini_ideas.md, codex_ideas.md, research_direction.md--depth medium or high (or escalated from auto): gemini_review_of_codex.md, codex_review_of_gemini.md--depth high (or escalated from auto): debate_round2_gemini.md, debate_round2_codex.mdclaim_evidence.md--depth auto escalated to deep: deep_investigation_{1..3}_pro.md, deep_investigation_{1..3}_con.md, escalation_analysis.mdweights.json, personas.mdpreflight_context.md (for MELCHIOR's direct reference to literature)Scope Divergence Check (mandatory for --depth medium|high):
Compare scope declarations from Step 1a model outputs. If models interpreted the question with substantially different scope:
Load weights.json and check _meta.method:
method is "holistic": Use holistic ranking — Claude reads all ideas, reviews, and debates, then directly ranks research findings based on integrated expert judgment. No numeric dimension scores are computed. Instead, for each finding, provide a Ranking Rationale (3-5 sentences) explaining why it ranks at this position. The rationale must:
method is not "holistic" (explicit, adaptive-recommended, domain-default, or custom): Use the weights to compute a weighted score for each research finding:
score = Σ(weight_i × rating_i)Synthesize into a coherent research analysis that preserves the core scientific reasoning, mathematical formulations, testable predictions, and falsification conditions from brainstorm/review outputs. The synthesis must explain WHY each approach works (mechanism), not just WHAT to do (action plan). Structure:
weights.json), including _meta.method to document how weights were selected| Finding | Core Claim (1 sentence) | Key Equation/Metric | Predicted Outcome | Source Model(s) | Confidence |. Do NOT omit mathematical content — condense it into the Key Equation column.--depth high or escalated from auto) — for each of the 3 debated disagreements, document the final resolution: who conceded, what was revised, and the synthesized position. If claim_evidence.md was used, note which real-world evidence influenced the resolution.--depth auto escalated to deep only) — for each of the 3 deeply investigated contested ideas: summarize the pro/con arguments, cite evidence, and state how the deep investigation affected the idea's ranking. Format: "Contested Idea: [title] — Pro: [summary]. Con: [summary]. Evidence tilts: [toward/against/inconclusive]. Ranking effect: [promoted/demoted/unchanged]."--depth high+ or escalated from auto, if claim_evidence.md exists) — summary of how real-world evidence from the evidence anchoring step influenced the synthesis. Format: "Literature-Grounded Adjustments: [N] findings had their confidence adjusted based on published evidence. Key papers: [2-3 most influential papers with DOIs]."--depth auto only) — record the auto-escalation decision for traceability. Copy the key metrics from escalation_analysis.md: contention score, decision, top contested ideas.[MELCHIOR] Comprehensive Self-Review (mandatory, revision trigger):
After writing the full synthesis but BEFORE the mechanical checklist, MELCHIOR re-reads the entire synthesis as a critical reviewer. This is a holistic quality gate — not a line-item check. Append the review as a ## MELCHIOR Comprehensive Review section at the end of synthesis.md (after Traceability, before the mechanical checklist edits).
Evaluate the synthesis on these five axes. For each axis, write 2-4 sentences of assessment and a verdict (PASS / REVISE):
(a) Question Fidelity — Do the top findings actually answer the original research question? Or has the synthesis drifted to an easier adjacent question? Compare the research question, hypothesis, and expected results (from brainstorm/research_direction.md, Sections 1, 3, and 4) against what the top 3 findings collectively address. Use .workspace.json original_topic as the root reference for drift detection. If there is drift, name it: "The original question asked X, but findings 1-3 address Y instead."
(b) Inter-Finding Coherence — Do the Top 5 findings form a coherent research narrative, or do they contradict each other? If contradictions exist, are they explicitly acknowledged as productive tensions (acceptable) or unintentional inconsistencies (must fix)?
(c) Aggregate Mechanism Audit — Looking at the Top 5 as a set: how many propose a genuinely new causal mechanism vs. restate known domain knowledge in new vocabulary? Count: "N/5 findings propose novel mechanisms; M/5 are refinements of known approaches." If N < 2, flag as a quality concern.
(d) Causal vs. Diagnostic Balance — Across ALL Next Three Steps entries: count the step types. Report the ratio: "Intervention/Ablation/Null: X steps. Empirical/Design/Review: Y steps." If no Intervention, Ablation, or Null steps exist in the entire synthesis, this is a mandatory REVISE — go back and add at least one causal step per Tier 1 finding.
(e) Blind Spot Confession — Name 1-2 questions that this synthesis does NOT address but that a domain expert would ask. These are not failures but honest scope limits. Format: "This synthesis does not address: [question]. Why: [reason — time constraint / outside model expertise / insufficient data]."
Revision protocol: If any axis yields REVISE, go back and fix the corresponding section of the synthesis BEFORE proceeding. After revision, update the review verdict to PASS with a note: "REVISED — originally failed because [reason], fixed by [action]." Only proceed to step 5 when all five axes are PASS.
After completing the self-review and any revisions, verify (mechanical checklist):
--depth medium|high or escalated auto]claim_evidence.md exists: at least one finding's confidence or ranking was informed by real-world evidence, or an explicit note explains why no adjustment was needed [--depth high+ or escalated auto]--depth auto: "Depth Escalation Trace" section exists in synthesis with contention score and decision--depth auto escalated to deep: "Deep Investigation Results" section exists with pro/con adjudication for each contested idea
If any check fails, revise the relevant finding before finalizing.Save to brainstorm/synthesis.md.
Retroactive Question Crystallization (always, all depths): After completing the ranked synthesis, examine the top 5 findings and identify the research question they collectively answer. If this crystallized question differs substantively from the Research Direction Document's Section 1 (Research Question):
Present the synthesis to the user with:
Wait for user input before proceeding.
--depth low|medium|high|auto:
brainstorm/
├── weights.json # Scoring weights + selection metadata (always)
├── personas.md # Assigned expert personas (always)
├── preflight_context.md # Pre-flight literature context (--depth medium+)
├── briefing_gemini.md # Persona-specific briefing for Gemini (--depth medium+)
├── briefing_codex.md # Persona-specific briefing for Codex (--depth medium+)
├── gemini_ideas.md # Gemini brainstorm output (always)
├── codex_ideas.md # Codex brainstorm output (always)
├── gemini_review_of_codex.md # Cross-review (--depth medium|high|auto)
├── codex_review_of_gemini.md # Cross-review (--depth medium|high|auto)
├── escalation_analysis.md # Depth escalation decision (--depth auto only)
├── claim_evidence.md # Evidence for disputed claims (--depth high, or auto escalated)
├── disagreements.md # Disagreement summary for debate (--depth high, or auto escalated)
├── debate_round2_gemini.md # Adversarial debate (--depth high, or auto escalated)
├── debate_round2_codex.md # Adversarial debate (--depth high, or auto escalated)
├── deep_investigation_{i}_pro.md # Pro argument for contested idea i (--depth auto→deep only)
├── deep_investigation_{i}_con.md # Con argument for contested idea i (--depth auto→deep only)
└── synthesis.md # Claude synthesis (always)
--depth max:
brainstorm/
├── weights.json # Scoring weights + selection metadata
├── personas.md # N domain-specialist personas
├── preflight_context.md # Pre-flight literature context
├── briefing_persona_{i}.md # Per-persona briefing (one per persona)
├── persona_1/ # Persona 1 mini-MAGI output
│ ├── gemini_ideas.md
│ ├── codex_ideas.md
│ ├── gemini_review_of_codex.md
│ ├── codex_review_of_gemini.md
│ └── conclusion.md
├── persona_2/ # Persona 2 mini-MAGI output
│ └── ... # (same 5 files)
├── persona_N/ # Persona N mini-MAGI output
│ └── ...
├── all_conclusions.md # Consolidated persona conclusions for Layer 2
├── meta_review_gemini.md # Gemini meta-review of all conclusions
├── meta_review_codex.md # Codex meta-review of all conclusions
├── meta_disagreements.md # Meta-disagreement summary for debate
├── meta_claim_evidence.md # Evidence for meta-level disputed claims (Phase B+)
├── debate_context_for_gemini.md # Consolidated: disagreements + Codex meta-review + evidence
├── debate_context_for_codex.md # Consolidated: disagreements + Gemini meta-review + evidence
├── meta_debate_gemini.md # Adversarial debate — Gemini
├── meta_debate_codex.md # Adversarial debate — Codex
└── synthesis.md # Enriched final synthesis
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub axect/magi-researchers --plugin magi-researchersRead when SKILL.md points to them; scripts run unread.
9 skills in this plugin
/researchResearch Workflow — Full PipelineRuns the complete research pipeline: Brainstorming → Planning → Implementation → Testing & Visualization → Reporting. Orchestrates all phases with user checkpoints between each./research-executeResearch Execute SkillExecutes the research code in `src/` to generate result artifacts in `results/`. This is Phase 3.5/research-explainResearch Explain SkillGenerates high-quality explanations of concepts using Gemini and Codex in parallel (Phase 1: MAGI strategy exploration), then synthesizes a single-voice explanation with Claude (Phase 2: convergent generation).Other plugins' skills for the same job