Help us improve
Share bugs, ideas, or general feedback.
From sdlc
You orchestrate a four-phase research pipeline (Discovery → Independent Analysis → Cross-Pollination Refinement → Synthesis) over a codebase topic, coordinating Claude, Gemini, and Codex. The output is one synthesized document with findings attributed by LLM (and, in swarm mode, by discovery teammate).
npx claudepluginhub iamladi/cautious-computing-machine --plugin sdlcHow this command is triggered — by the user, by Claude, or both
Slash command
/sdlc:research-deepThe summary Claude sees in its command listing — used to decide when to auto-load this command
# Multi-LLM Deep Research ## Role You orchestrate a four-phase research pipeline (Discovery → Independent Analysis → Cross-Pollination Refinement → Synthesis) over a codebase topic, coordinating Claude, Gemini, and Codex. The output is one synthesized document with findings attributed by LLM (and, in swarm mode, by discovery teammate). ## Priorities Depth (multi-perspective) > Accuracy (consensus validation) > Concision ## Session setup Rename the session up front: `/rename "Deep Research: $ARGUMENTS"` — or, if no topic was supplied, ask for one and then rename. ## Routing The defau...
/research-deepLaunches Gemini Deep Research Agent with an interview-driven brief for autonomous web-grounded research on a given topic. Builds a precise research brief via multi-round questioning before executing.
Share bugs, ideas, or general feedback.
You orchestrate a four-phase research pipeline (Discovery → Independent Analysis → Cross-Pollination Refinement → Synthesis) over a codebase topic, coordinating Claude, Gemini, and Codex. The output is one synthesized document with findings attributed by LLM (and, in swarm mode, by discovery teammate).
Depth (multi-perspective) > Accuracy (consensus validation) > Concision
Rename the session up front: /rename "Deep Research: $ARGUMENTS" — or, if no topic was supplied, ask for one and then rename.
The default mode is --no-swarm equivalent: one Claude discovery subagent. Pass --swarm to use an agent team for discovery (Locator + Analyzer + Pattern Finder sharing findings in real time via SendMessage). Strip --swarm from the arg string and treat what remains as the topic. If the topic is empty after stripping, ask the user for a research question.
If swarm mode is requested but TeamCreate fails or the tool is unavailable, tell the user:
Swarm mode requires agent teams. Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in settings.json or environment.
Falling back to standard discovery mode.
Then continue with the standard workflow — the topic is already parsed.
Create research/.deep-research-$(date +%Y%m%d-%H%M%S)/ and read any user-mentioned files fully (no limit/offset) before spawning.
Standard discovery spawns one general-purpose subagent that runs codebase-locator, codebase-analyzer, and codebase-pattern-finder in sequence, plus a parallel web-search-researcher subagent. Output goes to context.md.
Swarm discovery creates an agent team named research-deep-{topic-kebab}-{YYYYMMDD-HHMMSS} and registers three shared tasks via TaskCreate:
Spawn three general-purpose teammates via Task with the team_name parameter. Each uses SendMessage to share discoveries in real time. In parallel, spawn web-search-researcher as a plain subagent (no team_name) — web findings supplement but never block.
Wait for all three teammates to send RESEARCH COMPLETE. Cap each at 10 minutes wall clock. Web research gets up to 2 extra minutes after teammates finish, then proceeds without it.
Merge all teammate (or solo-agent) findings plus the web summary (capped ~500 words) into context.md, targeting under 50K characters for CLI compatibility. Preserve every file:line reference. In swarm mode, tag findings with [Locator], [Analyzer], [Pattern Finder].
The team must be deleted before Phase 2 starts, regardless of whether Phase 1 succeeded. Skipping leaks team slots and orphans the shared task list.
SendMessage with type: "shutdown_request" to each teammateTeamDelete to remove the teamIf cleanup itself errors, tell the user "Team cleanup incomplete. You may need to check for lingering team resources." and continue — Phase 2 still runs.
Three LLMs read context.md and produce independent analyses in parallel. This phase is identical in both modes.
Load the model registry first:
Glob(pattern: "**/sdlc/**/config/model-registry.md", path: "~/.claude/plugins") → Read resultgemini-flagship and codex-flagship IDs from the registry.Each LLM's prompt includes:
<!-- RESEARCH_COMPLETE --> as a completion signal.Task agent, subagent_type: "general-purpose", max_turns: 50. Prompt ends with the RESEARCH_COMPLETE signal instruction.timeout 600 gemini -m <gemini-flagship> --approval-mode yolo, prompt piped to stdin via Bash (background).echo "<prompt>" | codex exec --skip-git-repo-check -m <codex-flagship> --reasoning-effort xhigh --full-auto 2>/dev/null via Bash (background).Save outputs to {llm}-analysis.md. 10-minute timeout per external LLM. Continue with whatever succeeded — minimum floor is Claude.
For each external LLM, start a Monitor after launching the background process. This catches quota/auth errors early so you can stop waiting:
Monitor (one per LLM):
description: "Fatal error watch: {llm_name}"
timeout_ms: 600000
persistent: false
command: |
OUTPUT_FILE="{output_file_path}"
for i in $(seq 1 30); do [ -f "$OUTPUT_FILE" ] && break; sleep 1; done
[ ! -f "$OUTPUT_FILE" ] && echo "FATAL|{llm_name}|output file never created" && exit 1
tail -f "$OUTPUT_FILE" 2>/dev/null \
| grep --line-buffered -iE 'quota.*exhausted|rate.?limit|unauthorized|authentication failed|API key.*(invalid|expired)' \
| while IFS= read -r line; do
echo "FATAL|{llm_name}|$line"
exit 0
done
On a FATAL|{llm_name}|{pattern} notification, kill the background process, log the pattern, mark that LLM failed, and proceed with the survivors.
Each LLM that produced a Phase 2 analysis reads all surviving analyses (its own + peers') and writes a strictly-better refined version. Only Phase-2 survivors participate.
Refinement prompt instructions:
Rules embedded in the prompt:
Invocations mirror Phase 2 (same registry IDs). Save to {llm}-refined.md. Same timeouts and fatal-error watch. If refinement fails for any LLM, fall back to its {llm}-analysis.md for synthesis.
Spawn the research-synthesizer agent with all refined reports (or originals where refinement failed). The synthesizer organizes findings by theme, not by source LLM, and inline-attributes using:
[Consensus: 3/3], [Consensus: 2/3] for agreement[Claude], [Gemini], [Codex] for single-source findingsIn swarm mode, discovery-phase findings also carry [Locator] / [Analyzer] / [Pattern Finder] tags; the synthesizer preserves them in the Discovery section.
Save to research/research-{topic-kebab}-deep.md with YAML frontmatter. Add GitHub permalinks where applicable. Close with a short report: which LLMs contributed, which phases succeeded, and which findings are consensus vs unique.
research/.deep-research-[timestamp]/
├── context.md # Discovery output (from subagent or team)
├── claude-analysis.md # Phase 2
├── gemini-analysis.md # Phase 2
├── codex-analysis.md # Phase 2
├── claude-refined.md # Phase 3
├── gemini-refined.md # Phase 3
└── codex-refined.md # Phase 3
This command documents the codebase as it is — the categorical rule is "what exists, not what should exist"; /review owns the "should" pass. Load the canonical constraints via Glob(pattern: "**/sdlc/**/references/documentarian-constraints.md", path: "~/.claude/plugins") and read the result — the file names five specific boundaries (scope, critique, RCA, proposals, axis-specific commentary), each with its own downstream failure mode. Don't paraphrase by enumerating a subset; if the file isn't found, fall back to the categorical rule only ("what exists, not what should exist"), which is safer than a partial enumeration that silently drops boundaries.
$ARGUMENTS