Coordinating Deep Research
Goal
Act strictly as the Coordinator: scope the question, manage non-destructive research dossiers, spawn parallel research-scout subagents, optionally run Red-Team verification (research-verifier), synthesize via research-writer, enforce deterministic citation auditing (research-cli audit), and deliver a crisp report.
Keep your own context clean: never conduct web research or write report prose directly — delegate those to the specialized subagents.
Locate Bundled CLI
Derive <PLUGIN_ROOT> from this skill's path (three levels up from skills/deep-research/SKILL.md), falling back to ~/.gemini/config/plugins/antigravity-research-kit or .agents/plugins/antigravity-research-kit. Set:
<CLI> = <PLUGIN_ROOT>/scripts/research-cli.mjs
Pass the exact absolute <CLI> path to every research-scout and research-verifier prompt.
Instructions
- Clarify only when material: read the user's request for ambiguities that would genuinely change the research (ambiguous acronyms/entities, missing region/jurisdiction, unclear time window or target decision). If needed, ask once via
ask_question; otherwise proceed directly. - Choose depth & profile:
- Depth:
quick(1–2 scouts → writer →audit),standard(default: 3–4 scouts → writer →audit --check-urls),deep(4–6 scouts →research-verifier→ writer →audit --check-urls), orhybrid(optional: if the user requests Gemini managed Deep Research alongside local primary sources andgemini-apiis configured per thegemini-api-cliskill, launch a background Deep Research run in parallel with local scouts and cross-check both viaresearch-verifier; ifgemini-apiis unavailable or unconfigured, fall back cleanly todeepmode and note that to the user). - Profile: pick from
references/profiles.md(narrativedefault,comparison-adr,market-brief,strategic-decision).
- Depth:
- Inspect prior research & initialize dossier:
- Run
node "<CLI>" list --jsonto detect earlier research inresearch_notes/andreports/(defaults to$DEEP_RESEARCH_DIRif set, otherwise cwd; pass--dir <path>only if the user requested a specific folder). - Choose a concise, specific title in the user's language (3–6 words,
<= 50chars, sentence case, Unicode letters allowed, no path punctuation). - If extending/updating an earlier topic, pick a distinct title naming what changed (never reuse or overwrite an existing folder), note the prior report & notes paths for the writer, and decompose only the delta for scouts.
- Run
node "<CLI>" init "<title>" --jsonto createresearch_notes/<title>/andreports/.
- Run
- Track progress cleanly: call
update_stepswith 4–6 plain user-facing steps (e.g.,"Investigate key research angles","Verify citations and counter-evidence","Synthesize final report"— avoid internal subagent jargon). - Decompose MECE & launch parallel scouts in ONE turn:
- Split into mutually exclusive, collectively exhaustive angles:
1(focused factual),3(standard angles),4(evaluation criteria),5(regions/entities/domains),6+(broad comparative matrix). Default to 3 when in doubt. - Call
invoke_subagentwithTypeName: "research-scout"for all angles in parallel in a single turn. Each prompt MUST include:- Narrow angle, objective, 2–4 concrete key questions, suggested primary sources (
github/arxiv/hn/npm/pypi/official docs), explicitYYYY-MM-DDdate constraints. - Exact CLI path:
<CLI> - Exact output path:
<notesDir>/<angle-slug>.md
- Narrow angle, objective, 2–4 concrete key questions, suggested primary sources (
- Internal knowledge bases: only if the user explicitly asked to include internal MCP sources (Notion/Confluence/Jira/GitLab), spawn one built-in
selfsubagent dedicated solely to that internal angle so web scouts stay isolated (inheritMcp: false). - Stop calling tools and wait reactively for all subagents to finish — never poll.
- Split into mutually exclusive, collectively exhaustive angles:
- Optional gap-closing round (MAX ONCE):
- Inspect scout summaries. Only if a critical gap would make the report incomplete, spawn targeted follow-up
research-scoutsubagent(s) in parallel. - Hard anti-loop rule: this step may execute at most once. Whenever triggering a gap round, explicitly state: "After these scouts finish, I will move directly to verification and report writing."
- Inspect scout summaries. Only if a critical gap would make the report incomplete, spawn targeted follow-up
- Verification pass (
deep/hybridmode):- Collect the exact list of created note files in
<notesDir>and invokeresearch-verifier(passing<CLI>,<notesDir>, note file paths, and output path<notesDir>/_verification.md). Wait reactively.
- Collect the exact list of created note files in
- Synthesize final report:
- Invoke
research-writerpassing:- Full original user question (including any follow-up clarifications)
- Assigned profile (
narrative|comparison-adr|market-brief|strategic-decision) and key rules fromreferences/profiles.md - Exact list of all note file paths in
<notesDir>(including_verification.mdif created) - Prior report & prior notes paths if extending earlier research (otherwise
"none") - Exact output path:
<reportPath>(reports/<title>.md)
- Invoke
- Deterministic citation audit gate (mandatory):
- Run:
(If extending earlier research, passnode "<CLI>" audit "<reportPath>" --notes "<notesDir>" --check-urls --json--prior "<priorReportPath>" --prior "<priorNotesDir>"so reused citations pass cross-checking.) - If
auditreturnsok: false(any error:grounding_redirect,url_not_in_notes,dead_link,placeholder_link,unresolved_marker), messageresearch-writeronce with the exact audit error list so it fixes or drops those citations viaedit_file, then re-runauditto confirm pass.
- Run:
- Deliver: mark all
update_stepsdone, read the BLUF/conclusion of<reportPath>, and send the user a concise 3–5 sentence summary with a clickable link to<reportPath>(and key audit stats).
Definition of Done
- All scout notes saved under
research_notes/<title>/with canonical URLs. - Final report written to
reports/<title>.md. research-cli auditpasses withok: true(0grounding redirects,0hallucinated URLs absent from notes,0placeholders,0dead links).
Constraints
- Never research or write full report prose in the Coordinator turn.
- Never run more than ONE gap-closing round.
- Never overwrite an existing
research_notes/<title>/directory.
Rationalizations
- "This looks quick, I'll just run 10 web searches myself" -> doing broad search in the main thread pollutes context and loses structure; use
quickmode with 1–2research-scouts instead. - "One more scout round will make it even better" -> extra rounds cause timeouts and diminishing returns; respect the hard 1-gap-round limit and move to
research-writer. - "The writer's links look clean, I'll skip
research-cli audit" -> writers occasionally alter URLs or copy grounding redirects; the mechanical audit takes seconds and guarantees link integrity.