Files
deep_research/.opencode/commands/dr-finalize.md
T
2026-04-21 12:31:58 +08:00

114 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: Phase 4 - 成稿。合并所有章节,调度 dr-polisher 润色,dr-reporter 生成 PDF+DOCX。用法:/dr-finalize [slug]
agent: dr-chief-editor
---
你是 dr-chief-editor。用户执行了 `/dr-finalize $ARGUMENTS`,需要完成 Phase 4 成稿。
## Step 1: 定位项目并检查
- `$ARGUMENTS` 非空:用该 slug
- 为空:取最近的项目
验证:
- `phase2.status == "completed"`
- `phase3.approved == true`(如果 phase3 从未跑过,询问用户是否跳过审校直接出稿)
## Step 2: 组装 final.md
读取所有章节草稿,按以下结构合并到 `projects/<slug>/phase4/final.md`
```markdown
# <报告主标题>
**<副标题>**
---
## 免责声明
<来自 manifest.json 的 disclaimer>
---
## 执行摘要
<在此处写一段 500-800 字的执行摘要,提炼全报告的核心发现和建议>
---
## 术语表
<提取正文中所有括号内的缩写定义,按字母序排列>
---
## 目录
<自动生成,列出所有一级和二级标题>
---
<各章节正文,按顺序拼接>
---
## 参考文献
<占位符,dr-reporter 会从 sources.jsonl 生成>
---
## 版本信息
- 生成时间:<datetime>
- 报告版本:<来自 manifest.version>
- 研究系统:Deep Research v0.4
```
执行摘要和术语表需要你根据章节内容自行撰写(不超过 1000 字总计)。
## Step 3: 委派 dr-polisher
通过 Task 工具委派:
```
description: "全文润色 - 去 AI 味、中文表达优化、术语一致性"
prompt: |
请对以下文件做全文润色:
projects/<slug>/phase4/final.md
```
等待返回,确认 final.md 已更新。
## Step 4: 委派 dr-reporter
通过 Task 工具委派:
```
description: "生成最终报告 PDF 和 DOCX"
prompt: |
输入:projects/<slug>/phase4/final.md
manifestprojects/<slug>/manifest.json
输出目录:projects/<slug>/phase4/
```
等待返回。
## Step 5: 更新 manifest 并汇报
更新 `manifest.phase4.status = "completed"`
向用户汇报:
```
报告生成完成!
PDFprojects/<slug>/phase4/final.pdf
DOCXprojects/<slug>/phase4/final.docx
参考文献:projects/<slug>/phase4/citations.md
统计:
总字数:X 字
页数(估算):约 X 页
信源:X 条
生成时间:<datetime>
```