Deep Researcher
Use this skill when a task needs defensible, current, multi-source research:
library/API decisions, dependency investigations, release or changelog analysis,
GitHub issue/source archaeology, agent-prompt research, standards checks, or
high-stakes citations.
Operating Model
Use a dual-plane design:
- Codex-native plane: use
web.search_query, web.open, web.find, GitHub
app tools, Context7 MCP when explicitly useful, Exa MCP, and $opensrc from
the session. These tools are available to Codex, not to the Rust CLI.
- CLI plane: use
codex-research for provider routing, Context7 REST API,
GitHub REST/gh fallback, Firecrawl calls, direct fetch probes, SQLite/CAS
cache state, JSONL ledgers, Markdown reports, doctor output, and evals.
Always treat search results as leads until hydrated into source records. A
claim is not ready to rely on until it is tied to source IDs, source freshness,
and a confidence score.
Source Routing
Default order for broad research:
- Native Codex web for narrow current facts, official docs, and quick source
confirmation.
- Context7 REST API through
codex-research context7 for version-aware
library/API docs.
- GitHub app or
codex-research github for repository, code, issue, PR,
release, tag, compare, manifest, and changelog evidence.
- Direct fetch through
codex-research fetch probe|get for text/static pages.
- Exa for broad semantic discovery, repository inspiration, filtered web/GitHub
exploration, and source expansion when native web is too narrow.
agent-browser or Firecrawl only when route prediction says direct fetch is
likely an app shell, blocked, rendered, or crawl-heavy page.
$opensrc when package implementation source is required.
Use codex-research plan "<query>" --profile quick|standard|deep|exhaustive
to inspect call budgets before broad research. For replayable runs, initialize
run state and pass --run to provider commands:
codex-research run init "<query>" --profile deep --topic github --out .codex/research/run.json
codex-research run status --run .codex/research/run.json
Native Codex web calls are not visible to the CLI. Debit them manually with
codex-research run debit --run .codex/research/run.json --provider codex-web
when they are part of the same budgeted run.
Firecrawl Policy
Firecrawl is a paid-capacity fallback lane, not the first source.
- Public docs: cache is allowed unless the task is latest-critical.
- Latest-critical pages: use
--fresh so maxAge=0.
- Sensitive public pages: set
--no-store-in-cache.
- Private/confidential/repo-proprietary content: do not send to Firecrawl unless
the user explicitly allows external scraping for that material.
- If a page can be hydrated through GitHub, Context7, official docs, or direct
fetch, prefer that before Firecrawl.
GitHub Policy
Use hybrid GitHub access:
- In Codex sessions, prefer the GitHub app/plugin for PRs, private repos, review
threads, workflow logs, and authenticated repository metadata.
- Use
codex-research github for standalone, replayable, and reportable REST
calls. It falls back through GITHUB_TOKEN, GH_TOKEN, gh auth token, then
public unauthenticated mode.
- Target and hydrate. Generate narrow query shards, respect search result and
rate limits, then fetch full files, issue threads, releases, or compare ranges
before citing.
- Escalate to clone/sparse checkout and local
rg only when API search cannot
prove the source-level claim.
Subagent Orchestration
When using subagents, follow $subspawn strict rendezvous behavior. The main
Codex session spawns specialized research subagents, immediately waits for all
spawned agents in the batch, then synthesizes. Research subagents must not spawn
nested subagents.
Initial focused pack:
deep_researcher: lead multi-source researcher and synthesis owner.
github_researcher: GitHub repository/code/issues/releases specialist.
context7_researcher: direct Context7 API docs specialist.
openai_docs_researcher: official OpenAI docs specialist.
source_validator: package/source/release implementation validator.
citation_auditor: claim-to-source and freshness auditor.
Install templates with:
python3 skills/deep-researcher/scripts/install_agents.py --target project
python3 skills/deep-researcher/scripts/install_agents.py --target global
Evidence Bundles
For meaningful research, produce both machine and human outputs:
- JSONL ledger:
.codex/research/ledger.jsonl
- source records JSON or cached source metadata
- route stats or cache stats when routing mattered
- Markdown report with concise claims and citations
Useful commands:
codex-research doctor
codex-research cache init
codex-research plan "research question" --profile deep
codex-research run init "research question" --profile deep --topic general --out .codex/research/run.json
codex-research fetch probe "https://example.com/docs"
codex-research context7 search --library "Next.js" --query "middleware auth"
codex-research github search-code 'repo:owner/repo symbol in:file'
codex-research ledger init
codex-research ledger add-source --from-cache <source-id>
codex-research report --ledger .codex/research/ledger.jsonl
codex-research eval
Stop Rules
Stop and mark UNVERIFIED when:
- sources disagree and you cannot identify the current authority;
- a required provider is rate-limited or missing credentials;
- only stale secondary sources are available;
- private material would need to be sent to an external provider without
explicit permission;
- GitHub search is incomplete and hydration cannot validate the claim.
1---2name: deep-researcher3description: Deep, cited research across official docs, Codex web tools, Context7 API, GitHub, package source, rendered web pages, and Firecrawl with evidence ledgers.4---56# Deep Researcher78Use this skill when a task needs defensible, current, multi-source research:9library/API decisions, dependency investigations, release or changelog analysis,10GitHub issue/source archaeology, agent-prompt research, standards checks, or11high-stakes citations.1213## Operating Model1415Use a dual-plane design:1617- Codex-native plane: use `web.search_query`, `web.open`, `web.find`, GitHub18 app tools, Context7 MCP when explicitly useful, Exa MCP, and `$opensrc` from19 the session. These tools are available to Codex, not to the Rust CLI.20- CLI plane: use `codex-research` for provider routing, Context7 REST API,21 GitHub REST/`gh` fallback, Firecrawl calls, direct fetch probes, SQLite/CAS22 cache state, JSONL ledgers, Markdown reports, doctor output, and evals.2324Always treat search results as leads until hydrated into source records. A25claim is not ready to rely on until it is tied to source IDs, source freshness,26and a confidence score.2728## Source Routing2930Default order for broad research:31321. Native Codex web for narrow current facts, official docs, and quick source33 confirmation.342. Context7 REST API through `codex-research context7` for version-aware35 library/API docs.363. GitHub app or `codex-research github` for repository, code, issue, PR,37 release, tag, compare, manifest, and changelog evidence.384. Direct fetch through `codex-research fetch probe|get` for text/static pages.395. Exa for broad semantic discovery, repository inspiration, filtered web/GitHub40 exploration, and source expansion when native web is too narrow.416. `agent-browser` or Firecrawl only when route prediction says direct fetch is42 likely an app shell, blocked, rendered, or crawl-heavy page.437. `$opensrc` when package implementation source is required.4445Use `codex-research plan "<query>" --profile quick|standard|deep|exhaustive`46to inspect call budgets before broad research. For replayable runs, initialize47run state and pass `--run` to provider commands:4849```bash50codex-research run init "<query>" --profile deep --topic github --out .codex/research/run.json51codex-research run status --run .codex/research/run.json52```5354Native Codex web calls are not visible to the CLI. Debit them manually with55`codex-research run debit --run .codex/research/run.json --provider codex-web`56when they are part of the same budgeted run.5758## Firecrawl Policy5960Firecrawl is a paid-capacity fallback lane, not the first source.6162- Public docs: cache is allowed unless the task is latest-critical.63- Latest-critical pages: use `--fresh` so `maxAge=0`.64- Sensitive public pages: set `--no-store-in-cache`.65- Private/confidential/repo-proprietary content: do not send to Firecrawl unless66 the user explicitly allows external scraping for that material.67- If a page can be hydrated through GitHub, Context7, official docs, or direct68 fetch, prefer that before Firecrawl.6970## GitHub Policy7172Use hybrid GitHub access:7374- In Codex sessions, prefer the GitHub app/plugin for PRs, private repos, review75 threads, workflow logs, and authenticated repository metadata.76- Use `codex-research github` for standalone, replayable, and reportable REST77 calls. It falls back through `GITHUB_TOKEN`, `GH_TOKEN`, `gh auth token`, then78 public unauthenticated mode.79- Target and hydrate. Generate narrow query shards, respect search result and80 rate limits, then fetch full files, issue threads, releases, or compare ranges81 before citing.82- Escalate to clone/sparse checkout and local `rg` only when API search cannot83 prove the source-level claim.8485## Subagent Orchestration8687When using subagents, follow `$subspawn` strict rendezvous behavior. The main88Codex session spawns specialized research subagents, immediately waits for all89spawned agents in the batch, then synthesizes. Research subagents must not spawn90nested subagents.9192Initial focused pack:9394- `deep_researcher`: lead multi-source researcher and synthesis owner.95- `github_researcher`: GitHub repository/code/issues/releases specialist.96- `context7_researcher`: direct Context7 API docs specialist.97- `openai_docs_researcher`: official OpenAI docs specialist.98- `source_validator`: package/source/release implementation validator.99- `citation_auditor`: claim-to-source and freshness auditor.100101Install templates with:102103```bash104python3 skills/deep-researcher/scripts/install_agents.py --target project105python3 skills/deep-researcher/scripts/install_agents.py --target global106```107108## Evidence Bundles109110For meaningful research, produce both machine and human outputs:111112- JSONL ledger: `.codex/research/ledger.jsonl`113- source records JSON or cached source metadata114- route stats or cache stats when routing mattered115- Markdown report with concise claims and citations116117Useful commands:118119```bash120codex-research doctor121codex-research cache init122codex-research plan "research question" --profile deep123codex-research run init "research question" --profile deep --topic general --out .codex/research/run.json124codex-research fetch probe "https://example.com/docs"125codex-research context7 search --library "Next.js" --query "middleware auth"126codex-research github search-code 'repo:owner/repo symbol in:file'127codex-research ledger init128codex-research ledger add-source --from-cache <source-id>129codex-research report --ledger .codex/research/ledger.jsonl130codex-research eval131```132133## Stop Rules134135Stop and mark `UNVERIFIED` when:136137- sources disagree and you cannot identify the current authority;138- a required provider is rate-limited or missing credentials;139- only stale secondary sources are available;140- private material would need to be sent to an external provider without141 explicit permission;142- GitHub search is incomplete and hydration cannot validate the claim.