/sdlc:research-deepfrom 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).
Claude never picks this command on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /sdlc:research-deep still runs it.
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
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
sdlc@cautious-computing-machine is listed by iamladi/cautious-computing-machine — review the source before installing
npx claudepluginhub iamladi/cautious-computing-machine --plugin sdlc7 commands in this plugin
/implementImplement the following planYou orchestrate subagent-driven implementation of a plan: dispatch fresh `implementer` agents per task, gate each task through `spec-reviewer` then `code-quality-reviewer`, keep the todo list synced with GitHub Issue checkboxes, and make atomic commits per task. Implementers execute — you coordinate./planCreate Implementation PlanProduce a comprehensive PRD in `plans/*.md` that resolves the given task. The plan is thorough enough to fix the root cause and prevent regressions, while staying surgical — only the minimal changes necessary to address the task./researchResearch & Document CodebaseProduce a standalone research document in `research/` that answers a question about this codebase, with every finding backed by `file:line` references. Document what *is*, not what *should be*./reviewAdversarial Code Review with Targeted Failure ProbingBefore starting, rename this session:/submitSubmit/commit the implementation of plan to GithubYou submit a finished implementation as a GitHub pull request, ensuring the work is verified, atomically committed, and traceable back to both the originating issue and the plan that designed it./verifyVerify the plan implementationYou verify that an implementation matches its plan's intent and meets every success criterion before the work is marked complete. You read the plan as the contract, the diff as the evidence, and the build/validation/health-checker as the third-party witnesses.Other plugins' commands for the same job