From 87141ecfb05f3072e74d51cd156d783935776875 Mon Sep 17 00:00:00 2001 From: jilinchen Date: Mon, 29 Dec 2025 12:58:39 +0800 Subject: [PATCH] Initial commit: Deep Research Skill for Claude Code --- README.md | 75 +++++++++++++++++++++++++++++ skills/research/SKILL.md | 41 ++++++++++++++++ skills/research/add-fields/SKILL.md | 30 ++++++++++++ skills/research/add-items/SKILL.md | 28 +++++++++++ skills/research/deep/SKILL.md | 41 ++++++++++++++++ 5 files changed, 215 insertions(+) create mode 100644 README.md create mode 100644 skills/research/SKILL.md create mode 100644 skills/research/add-fields/SKILL.md create mode 100644 skills/research/add-items/SKILL.md create mode 100644 skills/research/deep/SKILL.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f61d55f --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# Deep Research Skill for Claude Code + +> Inspired by [RhinoInsight: Improving Deep Research through Control Mechanisms for Model Behavior and Context](https://arxiv.org/abs/2511.18743) + +A structured research workflow skill for Claude Code, supporting two-phase research: outline generation and deep investigation. + +## Commands + +| Command | Description | +|---------|-------------| +| `/research` | Generate research outline with items and fields | +| `/research/add-items` | Add more items to existing outline | +| `/research/add-fields` | Add more fields to existing outline | +| `/research/deep` | Deep research each item with parallel agents | + +## Installation + +Copy the `skills/` folder to your Claude Code directory: + +```bash +cp -r skills/* ~/.claude/skills/ +``` + +## Workflow + +### Phase 1: Generate Outline +``` +/research +``` +- Uses model knowledge + web search +- Asks for existing field definitions +- Outputs `{topic}_outline.yaml` in current directory + +### Phase 2: Deep Research +``` +/research/deep +``` +- Reads outline automatically from current directory +- Launches parallel agents (5 per batch) +- Outputs structured JSON per item +- Supports resume from checkpoint + +### Optional: Expand Outline +``` +/research/add-items # Add more research targets +/research/add-fields # Add more field definitions +``` + +## Output Format + +### Outline (YAML) +```yaml +topic: "your topic" +items: + - name: "Item1" + source: "source info" +fields: + basic_info: + - name: "field_name" + description: "field description" + detail_level: "detailed|brief" +execution: + batch_size: 5 +``` + +### Research Result (JSON) +Each item outputs a structured JSON file with all defined fields. + +## References + +- RhinoInsight: Improving Deep Research through Control Mechanisms for Model Behavior and Context + +## License + +MIT diff --git a/skills/research/SKILL.md b/skills/research/SKILL.md new file mode 100644 index 0000000..fb07572 --- /dev/null +++ b/skills/research/SKILL.md @@ -0,0 +1,41 @@ +--- +allowed-tools: Read, Write, Glob, WebSearch, Task, AskUserQuestion +description: 对目标话题进行初步调研,生成调研outline。用于学术调研、benchmark调研、技术选型等场景。 +--- + +# Research Skill - 初步调研 + +## 触发方式 +`/research ` + +## 执行流程 + +### Step 1: 模型内部知识生成初步框架 +基于topic,利用模型已有知识生成: +- 该领域的主要研究对象/items列表 +- 建议的调研字段框架 + +### Step 2: Web Search补充 +启动1个web-search-agent(后台),根据topic自行设计搜索策略,补充最新的items和字段建议。 + +### Step 3: 询问用户已有字段 +使用AskUserQuestion询问用户是否有已定义的字段文件,如有则读取并合并。 + +### Step 4: 生成Outline +合并所有信息,生成outline文件(YAML格式),包含: +- topic和基础配置 +- items列表(调研对象) +- fields定义(调研字段) +- execution配置(批量大小等) + +### Step 5: 输出并确认 +- 保存到当前工作目录: `./{topic_slug}_outline.yaml` +- 展示给用户确认 + +## 输出路径 +`{当前工作目录}/{topic_slug}_outline.yaml` + +## 后续命令 +- `/research-add-items` - 补充items +- `/research-add-fields` - 补充字段 +- `/research-deep` - 开始深度调研 diff --git a/skills/research/add-fields/SKILL.md b/skills/research/add-fields/SKILL.md new file mode 100644 index 0000000..3988615 --- /dev/null +++ b/skills/research/add-fields/SKILL.md @@ -0,0 +1,30 @@ +--- +description: 向现有调研outline补充字段定义。 +allowed-tools: Bash, Read, Write, Glob, WebSearch, Task, AskUserQuestion +--- + +# Research Add Fields - 补充调研字段 + +## 触发方式 +`/research-add-fields` + +## 执行流程 + +### Step 1: 自动定位Outline +在当前工作目录查找 `*_outline.yaml` 文件,自动读取现有fields定义。 + +### Step 2: 获取补充来源 +询问用户选择: +- **A. 用户直接输入**:用户提供字段名称和描述 +- **B. Web Search搜索**:启动agent搜索该领域常用字段 + +### Step 3: 展示并确认 +- 展示建议的新字段列表 +- 用户确认哪些字段需要添加 +- 用户指定字段分类和detail_level + +### Step 4: 保存更新 +将确认的字段追加到outline,保存文件。 + +## 输出 +更新后的outline文件(原地修改,需用户确认) diff --git a/skills/research/add-items/SKILL.md b/skills/research/add-items/SKILL.md new file mode 100644 index 0000000..75c4c94 --- /dev/null +++ b/skills/research/add-items/SKILL.md @@ -0,0 +1,28 @@ +--- +description: 向现有调研outline补充items(调研对象)。 +allowed-tools: Bash, Read, Write, Glob, WebSearch, Task, AskUserQuestion +--- + +# Research Add Items - 补充调研对象 + +## 触发方式 +`/research-add-items` + +## 执行流程 + +### Step 1: 自动定位Outline +在当前工作目录查找 `*_outline.yaml` 文件,自动读取。 + +### Step 2: 并行获取补充来源 +同时进行: +- **A. 询问用户**:需要补充哪些items?有具体名称吗? +- **B. 询问是否需要Web Search**:是否启动agent搜索更多items? + +### Step 3: 合并更新 +- 将新items追加到outline +- 展示给用户确认 +- 避免重复 +- 保存更新后的outline + +## 输出 +更新后的outline文件(原地修改) diff --git a/skills/research/deep/SKILL.md b/skills/research/deep/SKILL.md new file mode 100644 index 0000000..0777c73 --- /dev/null +++ b/skills/research/deep/SKILL.md @@ -0,0 +1,41 @@ +--- +description: 读取调研outline,为每个item启动独立agent进行深度调研。禁用task output。 +allowed-tools: Bash, Read, Write, Glob, WebSearch, Task +--- + +# Research Deep - 深度调研 + +## 触发方式 +`/research-deep` + +## 执行流程 + +### Step 1: 自动定位Outline +在当前工作目录查找 `*_outline.yaml` 文件,读取items列表、fields定义、execution配置。 + +### Step 2: 断点续传检查 +- 检查output_dir下已完成的JSON文件 +- 跳过已完成的items + +### Step 3: 分批执行 +- 按batch_size分批(默认5个) +- 每个item启动1个web-search-agent(后台并行,禁用task output) +- 每个agent读取outline获取字段定义 +- 输出结构化JSON到output_dir + +### Step 4: 等待与监控 +- 等待当前批次完成 +- 启动下一批 +- 显示进度 + +### Step 5: 汇总报告 +全部完成后输出: +- 完成数量 +- 失败/不确定标记的items +- 输出目录 + +## Agent配置 +- 每批并行: 5个agent(可在outline中配置) +- 后台执行: 是 +- Task Output: 禁用(agent完成时有明确输出文件) +- 断点续传: 是