feat: add /research/report command for markdown generation
- New report command to generate markdown from JSON results - Generates Python script for conversion - Creates report with TOC and anchor links - Skips uncertain fields and uncertain array - Update deep.md with prompt template format 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
620a6622fd
commit
a34ef20fd4
@@ -19,6 +19,7 @@ A structured research workflow skill for Claude Code, supporting two-phase resea
|
|||||||
| `/research/add-items` | Add more items to existing outline |
|
| `/research/add-items` | Add more items to existing outline |
|
||||||
| `/research/add-fields` | Add more fields to existing outline |
|
| `/research/add-fields` | Add more fields to existing outline |
|
||||||
| `/research/deep` | Deep research each item with parallel agents |
|
| `/research/deep` | Deep research each item with parallel agents |
|
||||||
|
| `/research/report` | Generate markdown report from JSON results |
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -87,6 +88,14 @@ basic_info:
|
|||||||
### Research Result (JSON)
|
### Research Result (JSON)
|
||||||
Each item outputs a structured JSON file with all defined fields.
|
Each item outputs a structured JSON file with all defined fields.
|
||||||
|
|
||||||
|
### Phase 3: Generate Report
|
||||||
|
```
|
||||||
|
/research/report
|
||||||
|
```
|
||||||
|
- Generates Python script to convert JSON to markdown
|
||||||
|
- Creates report with table of contents and anchor links
|
||||||
|
- Skips uncertain fields automatically
|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
- RhinoInsight: Improving Deep Research through Control Mechanisms for Model Behavior and Context
|
- RhinoInsight: Improving Deep Research through Control Mechanisms for Model Behavior and Context
|
||||||
|
|||||||
@@ -18,14 +18,25 @@ allowed-tools: Bash, Read, Write, Glob, WebSearch, Task
|
|||||||
- 跳过已完成的items
|
- 跳过已完成的items
|
||||||
|
|
||||||
### Step 3: 分批执行
|
### Step 3: 分批执行
|
||||||
- 按batch_size分批(默认5个agent并行)
|
- 按batch_size分批(完成一批需要得到用户同意才可进行下一批)
|
||||||
- 每个agent负责items_per_agent个项目
|
- 每个agent负责items_per_agent个项目
|
||||||
- 启动web-search-agent(后台并行,禁用task output)
|
- 启动web-search-agent(后台并行,禁用task output),使用以下prompt模板:
|
||||||
- **硬约束**:仅传入item相关信息和输出路径
|
|
||||||
- **硬约束**:agent必须自行读取 `{topic}/fields.yaml` 获取字段定义
|
```
|
||||||
- **硬约束**:禁止在prompt中直接嵌入字段定义
|
## 任务
|
||||||
- **硬约束**:不确定的字段值标注[不确定],并在JSON末尾uncertain数组中列出该字段名(即对应字段的实际位置需要说明一次和uncertain字段位置再总结一次)
|
调研 {item_related_info},输出结构化JSON到 {output_path}
|
||||||
- 输出结构化JSON到output_dir
|
|
||||||
|
## 字段定义
|
||||||
|
读取 {topic}/fields.yaml 获取所有字段定义
|
||||||
|
|
||||||
|
## 输出要求
|
||||||
|
1. 按fields.yaml定义的字段输出JSON
|
||||||
|
2. 不确定的字段值标注[不确定]
|
||||||
|
3. JSON末尾添加uncertain数组,列出所有不确定的字段名
|
||||||
|
|
||||||
|
## 输出路径
|
||||||
|
{output_dir}/{item_name}.json
|
||||||
|
```
|
||||||
|
|
||||||
### Step 4: 等待与监控
|
### Step 4: 等待与监控
|
||||||
- 等待当前批次完成
|
- 等待当前批次完成
|
||||||
@@ -39,7 +50,6 @@ allowed-tools: Bash, Read, Write, Glob, WebSearch, Task
|
|||||||
- 输出目录
|
- 输出目录
|
||||||
|
|
||||||
## Agent配置
|
## Agent配置
|
||||||
- 每批并行: 5个agent(可在outline中配置)
|
|
||||||
- 后台执行: 是
|
- 后台执行: 是
|
||||||
- Task Output: 禁用(agent完成时有明确输出文件)
|
- Task Output: 禁用(agent完成时有明确输出文件)
|
||||||
- 断点续传: 是
|
- 断点续传: 是
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
description: 将deep调研结果汇总为markdown报告,覆盖所有字段,跳过不确定值。
|
||||||
|
allowed-tools: Read, Write, Glob, Bash
|
||||||
|
---
|
||||||
|
|
||||||
|
# Research Report - 汇总报告
|
||||||
|
|
||||||
|
## 触发方式
|
||||||
|
`/research-report`
|
||||||
|
|
||||||
|
## 执行流程
|
||||||
|
|
||||||
|
### Step 1: 定位结果目录
|
||||||
|
在当前工作目录查找 `*/outline.yaml`,读取topic和output_dir配置。
|
||||||
|
|
||||||
|
### Step 2: 生成Python转换脚本
|
||||||
|
在 `{topic}/` 目录下生成 `generate_report.py`,脚本要求:
|
||||||
|
- 读取output_dir下所有JSON
|
||||||
|
- 读取fields.yaml获取字段结构
|
||||||
|
- 覆盖每个JSON的所有字段值
|
||||||
|
- 跳过值包含[不确定]的字段
|
||||||
|
- 跳过uncertain字段
|
||||||
|
- 生成markdown报告格式:目录(带锚点跳转)+ 详细内容(按字段分类)
|
||||||
|
- 保存到 `{topic}/report.md`
|
||||||
|
|
||||||
|
### Step 3: 执行脚本
|
||||||
|
运行 `python {topic}/generate_report.py`
|
||||||
|
|
||||||
|
## 输出
|
||||||
|
- `{topic}/generate_report.py` - 转换脚本
|
||||||
|
- `{topic}/report.md` - 汇总报告
|
||||||
Reference in New Issue
Block a user