深度调研的多实例(多 Agent)编排工作流:把一个调研目标拆成可并行子目标,用 Codex CLI(`codex exec`)在默认 `workspace-write` 沙箱内运行子进程;联网与采集优先使用已安装的 skills,其次使用 MCP 工具;用脚本聚合子结果并分章精修,最终交付“成品报告文件路径 + 关键结论/建议摘要”。用于:系统性网页/资料调研、竞品/行业分析、批量链接/数据集分片检索、长文写作与证据整合,或用户提及“深度调研/Deep Research/Wide Research/多 Agent 并行调研/多进程调研”等场景。
把深度调研作为可重复、可审计的生产流程执行。主控负责目标澄清、样本摸底、子任务设计、结果核验和最终综合;子进程负责边界清晰的采集或局部分析。
--model,不覆盖无关配置。workspace-write;只有确实需要 shell 网络访问时才启用 runner 的 --network。--dangerously-bypass-approvals-and-sandbox。.research/<name>/ 目录。先解析当前 Skill 的绝对目录并记为 <skill-dir>。
scripts/run_children.py:跨平台并行执行 codex exec,负责超时、重试、日志和结果状态。scripts/aggregate.py:按 manifest 顺序聚合成功的子报告,缺失或空结果时失败。两个脚本都使用 Python 标准库,不生成临时 shell 脚本。
明确目标、受众、时间范围、来源边界、评价标准和最终格式。通过当前可用工具获取少量真实样本,记录代表性来源和缺口,避免只凭经验拆分。
使用不重复的语义化名称,例如:
.research/20260712-codex-skills-a3f2/
├── prompts/
├── logs/
├── child_outputs/
├── raw/
├── cache/
└── manifest.json
把网页原文、数据和解析结果缓存到 raw/ 或 cache/,避免重复抓取。
每个子任务只负责一个明确边界,Prompt 至少包含:
将 Prompt 分别写入 prompts/,然后创建 manifest:
{
"tasks": [
{
"id": "market-history",
"title": "市场历史",
"prompt_file": "prompts/market-history.md"
},
{
"id": "current-competitors",
"title": "当前竞品",
"prompt_file": "prompts/current-competitors.md"
}
]
}
id 只能包含字母、数字、点、下划线和短横线。Prompt 必须位于本次运行目录内。
先预览命令,不启动 Codex 子进程:
python3 "<skill-dir>/scripts/run_children.py" \
--run-dir ".research/<name>" \
--workspace "$PWD" \
--dry-run
检查 manifest 和 Prompt 后执行:
python3 "<skill-dir>/scripts/run_children.py" \
--run-dir ".research/<name>" \
--workspace "$PWD" \
--parallel 8 \
--timeout 600 \
--retries 1
只有子任务必须通过 shell 直接联网时才添加 --network。根据任务成本调整并发和超时,先用 1–2 个子任务验证链路,再扩大并发。
Runner 固定输出:
child_outputs/<id>.mdlogs/<id>.logresults.json读取 results.json,检查失败、超时、空输出和引用缺失。只重试失败的边界任务;不要因为单个失败重新运行所有成功任务。需要改变模型、权限或来源范围时先说明原因。
python3 "<skill-dir>/scripts/aggregate.py" \
--run-dir ".research/<name>"
默认生成 aggregated_raw.md。该文件只是按 manifest 顺序整理的内部材料,不是最终报告。
通读子报告和关键原始来源,先设计章节大纲和素材映射,再分章节写入 polished_report.md。处理重复信息、来源冲突和证据强弱;验证关键数据和引用,不能把子报告简单拼接后直接交付。
最终回复提供:
不要把内部 Prompt、调度日志或完整中间稿当作成品发送给用户。
Edit PDFs with natural-language instructions using the nano-pdf CLI.
Control Sonos speakers (discover/status/play/volume/group).
Terminal Spotify playback/search via spogo (preferred) or spotify_player.
Capture frames or clips from RTSP/ONVIF cameras.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
Category:tools