v0.20.7 restructure source and platform workspaces
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
# AGENTS.md — Deep Research Cross-Tool Rules
|
||||
|
||||
This file is the shared, cross-tool instruction layer for Codex, OpenCode, Claude Code, Gemini CLI, and Antigravity.
|
||||
|
||||
Keep this file short. Do not put Antigravity roles, detailed workflows, or long skill manuals here.
|
||||
|
||||
## Project
|
||||
|
||||
Deep Research produces professional biomedical research reports for R&D, CMC/GMP, management, market, and investment topics.
|
||||
|
||||
This repository is not an application codebase. Its code supports the research pipeline: Python runtime, search utilities, evidence schemas, citation checks, and PDF/DOCX rendering.
|
||||
|
||||
## Instruction Layers
|
||||
|
||||
- Cross-tool baseline: `AGENTS.md`
|
||||
- Gemini / Antigravity override: `GEMINI.md`
|
||||
- Platform adapter source templates: `platform_adapters/`
|
||||
- Rebuilt local platform environments: `platform_envs/` (ignored; generated)
|
||||
- Implementation plan and changelog: `PLAN.md`
|
||||
|
||||
If instructions conflict, use the more specific layer. For Antigravity, `GEMINI.md` and the generated `platform_envs/antigravity/.agent/rules/` override this file.
|
||||
|
||||
## Operating Modes
|
||||
|
||||
Python-core mode:
|
||||
|
||||
- Use `scripts/dr.py`, `scripts/runtime/**`, `configs/models.yaml`, and `platform_adapters/antigravity/agent/skills`.
|
||||
- Platform agents should call the Python CLI rather than reimplement worker orchestration.
|
||||
- Model routing is resolved by the Python runtime.
|
||||
|
||||
Antigravity native mode:
|
||||
|
||||
- Use a rebuilt `platform_envs/antigravity` workspace.
|
||||
- Inside that workspace, Antigravity loads `.agent/agents.md`, `.agent/rules/`, `.agent/skills/`, and `.agent/workflows/`.
|
||||
- Antigravity uses its own model quota for research execution.
|
||||
- Python scripts are auxiliary for scaffolding, local material processing, deterministic checks, citation/report rendering, and status.
|
||||
- Do not run Python model-worker commands such as `dr.py run`, `research --execute-packets`, or `research --assemble-chapters` unless the user explicitly approves external API/ZenMux usage.
|
||||
- Do not open the full multi-platform repository in Antigravity for production research. Rebuild and open `platform_envs/antigravity`.
|
||||
|
||||
## Core Commands
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py init "研究主题" --slug <slug> --method <method>
|
||||
uv run python scripts/dr.py frame <slug>
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --execute-packets
|
||||
uv run python scripts/dr.py review <slug>
|
||||
uv run python scripts/dr.py finalize <slug>
|
||||
uv run python scripts/deploy_adapters.py antigravity --target /path/to/workspace --dry-run
|
||||
```
|
||||
|
||||
## Research Integrity
|
||||
|
||||
- No fabricated data, URLs, DOIs, clinical results, regulatory status, patents, or market figures.
|
||||
- No factual claim without a source ID or a clearly marked "to verify" status.
|
||||
- No claim that a search or verification was performed unless there is a real tool receipt or search log.
|
||||
- Search snippets, AI summaries, and model memory are discovery leads, not final evidence.
|
||||
- Every major conclusion needs at least two independent Tier 1-2 sources. If not available, downgrade and mark uncertainty.
|
||||
- Counter-evidence is mandatory. Do not collect only supporting evidence.
|
||||
- Wikipedia is allowed for orientation only and must not support final conclusions.
|
||||
- Use Chinese for formal report writing. English may remain in search keywords, titles, DOI/URL, original excerpts, and raw notes.
|
||||
|
||||
## Method Selection
|
||||
|
||||
Do not default to McKinsey/MECE for every topic.
|
||||
|
||||
Choose the research method and tools based on the user's scenario. Use `platform_adapters/antigravity/agent/skills/method-selection/SKILL.md` as source, or `.agent/skills/method-selection/SKILL.md` inside the generated Antigravity env.
|
||||
|
||||
## Source Quality
|
||||
|
||||
Detailed scoring belongs in `platform_adapters/antigravity/agent/skills/source-quality/SKILL.md`.
|
||||
|
||||
Baseline tiers:
|
||||
|
||||
- Tier 1: original academic papers, systematic reviews where appropriate, regulator documents, clinical trial registries, patents, company filings.
|
||||
- Tier 2: authoritative consulting/industry reports, industry associations, reputable professional media and databases.
|
||||
- Tier 3: preprints, conference abstracts, brokerage research, company white papers. Use with caution.
|
||||
- Tier 4: general web pages, ordinary news, Wikipedia. Discovery only.
|
||||
|
||||
## Safety
|
||||
|
||||
- Keep API keys only in `secrets.env`; never hardcode or commit secrets.
|
||||
- Do not read or expose secrets unless the user explicitly asks.
|
||||
- Do not overwrite user settings or existing workspace rule/skill/workflow files unless the user asks for `--force`.
|
||||
- Do not run destructive git commands such as `git reset --hard`, `git clean`, or broad file deletion without explicit approval.
|
||||
- Do not write outside the current workspace unless the user explicitly approves.
|
||||
|
||||
## Change Management
|
||||
|
||||
- Treat `AGENTS.md`, `GEMINI.md`, `platform_adapters/**`, `scripts/update_platform_envs.py`, and `PLAN.md` as production configuration.
|
||||
- Keep root rules short. Move platform-specific roles, constraints, skills, and workflows to `platform_adapters/<platform>/`, then rebuild `platform_envs/<platform>/`.
|
||||
- When changing runtime rules or adapter behavior, update `PLAN.md` changelog.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Claude Code Project Instructions
|
||||
|
||||
This repository is Deep Research v0.20.
|
||||
|
||||
- Python core is the source of truth: `scripts/dr.py`, `scripts/runtime/**`, `configs/models.yaml`, `.agents/skills`.
|
||||
- Claude Code is a surface adapter. Do not perform core orchestration in the chat thread.
|
||||
- Use `.claude/skills/*/SKILL.md` commands such as `/dr-run`, `/dr-research`, `/dr-review`, `/dr-finalize`.
|
||||
- Keep formal research outputs Chinese-first. Search keywords, source titles, excerpts, DOI/URL and raw notes may remain English.
|
||||
- Do not modify `projects/**` unless the user is intentionally running a research project.
|
||||
|
||||
Typical commands:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py run "研究主题" --slug <slug> --method mckinsey_market
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --execute-packets
|
||||
uv run python scripts/dr.py review <slug>
|
||||
uv run python scripts/dr.py finalize <slug>
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
# GEMINI.md — Gemini / Antigravity Overrides
|
||||
|
||||
This file has higher priority than `AGENTS.md` for Gemini CLI and Antigravity.
|
||||
|
||||
## Load The Right Layer
|
||||
|
||||
- Shared baseline: `AGENTS.md`
|
||||
- Antigravity source templates: `platform_adapters/antigravity/agent/`
|
||||
- Generated Antigravity workspace: `platform_envs/antigravity/.agent/`
|
||||
|
||||
For Antigravity native research, first rebuild the environment with `python scripts/update_platform_envs.py --platform antigravity`, then open `platform_envs/antigravity` in Antigravity. Inside that generated workspace, load `.agent/agents.md`, `.agent/rules/deep-research-antigravity.md`, `.agent/skills/antigravity-surface-adapter/SKILL.md`, `.agent/skills/method-selection/SKILL.md`, `.agent/skills/research-quality-gates/SKILL.md`, and `.agent/workflows/deep-research-native.md`.
|
||||
|
||||
Do not open the full multi-platform repository in Antigravity for production research.
|
||||
|
||||
Use `/memory show` or `/memory refresh` in Gemini CLI when the loaded context may be stale.
|
||||
|
||||
## Gemini Failure Modes
|
||||
|
||||
Treat Gemini-family models as high risk for false certainty in research.
|
||||
|
||||
- Never say "searched", "verified", "confirmed", "officially shows", or "according to source" unless a real tool call happened in this session or phase and the result is logged.
|
||||
- Do not use model memory, snippets, or AI summaries as evidence.
|
||||
- Every concrete fact needs a `source_id`, claim-ledger row, or a clear "to verify" label.
|
||||
- If the original source cannot be opened, write "未能访问原文,仅作为发现线索" and do not extract exact values from it.
|
||||
- Keep `search_log.jsonl`, `claims_ledger.jsonl`, and `continuation_state.json` current in Antigravity native runs.
|
||||
- Prefer "未找到足够证据" over filling gaps.
|
||||
|
||||
## Platform Boundary
|
||||
|
||||
Gemini CLI normally uses Python-core mode through the generated `platform_envs/gemini-cli/.gemini/commands/dr/*.toml` or `uv run python scripts/dr.py ...`.
|
||||
|
||||
Antigravity is different: use native mode and its model quota for research execution. Python scripts are auxiliary unless the user explicitly approves Python model-worker/API usage.
|
||||
|
||||
Do not modify `projects/**` unless the user is intentionally running a research project.
|
||||
+820
@@ -0,0 +1,820 @@
|
||||
# Deep Research 系统方案(Python Core + 多平台 Adapter)
|
||||
|
||||
> 本文件是整套方案的**单一真实源**,中断后续接时从此文件恢复上下文。
|
||||
> 最后更新:2026-05-07
|
||||
> 实施阶段:v0.20 — Skill-driven Python core 重构
|
||||
|
||||
---
|
||||
|
||||
## 0. 背景与目标
|
||||
|
||||
### 0.1 用户画像
|
||||
- 主业:生物医药行业的研发、工艺、管理、投资研究(非 coding)
|
||||
- 痛点:此前在 OpenClaw / Hermes 做 Deep Research 时 token 消耗大但效果差
|
||||
- 预期:以麦肯锡、德勤等顶尖机构的方法论输出专业报告
|
||||
|
||||
### 0.2 质量标准(硬性)
|
||||
- **字数**:综述类 ≥ 10,000 字;研究类 ≥ 30,000 字
|
||||
- **证据**:每条结论至少 2 个独立 Tier 1-2 信源佐证,否则标注"观点待验证"
|
||||
- **结构**:8-15 章,每章下分 section / sub-section;每个标题即一个观点
|
||||
- **信源**:优先论文、专利、权威研究报告;排除劣质纯新闻、自媒体
|
||||
- **交付**:PDF(ReportLab)+ DOCX(Pandoc),格式专业、中文排版规范
|
||||
|
||||
---
|
||||
|
||||
## 1. 关键决策(已与用户确认)
|
||||
|
||||
| 维度 | 决策 |
|
||||
|---|---|
|
||||
| LLM 接入 | **zenmux 中转**(多模型混合) |
|
||||
| 项目位置 | **仅项目级** `.opencode/`,项目根目录为 `deep_research/` |
|
||||
| 搜索 API | **Tavily / Brave / Exa 走 MCP Server**;生物医药专业信源走 skill+bash |
|
||||
| PDF 方案 | **ReportLab**(中文字体一次注册,样式集中 StyleSheet) |
|
||||
| DOCX 方案 | **Pandoc + reference-doc** |
|
||||
| 字数落实 | 框架阶段分配配额 + 终稿校验双保险 |
|
||||
| 交互节奏 | Phase 1 末、Phase 3 末强制确认 |
|
||||
| 并发执行 | Python task-card worker pool(平台 subagent 仅作可选表层能力) |
|
||||
| 中文字体 | **思源宋体 + 思源黑体 + 霞鹜文楷**,通过 `download-fonts.sh` 自动拉取 |
|
||||
| Antigravity 适配 | 使用 `.agents/rules` + `.agents/skills` 指导 Antigravity 原生执行 Deep Research;Gemini Flash 管流程,Opus/Gemini Pro 分 phase 执行,Python core 退为辅助工具 |
|
||||
|
||||
---
|
||||
|
||||
## 2. 模型分配(zenmux 双 provider 架构)
|
||||
|
||||
详细 slug、cache 机制、升级流程见 `AGENTS.md` §6。关键要点:
|
||||
|
||||
- **Claude 系列走 `zenmux-anthropic/...`(无 `anthropic/` 前缀的裸 slug)**,以便 prompt cache 原生生效
|
||||
- 其他模型走 `zenmux/<vendor>/<slug>`,隐式缓存自动生效
|
||||
- 真实可用模型清单通过 `curl zenmux /api/v1/models` 随时查询;不要依赖 zenmux 文档里的过期示例
|
||||
|
||||
| 角色 | 模型 | 完整 model 字段 | 上下文 | 温度 | top_p |
|
||||
|---|---|---|---|---|---|
|
||||
| dr-plan(框架规划) | Claude Opus 4.7 | `zenmux-anthropic/claude-opus-4.7` | 1M | **0.7** | **0.9** |
|
||||
| dr-pm(项目经理/调度) | Claude Sonnet 4.6 | `zenmux-anthropic/claude-sonnet-4.6` | 1M | 0.2 | 默认 |
|
||||
| dr-chief-editor(总编/终审) | Gemini 3.1 Pro Preview | `zenmux/google/gemini-3.1-pro-preview` | 1M | 0.3 | 默认 |
|
||||
| dr-searcher(轻量检索) | Claude Haiku 4.5 | `zenmux-anthropic/claude-haiku-4.5` | 200K | 0.1 | 默认 |
|
||||
| dr-analyst(章节深研) | Claude Sonnet 4.6 | `zenmux-anthropic/claude-sonnet-4.6` | 1M | 0.3 | 默认 |
|
||||
| dr-verifier(反方验证) | GPT-5.4 Pro(首选)/ Qwen3.6-Plus / MiniMax M2.7 | `zenmux/openai/gpt-5.4-pro` 等 | 1.05M | 0.2 | 默认 |
|
||||
| dr-polisher(去AI味+润色) | Claude Sonnet 4.6 | `zenmux-anthropic/claude-sonnet-4.6` | 1M | 0.4 | 默认 |
|
||||
| dr-reporter(出稿) | Claude Sonnet 4.6 | `zenmux-anthropic/claude-sonnet-4.6` | 1M | 0.1 | 默认 |
|
||||
|
||||
**Cache 行为**:Claude 走 `@ai-sdk/anthropic` 会自动打 `cache_control` 断点,zenmux 的 Anthropic 端点完整支持 4 种 cache 模式。Opus 4.7 cache read 价格仅 0.5 USD/M tokens(对比输入价 25 USD/M,节省 98%)。验证方法见 `AGENTS.md` §6.5。
|
||||
|
||||
### 2.1 Antigravity 原生模型策略
|
||||
|
||||
Antigravity 当前可选 models 包括 Gemini 3.1 Pro (High/Low)、Gemini 3 Flash、Claude Sonnet 4.6 (Thinking)、Claude Opus 4.6 (Thinking) 与 GPT-OSS 120B。Codex 使用经验显示,若 Antigravity 仍默认调用 Python core model workers,研究主流程容易回到 ZenMux,并且 packet/chapter assembly 有碎片化风险。因此 Antigravity 采用 native 模式:用 skill 指导 Antigravity 自身模型按 phase 写产物,Python core 只负责脚手架、确定性校验、引用和出稿。
|
||||
|
||||
默认策略:
|
||||
|
||||
- Surface manager:Gemini 3 Flash,负责读 skill、维护 task list、推进 phase、跑轻量命令和收集 artifact。
|
||||
- Phase 0-1:Claude Opus 4.6 (Thinking),负责材料解读、研究方法选择、大胆假设、章节架构和成功标准。
|
||||
- Phase 2:Gemini 3.1 Pro (Low),负责证据包、反方证据、chapter brief、初稿,优先追求速度和可控成本。
|
||||
- Phase 3:Gemini 3.1 Pro (High),先做总编审校和证伪;若质量不足,再人工决定是否换模型复核。
|
||||
- Phase 4:Claude Opus 4.6 (Thinking),负责最终中文统稿、Executive Summary、表达质量和交付一致性。
|
||||
- Python core 禁止默认接管 `run/research --execute-packets/assemble-chapters`;只有用户明确授权外部模型/API 消耗时才运行。
|
||||
|
||||
---
|
||||
|
||||
## 3. 完整架构
|
||||
|
||||
### 3.0 v0.20 Python Core 架构
|
||||
|
||||
v0.20 后,核心编排从平台 prompt 迁移到项目自有 Python runtime:
|
||||
|
||||
- `scripts/dr.py` 是稳定入口:`init`、`frame`、`run`、`research`、`review`、`finalize`、`skills`、`models`。
|
||||
- `scripts/runtime/*` 负责 role/task 模型解析、skill registry、task cards、packet schema、manifest 更新。
|
||||
- `.agents/skills` 是 canonical skill registry,也是 Antigravity 默认 workspace skill 目录;`.opencode/skills` 等 adapter 目录由 `dr.py skills sync` 生成。
|
||||
- OpenCode/Codex/Claude Code 只作为 surface adapter,调用 Python CLI,不再承载默认并发调度。
|
||||
- Phase 2 默认生成 `phase2/task_cards.json` 与 `phase2/packets/*.json`,减少长上下文传递。
|
||||
- Phase 2 在正式写章前生成 `phase2/chapter_briefs/*.json`,先把并发证据收束为章节主线,降低碎片化。
|
||||
- Phase 2 packet worker 对模型返回做一次 JSON 修复;仍失败的任务写入 `phase2/packet_errors/*.json`,不阻塞同批其他任务。
|
||||
- Phase 2 chapter assembly 会校验正文 `[src_xxx]` 是否来自 chapter brief;失败章写入 `phase2/chapter_errors/*.json`,不阻塞同批其他章节。
|
||||
- Phase 4 默认中文原生:`final_zh.md -> build_report`,legacy 英译中链路仅由 `--legacy-translate` 显式启用。
|
||||
- Phase 1 必须选择 `research_method`,由 `configs/research_methods.yaml` 决定框架方法和 Phase 2 task axes;MECE 不再是唯一默认。
|
||||
- 用户提供资料入口已支持 `input_materials` / `phase0/inputs` / `phase0/extracted`;PDF 文本抽取与 FireRed OCR 扫描件识别已先行落地,DOCX/PPTX/表格结构化继续放入 v0.21。
|
||||
- Antigravity 入口已落地:`.agents/rules/deep-research-antigravity.md` 约束其优先使用 Antigravity 模型配额,`.agents/skills/antigravity-surface-adapter` 提供 native runbook、模型切换和搜索策略。
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ 用户 (TUI 入口) │
|
||||
└─────────────────────┬───────────────────────────────────────────┘
|
||||
│ Tab 切换主 agent
|
||||
┌───────────┼────────────┐
|
||||
▼ ▼ ▼
|
||||
┌───────┐ ┌───────┐ ┌──────────┐
|
||||
│ dr- │ │ dr- │ │ dr-chief │ (Primary)
|
||||
│ plan │ │ pm │ │ -editor │
|
||||
│ (Opus)│ │(Sonnet)│ │ (Gemini) │
|
||||
└───┬───┘ └───┬────┘ └─────┬────┘
|
||||
│ │ Task 工具委派│
|
||||
│ ▼ │
|
||||
│ ┌─────────────┐ │
|
||||
│ │ Subagents │ │ (并行 3-4 个)
|
||||
│ ├─────────────┤ │
|
||||
│ │ dr-searcher │ │ Haiku 轻检索
|
||||
│ │ dr-analyst │ │ Sonnet 深研
|
||||
│ │ dr-verifier │ │ GPT-5/Qwen 交叉
|
||||
│ │ dr-polisher │ │ Sonnet 润色
|
||||
│ │ dr-reporter │ │ Sonnet 出稿
|
||||
│ └─────────────┘ │
|
||||
│ │
|
||||
调用 Skills ───────────────────┘
|
||||
调用 MCP Servers
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. 目录结构
|
||||
|
||||
```
|
||||
deep_research/
|
||||
├── PLAN.md # 本文件 — 方案真实源
|
||||
├── AGENTS.md # 研究方法论与规则(OpenCode 自动读)
|
||||
├── README.md # 使用指南
|
||||
├── .gitignore
|
||||
├── secrets.env.example # 密钥模板
|
||||
├── secrets.env # 实际密钥(不入 git)
|
||||
│
|
||||
├── .opencode/
|
||||
│ ├── opencode.json # MCP + 权限 + 默认模型
|
||||
│ ├── agents/
|
||||
│ │ ├── dr-plan.md # [MVP] Primary:框架规划 Opus temp 0.7
|
||||
│ │ ├── dr-pm.md # [MVP] Primary:PM/调度 Sonnet temp 0.2
|
||||
│ │ ├── dr-chief-editor.md # [待补] Primary:总编 Gemini
|
||||
│ │ ├── dr-searcher.md # [待补] Subagent:轻检索 Haiku
|
||||
│ │ ├── dr-analyst.md # [待补] Subagent:深研 Sonnet
|
||||
│ │ ├── dr-verifier.md # [待补] Subagent:交叉验证 GPT-5/Qwen
|
||||
│ │ ├── dr-polisher.md # [待补] Subagent:润色 Sonnet
|
||||
│ │ └── dr-reporter.md # [待补] Subagent:出稿 Sonnet
|
||||
│ ├── skills/
|
||||
│ │ ├── search-strategy/SKILL.md # [MVP] 检索策略总纲
|
||||
│ │ ├── source-quality/SKILL.md # [MVP] 信源评级与黑名单
|
||||
│ │ ├── length-budget/SKILL.md # [MVP] 字数预算
|
||||
│ │ ├── pdf-reportlab/SKILL.md # [MVP] ReportLab 中文模板
|
||||
│ │ ├── biomed-pubmed/SKILL.md # [待补]
|
||||
│ │ ├── biomed-clinicaltrials/SKILL.md # [待补]
|
||||
│ │ ├── biomed-openfda/SKILL.md # [待补]
|
||||
│ │ ├── biomed-patents/SKILL.md # [待补]
|
||||
│ │ ├── biomed-finance/SKILL.md # [待补]
|
||||
│ │ ├── docx-pandoc/SKILL.md # [待补]
|
||||
│ │ ├── citation-manager/SKILL.md # [待补]
|
||||
│ │ ├── evidence-table/SKILL.md # [待补]
|
||||
│ │ ├── mckinsey-method/SKILL.md # [待补]
|
||||
│ │ └── report-template/SKILL.md # [待补]
|
||||
│ ├── commands/
|
||||
│ │ ├── dr-init.md # [MVP] /dr-init <topic>
|
||||
│ │ ├── dr-frame.md # [MVP] /dr-frame
|
||||
│ │ ├── dr-research.md # [待补] /dr-research
|
||||
│ │ ├── dr-review.md # [待补] /dr-review
|
||||
│ │ ├── dr-finalize.md # [待补] /dr-finalize
|
||||
│ │ └── dr-status.md # [待补] /dr-status
|
||||
│ └── templates/
|
||||
│ ├── report-template.py # [MVP] ReportLab PDF 模板
|
||||
│ ├── report-template.docx # [待补] Pandoc reference-doc
|
||||
│ ├── report-template.md # [待补] Markdown 骨架
|
||||
│ └── fonts/
|
||||
│ ├── download-fonts.sh # [MVP] 字体自动下载
|
||||
│ ├── README.md # 字体来源说明
|
||||
│ ├── SourceHanSerifSC-Regular.otf (git 忽略)
|
||||
│ ├── SourceHanSerifSC-Bold.otf (git 忽略)
|
||||
│ ├── SourceHanSansSC-Light.otf (git 忽略)
|
||||
│ ├── SourceHanSansSC-Medium.otf (git 忽略)
|
||||
│ ├── SourceHanSansSC-Bold.otf (git 忽略)
|
||||
│ ├── SourceHanSansSC-Heavy.otf (git 忽略)
|
||||
│ └── LXGWWenKai-Regular.ttf (git 忽略)
|
||||
│
|
||||
├── projects/ # 每个研究主题一个子目录
|
||||
│ └── <topic-slug>/
|
||||
│ ├── manifest.json # 元信息
|
||||
│ ├── phase1/
|
||||
│ │ ├── initial-scan.md
|
||||
│ │ ├── framework.md
|
||||
│ │ └── interview.md
|
||||
│ ├── phase2/
|
||||
│ │ ├── evidence/
|
||||
│ │ ├── sources.jsonl
|
||||
│ │ └── drafts/
|
||||
│ ├── phase3/
|
||||
│ │ ├── critique.md
|
||||
│ │ └── revisions/
|
||||
│ └── phase4/
|
||||
│ ├── final.md
|
||||
│ ├── final.pdf
|
||||
│ ├── final.docx
|
||||
│ └── citations.bib
|
||||
│
|
||||
└── archive/ # 历史研究归档
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. 字体方案(方案 A:思源 + 霞鹜文楷)
|
||||
|
||||
| 用途 | 字体 | 字号 | 行高 |
|
||||
|---|---|---|---|
|
||||
| 正文 | 思源宋体 Regular | 10.5pt | 16pt |
|
||||
| 正文粗体/术语 | 思源宋体 Bold | 10.5pt | 16pt |
|
||||
| 一级标题(章) | 思源黑体 Bold | 18pt | 28pt |
|
||||
| 二级标题(section) | 思源黑体 Bold | 14pt | 22pt |
|
||||
| 三级标题(subsection) | 思源黑体 Medium | 12pt | 18pt |
|
||||
| 摘要/引文/批注 | 霞鹜文楷 Regular | 10.5pt | 16pt |
|
||||
| 图表标题 | 思源黑体 Medium | 9pt | 13pt |
|
||||
| 脚注/参考文献 | 思源宋体 Regular | 9pt | 13pt |
|
||||
| 页眉页脚 | 思源黑体 Light | 8pt | 12pt |
|
||||
| 封面主标题 | 思源黑体 Heavy | 32pt | 42pt |
|
||||
|
||||
所有字体均为 **SIL OFL** 许可,可自由商用、嵌入 PDF 分发。
|
||||
|
||||
**字体下载来源(download-fonts.sh)**:
|
||||
- 思源宋体:`https://github.com/adobe-fonts/source-han-serif/releases`
|
||||
- 思源黑体:`https://github.com/adobe-fonts/source-han-sans/releases`
|
||||
- 霞鹜文楷:`https://github.com/lxgw/LxgwWenKai/releases`
|
||||
|
||||
---
|
||||
|
||||
## 6. 工作流(四阶段)
|
||||
|
||||
### Phase 1:框架规划(dr-plan 主导)
|
||||
1. `/dr-init <topic>` 创建项目目录 + manifest.json,进行初轮对话访谈
|
||||
2. `/dr-frame` 触发:
|
||||
- dr-plan 用 `skill:search-strategy` 指挥 3 个 dr-searcher 并行初扫
|
||||
- 生成 8-15 章大纲 + 每章研究思路 + 字数配额(依据 `skill:length-budget`)
|
||||
- **【停】等用户确认** — 可迭代
|
||||
|
||||
### Phase 2:深度研究(dr-pm 主导)
|
||||
1. `/dr-research` 触发:
|
||||
- dr-pm 按章节分批并行调度 dr-analyst
|
||||
- 每章完成后自动调度 dr-verifier 做反方验证
|
||||
- 每条结论自动填入 `evidence/chXX-evidence.md` 的"观点-证据-来源-置信度"表
|
||||
- `skill:length-budget` 自检,不足则继续挖掘
|
||||
|
||||
### Phase 3:总编审校(dr-chief-editor 主导)
|
||||
1. `/dr-review` 触发:
|
||||
- Gemini 3.1 Pro 通读全部 drafts
|
||||
- 产出 `critique.md`:逻辑漏洞、证据不足、观点雷同、金字塔违反
|
||||
- **【停】等用户决策**:
|
||||
- a) 直接修正 → 进入 finalize
|
||||
- b) 特定章节回炉 phase2
|
||||
- c) 整体重来 → 回 phase1
|
||||
|
||||
### Phase 4:成稿(dr-chief-editor 调度)
|
||||
1. `/dr-finalize` 触发:
|
||||
- dr-polisher 去 AI 味、中文表达、术语统一
|
||||
- dr-reporter 执行:
|
||||
- `python .opencode/templates/report-template.py final.md → final.pdf`
|
||||
- `pandoc final.md --reference-doc=... → final.docx`
|
||||
|
||||
---
|
||||
|
||||
## 7. 如何避免"多 agent 实际是一个主模型跑到底"
|
||||
|
||||
OpenCode 的坑:如果只是在主会话里装样子地写"让 X agent 做",实际还是主模型在跑,token 花了但没分工。
|
||||
|
||||
**三道保险**:
|
||||
1. **命令级强制**:所有命令 frontmatter 设 `subtask: true`,强制走 Task 工具,真起子会话
|
||||
2. **Agent 强绑模型**:每个 subagent 的 `model` 字段写死到具体模型,OpenCode 会真正起独立会话用那个模型
|
||||
3. **任务权限白名单**:dr-pm 的 `permission.task` 精确限定只能调用 subagent,不能跨级调度
|
||||
4. **可验证**:TUI 里 `<Leader>+Right` 切入子会话,能看到真实在跑的模型名
|
||||
|
||||
---
|
||||
|
||||
## 8. 完整实施清单(v0.4 全部完成)
|
||||
|
||||
### 基础设施
|
||||
- [x] 目录结构
|
||||
- [x] PLAN.md / AGENTS.md / README.md / .gitignore
|
||||
- [x] .opencode/opencode.json(双 provider + MCP + 权限)
|
||||
- [x] secrets.env.example
|
||||
- [x] scripts/setup.sh / activate.sh / verify-zenmux.sh
|
||||
- [x] requirements.txt / pyproject.toml(uv)
|
||||
|
||||
### Agents(8 个)
|
||||
- [x] dr-plan(Opus 4-7,temp 0.7)
|
||||
- [x] dr-pm(Sonnet 4-6,temp 0.2)
|
||||
- [x] dr-searcher(Haiku 4-5,temp 0.1)
|
||||
- [x] dr-analyst(Sonnet 4-6,temp 0.3)
|
||||
- [x] dr-verifier(GPT-5.4-pro,temp 0.2)
|
||||
- [x] dr-chief-editor(Gemini 3.1 Pro Preview,temp 0.3)
|
||||
- [x] dr-polisher(Sonnet 4-6,temp 0.4)
|
||||
- [x] dr-reporter(Sonnet 4-6,temp 0.1)
|
||||
|
||||
### Commands(6 个)
|
||||
- [x] /dr-init
|
||||
- [x] /dr-frame
|
||||
- [x] /dr-research
|
||||
- [x] /dr-review
|
||||
- [x] /dr-finalize
|
||||
- [x] /dr-status
|
||||
|
||||
### Skills(7 个)
|
||||
- [x] search-strategy
|
||||
- [x] source-quality
|
||||
- [x] length-budget
|
||||
- [x] pdf-reportlab
|
||||
- [x] evidence-table
|
||||
- [x] citation-manager
|
||||
- [x] mckinsey-method
|
||||
|
||||
### 报告模板
|
||||
- [x] report-template.py(ReportLab PDF)
|
||||
- [x] fonts/download-fonts.sh
|
||||
|
||||
### 待补(后续优化)
|
||||
- [ ] docx-pandoc skill(Pandoc reference-doc 模板)
|
||||
- [ ] 生物医药专业信源 skill(PubMed / ClinicalTrials / openFDA / 专利 / 金融)
|
||||
- [ ] dr-reporter 的 DOCX 样式优化
|
||||
|
||||
---
|
||||
|
||||
## 9. 后续路径
|
||||
|
||||
### 优化项(实施阶段 5)
|
||||
|
||||
### 优化项(实施阶段 4)
|
||||
- 把稳定的 bash skill 封装成 MCP server
|
||||
- 引入 Exa /neural search 提升专业文献召回
|
||||
- 支持图表自动生成(matplotlib 模板库)
|
||||
|
||||
---
|
||||
|
||||
## 10. 用户待办
|
||||
|
||||
1. [x] ~~模型 slug 映射~~(v0.3 已完成,基于 zenmux `/api/v1/models` 实时数据)
|
||||
2. [ ] 准备 API keys(`secrets.env` 填写):
|
||||
- ZENMUX_API_KEY(必填,格式 `sk-ai-v1-xxx`)
|
||||
- TAVILY_API_KEY / EXA_API_KEY / BRAVE_API_KEY
|
||||
- NCBI_API_KEY(可选,高频查 PubMed 时需要)
|
||||
3. [ ] 环境初始化(跨 macOS/Debian,用 uv):
|
||||
```bash
|
||||
bash scripts/setup.sh
|
||||
```
|
||||
会自动:装 uv(如缺失)→ `uv sync` 建 `.venv/` + 装依赖 → 检查系统二进制。
|
||||
4. [ ] 系统二进制(setup.sh 会检测但不自动装):
|
||||
- `pandoc`(DOCX 出稿阶段必须)
|
||||
- `opencode`(TUI 主程序)
|
||||
5. [ ] 首次使用前:
|
||||
```bash
|
||||
source scripts/activate.sh # 激活 venv + 载入 secrets
|
||||
bash .opencode/templates/fonts/download-fonts.sh # 下载字体
|
||||
bash scripts/verify-zenmux.sh # 验证端点与 cache
|
||||
```
|
||||
6. [ ] 用一个小主题跑通 MVP 流水线,验证:
|
||||
- subagent 是否真正被独立调度(TUI 可见子会话)
|
||||
- 字数配额是否正确落到 framework.md
|
||||
- 信源过滤是否生效(Tier 4 不会进 sources.jsonl)
|
||||
- zenmux 后台 Logs 能看到 `cache_read_input_tokens > 0`
|
||||
|
||||
---
|
||||
|
||||
## 11. 风险与缓解
|
||||
|
||||
| 风险 | 缓解 |
|
||||
|---|---|
|
||||
| zenmux 模型 slug 命名变动 | AGENTS.md §6 单点维护映射表,全部 agent 引用此表 |
|
||||
| Claude prompt cache 未生效 → 成本暴涨 | Claude 系列强制走 `zenmux-anthropic`(`@ai-sdk/anthropic` 通道),zenmux 后台 Logs 验证 `cache_creation_input_tokens` 字段 |
|
||||
| MCP server 首次启动慢 | 用 `opencode serve` 常驻;subagent 设合理 timeout |
|
||||
| 搜索 API 限流 | search-strategy 里规定每批 ≤3 个 searcher;失败重试 3 次带退避 |
|
||||
| Opus 成本高 | dr-plan 用 steps 限制迭代次数(见 length-budget) |
|
||||
| ReportLab 中文渲染慢 | matplotlib 预渲染 PNG,StyleSheet 缓存 |
|
||||
| 中断恢复 | 所有状态写 manifest.json + phase 文件,本 PLAN.md 是元控制文件 |
|
||||
|
||||
---
|
||||
|
||||
## 12. 变更记录
|
||||
|
||||
- 2026-04-20 v0.1:初版方案确定,MVP 路径 2 开始实施
|
||||
- 2026-04-20 v0.2:**双 provider 架构**上线,解决 zenmux Claude prompt cache 问题
|
||||
- 新增 `zenmux-anthropic` 自定义 provider(`@ai-sdk/anthropic` + `https://zenmux.ai/api/anthropic`)
|
||||
- Claude 系列迁移到裸 slug
|
||||
- 非 Claude 系列保留 `zenmux/<vendor>/<slug>` 走 OpenAI 兼容端点
|
||||
- AGENTS.md §6 重写:cache 机制、验证锚点、最低 token、升级流程
|
||||
|
||||
- 2026-04-20 v0.3:**修正 v0.2 错误 + 切换到 uv**
|
||||
- **模型修正**:v0.2 用了 zenmux 文档里过期的模型列表(被用户指正),重新通过 `curl zenmux /api/v1/models` 拉真实清单
|
||||
- Claude 恢复实际最新版:Opus **4.7** / Sonnet **4.6** / Haiku 4.5(Opus/Sonnet 都是 1M 上下文)
|
||||
- dr-chief-editor 升级为 Gemini **3.1 Pro Preview**(1M)
|
||||
- dr-verifier 恢复 GPT-5.4 Pro(1.05M)/ Qwen 3.6 Plus / MiniMax M2.7 / Kimi K2.5
|
||||
- 新增 AGENTS.md §6.7 "模型升级流程",**原则:模型 slug 以 zenmux `/api/v1/models` 实时返回为准**
|
||||
- **Python 环境切换到 uv**(v0.2 是 pip+venv,跨平台体验差)
|
||||
- 新增 `pyproject.toml` 作为依赖真源
|
||||
- `scripts/setup.sh` 改为调 `uv sync`(自动装 uv、装 Python、建 venv、装依赖)
|
||||
- `scripts/activate.sh` 激活时自动找 uv 路径
|
||||
- `requirements.txt` 降级为备用清单(无 uv 的沙盒环境兜底)
|
||||
|
||||
- 2026-04-20 v0.4:**全流程完成**
|
||||
- 修复 zenmux-anthropic baseURL 缺 `/v1` 导致返回 HTML 页面的问题
|
||||
- 修复 Anthropic 端点模型名用点号(`4.7`)应改为连字符(`4-7`)
|
||||
- 新增全部 subagent:dr-searcher / dr-analyst / dr-verifier / dr-chief-editor / dr-polisher / dr-reporter
|
||||
- 新增 Phase 2-4 命令:/dr-research / /dr-review / /dr-finalize / /dr-status
|
||||
- 新增 skills:evidence-table / citation-manager / mckinsey-method
|
||||
- Phase 1 已成功跑通(O-糖苷酶立项报告测试主题)
|
||||
|
||||
- 2026-04-21 v0.5:**深度质量改造**(P0+P1+P2 一次到位)
|
||||
|
||||
**根因诊断**:v0.4 跑通后发现 6 类质量问题:
|
||||
1. 并行派发退化(Batch 3 后只派 1 个 subagent)
|
||||
2. 全文 AI 味重(humanizer 能识别的 28 种 AI 模式大量出现)
|
||||
3. Phase 2 草稿(Sonnet)与 Final.md(Gemini 重写)风格断裂
|
||||
4. 标题用了用户原始问题而非正式报告命名
|
||||
5. 每章首节都强制套 SCQA 显式标注(机械套路)
|
||||
6. 正文混入"章节定位/字数配额/研究员 dr-analyst/生成时间"等调度元数据
|
||||
7. PDF 分页散乱,标题孤行
|
||||
8. 参考文献只留占位符 `[由 dr-reporter 自动生成]`
|
||||
|
||||
**工作流重构**:切换为"英文工作 + 最终翻译":
|
||||
- Phase 1:中文访谈 + 双语 framework(中文大纲 + 英文研究思路)
|
||||
- Phase 2:dr-analyst/dr-verifier 全英文产出
|
||||
- Phase 3:dr-chief-editor(Gemini)英文只读审校
|
||||
- Phase 4:全新链路 dr-editor-in-chief → dr-translator → dr-polisher → dr-reporter
|
||||
|
||||
**Agent 调整**:
|
||||
- dr-chief-editor(Gemini 3.1 Pro):收窄为 Phase 3 只读审校,不参与 Phase 4 写作
|
||||
- **新增** dr-editor-in-chief(Opus 4-7):Phase 4 主体,负责合并英文稿、写 Executive Summary / Abstract / Glossary
|
||||
- **新增** dr-translator(Sonnet 4-6):英译中专家
|
||||
- dr-polisher(Sonnet 4-6):强化加载 humanizer-cn + output-hygiene
|
||||
- dr-reporter(Sonnet 4-6):强制回填 citations + 卫生检查
|
||||
- dr-analyst / dr-verifier / dr-pm:切换为英文工作语言
|
||||
- dr-pm:批次间 context 压缩(通过 manifest.batches_summary)
|
||||
|
||||
**Skills 新增/升级**:
|
||||
- `mckinsey-method` 重写:SCQA 仅限 Executive Summary + 各章引入段,禁止显式标注 S/C/Q/A;金字塔原理优先
|
||||
- `length-budget` 升级:4 种字数模式(auto/concise/detailed/deep)+ 英中换算率 1:1.4
|
||||
- **新增** `humanizer-cn`:基于 blader/humanizer + 中文特化(CN-1 到 CN-10)
|
||||
- **新增** `output-hygiene`:禁止词黑名单(章节定位/P0/研究员/占位符/SCQA 标注等 50+ 项)
|
||||
- **新增** `en-zh-translation`:生物医药英译中规范
|
||||
- `pdf-reportlab` 升级:widows/orphans/keepWithNext/splitByRow 分页规则,3 级颜色层次,封面保密标识
|
||||
|
||||
**Commands 升级**:
|
||||
- `/dr-init`:访谈增至 8 步,末尾由 dr-plan 提议 3 个报告标题让用户选
|
||||
- `/dr-frame`:生成双语 framework(章节标题中英对照,研究思路英文为主)
|
||||
- `/dr-finalize`:新链路 dr-editor-in-chief 入口,4 步串行调度
|
||||
|
||||
**模板升级**:
|
||||
- `report-template.py` 重写:颜色层次(h1 深蓝 / h2 蓝 / h3 深灰)、封面保密标识红色、widows=2 orphans=2、表格 splitByRow、禁止孤行寡行
|
||||
|
||||
**manifest.json 新字段**:
|
||||
- `report_title` / `report_subtitle`:与 `topic` 分离,由用户在 /dr-init 选定
|
||||
- `confidentiality`:封面保密标识
|
||||
- `word_budget_mode`:auto/concise/detailed/deep
|
||||
- `target_words_en` / `min_words_en`:英文词数目标
|
||||
- `work_language` / `output_language`:工作和输出语言
|
||||
- `phase2.batches_summary`:批次间 context 压缩的进度摘要
|
||||
|
||||
**v0.4 的"/dr-status" 命令保持**(未改动)
|
||||
|
||||
备份:v0.4 状态打 tag `v0.4-final`;v0.4 的 project 产物归档到 `archive/o-glycosidase-feasibility-2026-v0.4/`
|
||||
|
||||
- 2026-04-22 v0.6:**Phase 4 Python 化 + 术语事实核查**
|
||||
|
||||
**根因**:v0.5.2 的 dr-translator 反复在 output token 超限处卡死。本质原因:单 agent 处理 19k+ 词整文超 Sonnet 4.6 的 ~32k output token 上限,任何 prompt 级的分块追加协议都依赖 LLM 遵从性,实测不稳。
|
||||
|
||||
**决策**:把 Phase 4 的翻译/润色/出稿从 LLM agent 降级为 **Python 脚本 + LLM 调用**。Python 负责"做多少"(切块、循环、重试、断点),LLM 只负责"做什么"(翻译/润色这一小段)。
|
||||
|
||||
**新增 Python 基础设施**(全部独立于 opencode):
|
||||
|
||||
- `scripts/lib/zenmux_client.py` — HTTP 客户端,指数退避重试、token 统计、JSONL 日志、secrets.env 自动加载
|
||||
- `scripts/lib/markdown_chunker.py` — 按 H1/H2 切块,稳定 anchor ID(order + title sha1),合并工具
|
||||
- `scripts/lib/search_client.py` — 通用搜索门面(Exa > Tavily),`trust_env=False` 关键修复系统 socks 代理 TLS EOF 问题
|
||||
- `scripts/prompts/{translate,polish,glossary}_system.txt` — 三个核心 prompt,用自定义 `<<<TAG>>>` 分隔符格式(规避 Markdown-in-JSON 的引号/换行转义问题)
|
||||
|
||||
**新增 Python 脚本**:
|
||||
|
||||
- `scripts/translate.py` — 章节级切块循环翻译 + 术语表累积
|
||||
- `scripts/polish.py` — 按 H2 section 循环润色,记模型自标异常到 polish_notes.jsonl
|
||||
- `scripts/build_glossary.py` — **术语表事实核查**:用 Haiku + Exa 并发验证每个术语的中文译名和英文拼写,发现拼写错误与误译
|
||||
- `scripts/apply_glossary.py` — 把 glossary 发现的明确错误直接字面替换进 final_zh.md;保守策略(只改公司/机构/产品类专有名词,不碰 PDE/ASGPR 等有歧义的缩写)
|
||||
- `scripts/build_report.py` — 统一出稿入口,按 manifest.report_title 命名 PDF/DOCX,自动发现 sources.jsonl
|
||||
|
||||
**report-template.py 深度修复**:
|
||||
|
||||
- 字体注册支持 `fonts/ttf/` 子目录(OTF 的 PostScript outlines 与 ReportLab 不兼容)
|
||||
- 删除 build_disclaimer 的 manifest 重复调用(免责声明从 Markdown 读,不再重复)
|
||||
- 自动跳过正文首个 H1 + 封面元信息段(与封面避免重复)
|
||||
- 识别"目录将在最终渲染时自动生成"占位符 → 自动生成 TOC
|
||||
- 识别"完整编号参考文献列表…"占位符 → 从 `phase2/sources.jsonl` 生成 GB/T 7714 格式引文
|
||||
- src 上标正则扩展:支持 src_A14 / src_B-18 等字母+数字组合(原只支持 src_\\d+)
|
||||
- Unicode 上/下标转 `<super>/<sub>` 标签(思源字体子集不含上标字形,否则渲染方框)
|
||||
- 中英/数字混排自动加半角空格(CJK ↔ ASCII 边界)
|
||||
- 表格样式重做:table-header 水平居中、短 cell 居中、长 cell 左对齐、所有 cell 垂直居中、长文字 CJK 自动换行
|
||||
- TOC 末尾 PageBreak(目录独占整页)
|
||||
|
||||
**Agent 调整**:
|
||||
|
||||
- dr-translator / dr-polisher 标记 `[DEPRECATED v0.6]`,权限全部 deny,保留文件仅供历史参考
|
||||
- dr-editor-in-chief 重构为"只做创作 + bash 调脚本"模式,新增 `uv run *` / `bash scripts/*` 权限
|
||||
- `/dr-finalize` command 重写为 9 步流程:合并英文 → translate.py → build_glossary → apply_glossary → polish → build_report
|
||||
|
||||
**实测结果(dual-target-rnai-pipeline-2026 项目)**:
|
||||
- translate.py:63 块全成功,17 分钟,$1.70,33,441 中文字(膨胀 1.89×)
|
||||
- polish.py:60 块全成功,10.7 分钟,$1.20,字数 -0.2%
|
||||
- build_glossary:201/310 术语核查成功(失败 106 条是代理 TLS EOF,降并发后可补齐),发现关键事实错误:
|
||||
- Maywavee 实为 **Mabwell(迈威生物)** 的拼写错误
|
||||
- Beyotime 中文误译为 '碧云天',实应为 '必贝特医药'
|
||||
- Aurigene 误译 '天津奥利法',应为 '天津奥瑞芙生物医药'
|
||||
- apply_glossary:自动修正 3 处关键错误
|
||||
- build_report:生成《双靶点 RNAi 药物工艺图谱与上游供应链机会研究.pdf》55 页 + 同名 DOCX
|
||||
|
||||
**已知限制**:
|
||||
- dr-analyst 在 Phase 2 可能编造信源 ID(本次正文 101 个 src_id vs sources.jsonl 只 44 条),build_references 会列出缺失项供人工核对
|
||||
- build_glossary 对"通用缩写"判定仍依赖 LLM,存在歧义风险(已加 _AMBIGUOUS_ABBREVS 黑名单防止误伤)
|
||||
- 反方证据段落格式不统一(小节标题/加粗段混用)仍未解决,需改 skill:evidence-table 或 mckinsey-method
|
||||
|
||||
**尚未处理的用户反馈(留待 v0.6.1)**:
|
||||
- 反驳证据段标题规范化(建议从"反方证据/Counter-Evidence"改为观点化标题如"另一种声音")
|
||||
- build_glossary 默认放到 Phase 2 阶段运行,在源头拦截错误
|
||||
- 提示 dr-analyst 加强对公司名/机构名的搜索验证流程
|
||||
|
||||
- 2026-04-24 v0.9:**Phase 4 并发提速 + 模型/搜索攻略本 + Codex 兼容**
|
||||
|
||||
**目标**:在不破坏 OpenCode 主流程的前提下,把 v0.6 Python 化 Phase 4 进一步提速,并补齐跨平台使用说明。OpenCode 仍是主适配器;Codex 第一阶段只复用 `AGENTS.md` 与 Python 脚本,不复刻 OpenCode subagent。
|
||||
|
||||
**Phase 4 并发化**:
|
||||
- `scripts/translate.py` 新增 `--workers`,默认 4;设为 1 时回退串行。
|
||||
- 翻译阶段改为"稳定术语表快照 + 并发 chunk 翻译 + 事后统一合并 glossary patch",避免多线程同时写 `glossary.json`。
|
||||
- `scripts/polish.py` 新增 `--workers`,默认 4;润色块彼此独立,按完成顺序写 chunk,最终按原始 order 合并。
|
||||
- `scripts/lib/zenmux_client.py` 增加日志与 usage 聚合锁,避免并发 JSONL 日志交错或 token 统计竞争。
|
||||
|
||||
**流程修正**:
|
||||
- 修正 `apply_glossary.py` 默认输入,从 `phase4/final_zh_polished.md` 改为 `phase4/final_zh.md`。
|
||||
- `/dr-finalize` 明确默认顺序:`translate.py → build_glossary.py → apply_glossary.py --input phase4/final_zh.md → polish.py → build_report.py`。
|
||||
- 保留二次修正选项:润色后可手动对 `final_zh_polished.md` 再跑一次 `apply_glossary.py --input phase4/final_zh_polished.md --dry-run`。
|
||||
|
||||
**模型与搜索攻略本**:
|
||||
- 新增 `docs/model-playbook.md`:定义 premium / balanced / budget / cn-heavy / verifier 五套模型策略。
|
||||
- 新增 `docs/search-playbook.md`:说明 Tavily / Exa / Brave / Serper / PubMed / ClinicalTrials / FDA/EMA/NMPA / Patents 的使用边界。
|
||||
- 新增 `configs/model_profiles.yaml` 与 `configs/search_profiles.yaml`,作为跨平台、人类和 agent 共用的策略配置参考;当前不强制重构 `.opencode/agents` 自动读取。
|
||||
|
||||
**Codex 兼容**:
|
||||
- 新增 `docs/codex-usage.md`,说明 Codex 下如何遵循 `AGENTS.md`、运行 Phase 4 Python 流水线、检查 git staging,避免误提交 `projects/**` 研究产物。
|
||||
- Codex v1 定位为"审阅/规划/修补/执行脚本";确定性编排继续放在 Python 脚本,OpenCode subagent 调度暂不移植。
|
||||
|
||||
**Git 管理要求**:
|
||||
- 本轮迭代应在独立分支推送到 Gitea。
|
||||
- 提交范围仅限系统文件和文档:`README.md`、`PLAN.md`、`scripts/**`、`docs/**`、`configs/**`、必要的 `.opencode/commands/**`。
|
||||
- 不提交 `projects/**`、生成的 PDF/DOCX/TXT、一次性研究产物或本地临时脚本。
|
||||
|
||||
- 2026-04-24 v0.10:**Codex native adapter(独立复刻版)**
|
||||
|
||||
**目标**:把 Codex 从"辅助 OpenCode 跑脚本"升级为并列 adapter。OpenCode 继续使用 `.opencode/**`;Codex 使用 `.codex/config.toml`、`.codex/agents/*.toml`、`.codex/commands/*.md`、`.agents/skills/**` 和共享 `scripts/**`。
|
||||
|
||||
**已落地的共享层**:
|
||||
- 新增 `scripts/dr.py` 平台无关 CLI:支持 `status`、`prompt`、`glossary`、`finalize`。
|
||||
- 新增 `scripts/install_codex_adapter.py`:从 `codex_adapter_templates/codex/**` 安装 `.codex/**`,并把 `.opencode/skills/**` 复制到 `.agents/skills/**`。
|
||||
- 新增 `scripts/deploy_check.py`:新环境部署自检;必要时用 `--repair --force` 从模板重建 `.codex/**` 并同步 `.agents/skills/**`。
|
||||
- 新增 `codex_adapter_templates/codex/**`:包含 Codex 项目配置、8 个 custom agents 和命令模板;`dr-run` 是主入口,用 Codex 主线程承担 PM 调度,阶段命令只作为调试和人工接管入口。
|
||||
- `configs/model_profiles.yaml` 新增 `codex_native` profile,使用 OpenAI 原生 `gpt-5.4` / `gpt-5.4-mini` 角色映射。
|
||||
- `docs/codex-usage.md` 重写为 Codex native adapter 使用说明。
|
||||
|
||||
**设计约定**:
|
||||
- Codex 默认走 OpenAI 原生模型,不依赖 ZenMux provider。
|
||||
- Codex 不会因 custom agent 文件存在而自动启动 subagent;`dr-run` prompt 必须明确要求主线程 spawn / wait / consolidate。
|
||||
- Phase 1-3 由 `dr-run` 主线程调度 Codex custom agents 执行;Phase 4 由 `scripts/dr.py finalize` 调确定性 Python 流水线。
|
||||
- `.opencode/**` 不改不删,避免破坏 OpenCode 已可用流程。
|
||||
- `.opencode/skills` 将复制到 `.agents/skills`,而非软链接,以保证 Git 与跨机器可移植。
|
||||
|
||||
**安装方式**:
|
||||
- 在本机运行 `uv run python scripts/install_codex_adapter.py --force`。
|
||||
- 安装后运行 `/debug-config` 确认 `.codex/config.toml` 被 Codex 加载。
|
||||
- 自动化研究默认权限:`sandbox_mode = "workspace-write"`、`approval_policy = "never"`、`web_search = "live"`、`sandbox_workspace_write.network_access = true`。
|
||||
- Tavily / Brave / Exa MCP server 在模板中默认 `enabled = true` 且 `required = false`;确认本机 key、npm 与网络可用可直接使用,某个服务异常时再单独关闭。
|
||||
|
||||
- 2026-04-24 v0.11:**项目内搜索网关与 search-strategy 强化**
|
||||
|
||||
**目标**:把搜索主路径从平台 MCP 收敛到项目内 Python CLI,避免 Codex/OpenCode/Gemini/Claude Code 各自配置差异导致策略漂移。
|
||||
|
||||
**变更**:
|
||||
- 新增 `scripts/search.py`:统一搜索入口,支持 `--route scholar|patents|news|general` 与 `--profile biomed_literature|patent_heavy|china_market|investment`。
|
||||
- `scripts/lib/search_client.py` 调整为 Serper / Exa / Tavily 路由:文献走 Serper Scholar,专利走 Serper + Google Patents,新闻走 Serper News,通用搜索走 Exa → Tavily。
|
||||
- `search-strategy` 明确 MCP 只做 gap-fill;文献必须优先 `scripts/search.py --route scholar`,专利必须优先 `scripts/search.py --route patents`。
|
||||
- OpenCode `dr-searcher` / `dr-analyst` / `dr-verifier` 增加搜索网关调用要求与必要 bash 权限。
|
||||
- Codex adapter 模板同步要求 `dr-run`、`dr-searcher`、`dr-analyst`、`dr-verifier` 使用搜索网关。
|
||||
|
||||
- 2026-04-29 v0.12:**三轨并行改造(搜索稳定性 + 模型配置化 + Phase 4 替代式 pipeline)**
|
||||
|
||||
**目标**:并行解决三项瓶颈:
|
||||
1) 搜索工具遵循不稳定;
|
||||
2) 模型选择被硬编码锁定;
|
||||
3) Phase 4 串行链路耗时过长。
|
||||
|
||||
**Track A — 搜索路径可控化(Sprint 1)**:
|
||||
- 新增 `scripts/ground.py`,统一封装 ZenMux native grounding(`web_search_options`)并输出引用 URL。
|
||||
- `scripts/lib/zenmux_client.py` 增加 `web_search` 参数透传与 `chat_complete_with_meta()`(返回 content/usage/citations/raw)。
|
||||
- `scripts/lib/search_client.py` 对 `scholar/patents/news` 默认启用 strict 模式,Serper 异常时显式失败,禁止静默降级。
|
||||
- `scripts/search.py` 增加 `--strict-specialized`、`--trace`、`china_market` 查询重写。
|
||||
- `.opencode/opencode.json` 关闭 Tavily/Brave/Exa MCP 的默认启用,收敛到项目内搜索网关。
|
||||
|
||||
**Track B — 模型配置化(Sprint 2-3)**:
|
||||
- 新增统一配置 `configs/models.yaml`(`simple/medium/premium/cn_heavy/codex_native`)。
|
||||
- 新增 `scripts/lib/model_config.py`,支持 profile 解析、override(`ROLE=MODEL`)与 profile 列表。
|
||||
- `scripts/dr.py` 新增 `models`、`apply-models`,并让 `finalize` 支持 `--model-profile` 与 `--model-override`。
|
||||
- 新增 `scripts/apply_model_profile.py`,可将 profile 批量回填到 `.opencode/agents/*.md` 与 `codex_adapter_templates/codex/agents/*.toml`。
|
||||
- 新增 OpenCode 命令:`/dr-models`、`/dr-apply-models`。
|
||||
|
||||
**Track C — Phase 4 替代式重构(Sprint 4)**:
|
||||
- 新增 `scripts/phase4_pipeline.py` 作为统一编排入口:
|
||||
`translate -> glossary(optional) -> apply_glossary -> polish -> build_report`。
|
||||
- glossary 核查支持 `off/low-confidence/full`,默认 `low-confidence`;低置信度条目过多时自动回退 `full`,避免超长命令参数。
|
||||
- translate/polish workers 支持自动估算(`0 => auto`),降低人工调参成本。
|
||||
- `scripts/dr.py finalize` 与 `.opencode/commands/dr-finalize.md` 切换到新 pipeline。
|
||||
|
||||
**Sprint 5 回归验证**:
|
||||
- 新增 `scripts/sprint5_regression.py`,覆盖模型预设解析、搜索网关 dry-run、Phase 4 finalize dry-run 三项关键回归检查。
|
||||
- 文档同步:`README.md`、`docs/model-playbook.md`、`docs/search-playbook.md`、`docs/codex-usage.md`。
|
||||
|
||||
**Sprint 6 收尾验收**:
|
||||
- AGENTS.md 的 Phase 4 描述更新为 v0.12 真实链路(`dr-editor-in-chief + scripts/phase4_pipeline.py`)。
|
||||
- README 增补一键回归命令:`uv run python scripts/sprint5_regression.py <slug>`。
|
||||
- 验收口径固定:
|
||||
1) `dr.py models --list` 可列出预设;
|
||||
2) `dr.py apply-models` 可 dry-run 与落盘;
|
||||
3) `scripts/search.py` 专用路由默认 strict;
|
||||
4) `dr.py finalize --model-profile <x>` 走统一 Phase 4 pipeline;
|
||||
5) `scripts/sprint5_regression.py` 全部 PASS。
|
||||
|
||||
- 2026-05-05 v0.20:**Skill-driven Python core 重构启动**
|
||||
|
||||
**目标**:把 Deep Research 从 OpenCode/Codex/Claude Code prompt 驱动,迁移为项目自有 Python runtime + skills + model profiles 驱动。平台工具只作为表层入口。
|
||||
|
||||
**已落地**:
|
||||
- 新增 `scripts/runtime/`:skills registry、role runtime、task cards、artifact helpers、orchestrator。
|
||||
- 新增 `scripts/reporting/`:引用生成与 Quarto 字体解析先行拆分,`build_report.py` 保持兼容入口。
|
||||
- 新增 `configs/research_methods.yaml` 与 `scripts/runtime/methods.py`:支持 `mckinsey_market`、`gmp_gap_assessment`、`cmc_process_risk`、`rd_go_no_go`、`management_consulting`。
|
||||
- 新增 `scripts/runtime/assembly.py`:把 packets 聚合为 chapter briefs,并通过中文章节组装 worker 生成 `phase2/drafts/chXX.md`。
|
||||
- 新增 `scripts/runtime/phase1.py` 与 `scripts/runtime/review.py`:Python core 可直接执行 init、frame、review,不再依赖 OpenCode prompt 完成 Phase 1/3 骨架。
|
||||
- `configs/models.yaml` 新增 `defaults.task_types`,模型解析同时返回 roles 与 task_types。
|
||||
- `scripts/dr.py` 新增 `init`、`frame`、`run`、`research`、`review`、`skills list|validate|sync`,`finalize` 默认走中文原生路径;legacy 翻译链路改为显式 `--legacy-translate`。
|
||||
- OpenCode/Codex 命令模板瘦身为 Python CLI wrapper,不再要求平台自行 spawn subagents 或复刻 Phase 1/3 编排逻辑。
|
||||
- 新增 `docs/platform-adapters.md`、`CLAUDE.md`、`GEMINI.md`、`.claude/skills/*`、`.gemini/commands/dr/*.toml`,明确 Codex/OpenCode/Claude Code/Antigravity/Gemini CLI 的调用方式与模型边界。
|
||||
- 新增 `scripts/deploy_adapters.py`:Codex adapter 从 `codex_adapter_templates/codex/**` 部署到 `$CODEX_HOME` 或 `~/.codex`,不再要求仓库内维护 `.codex/**`;旧 `scripts/install_codex_adapter.py` 改为兼容 wrapper。
|
||||
- 新增 `scripts/runtime/materials.py` 与 `skills/document-ingest/SKILL.md`:Phase 0 可复制用户 PDF、直接抽取文本;扫描型 PDF 自动调用 LAN FireRed OCR(默认 `http://192.168.50.100:8001`),结果写入 `phase0/extracted/*.md` 与 manifest。
|
||||
- 新增测试:runtime、CLI、reporting;新增计划中的 `scripts/v020_regression.py` 回归入口。
|
||||
|
||||
**仍需后续增强**:
|
||||
- task-card worker 已支持显式 `--execute-packets` 先检索候选 sources、再调用 ZenMux 并发生成证据包,并自动回填 `phase2/sources.jsonl`;`--build-briefs` 收束为章节 brief;`--assemble-chapters` 生成中文章节草稿。
|
||||
- packet worker 已增加一次 JSON 修复调用与失败隔离;单个 packet 失败会落盘到 `phase2/packet_errors/*.json`,不会拖垮整批并发。
|
||||
- chapter assembly 已增加引用白名单校验与失败隔离;章节正文不得新增 brief 外的 `[src_xxx]`,失败章落盘到 `phase2/chapter_errors/*.json`。
|
||||
- Phase 1 init/frame 已有可执行 Python core 骨架;后续可继续增强为模型辅助访谈与初扫,而不是回到平台 prompt 编排。
|
||||
- v0.21 需要继续实现用户资料导入 pipeline:DOCX/PPTX/图片批量 OCR、表格抽取、材料 source registry、问题清单结构化。
|
||||
- PDF 模块已开始拆分,但 ReportLab/Quarto 渲染主体仍在 `build_report.py` 与 `.opencode/templates/report-template.py` 中。
|
||||
|
||||
- 2026-05-06 v0.20-alpha:**Skill-driven Python core Alpha 与白帆案例暴露问题**
|
||||
|
||||
**Alpha 目标**:先把 Python core、skill registry、Codex adapter 外部部署、Phase0 PDF/OCR、task-card 并发、packet/brief/draft 骨架跑成可执行版本;不声明报告质量达标。
|
||||
|
||||
**已验证能力**:
|
||||
- Codex adapter 可部署到 `$CODEX_HOME`,默认不复制 `config.toml`,避免覆盖用户全局配置;`--include-config` 才安装 bundled profile。
|
||||
- `skills/deep-research`、`skills/document-ingest`、`skills/search-gateway` 已纳入 registry 并可同步到 adapter。
|
||||
- `scripts/lib/zenmux_client.py` 支持 adapter model id 规范化,并对 Opus 4.7 自动省略已废弃的 `temperature` 参数。
|
||||
- Phase0 可导入 PDF;扫描/弱文本 PDF 可走 FireRed OCR;当前白帆案例已生成 `phase0/extracted`。
|
||||
- Phase2 可生成 90 个 task cards / packets / chapter briefs;packet validation、source rebuild、stale error 识别均已可执行。
|
||||
- Phase3 deterministic review 已能把 citation 通过但 evidence 落纸不足的 draft 标为 P1 回炉。
|
||||
|
||||
**白帆案例暴露的问题**:
|
||||
- Phase0/1 原先没有先读材料形成访谈问题,就直接生成框架并推进 Phase2,用户体验和研究方向控制不足。
|
||||
- subagent 在 Codex 中可能绕开项目 Python search gateway,触发 Tavily MCP 权限确认;应禁止平台 MCP 作为默认搜索路径。
|
||||
- evidence packet 到 chapter draft 存在信息损耗:引用密度不低,但具体审计发现、法规条款、整改动作和待补证据没有充分落到纸面。
|
||||
- 单纯 `validate_packet` / citation whitelist 不足以判断报告质量;需要 evidence utilization、groundedness、specificity、actionability 等更高层质量门槛。
|
||||
|
||||
- 2026-05-06 v0.21 规划:**Research Brief + Enrichment + Compression + Evaluation**
|
||||
|
||||
**设计来源**:借鉴 `langchain-ai/open_deep_research` 的 clarification gate、research brief、bounded supervisor/researcher 并发、compression step 和 evaluator rubrics,但保留本项目 file-backed Python core、法规证据矩阵、PDF/DOCX 输出和项目内 search gateway。
|
||||
|
||||
**Phase0/1 改造**:
|
||||
- `init` 后必须生成 `phase1/material_brief.md`:材料清单、初步问题聚类、关键访谈问题、材料使用边界。
|
||||
- 新增 `phase1/research_brief.md/json`:把用户访谈、材料简报、研究方法、报告用途、范围排除项、基调和成功标准固化为 Phase2 的唯一输入。
|
||||
- `research` 默认要求 `phase1.approved=true`;用户确认后运行 `dr.py approve <slug>`,否则只能显式 `--force`。
|
||||
- clarification 不只问范围,还要输出 task 切分原则:哪些问题适合并发,哪些必须串行,弱模型需要哪些 prompt/skill/context。
|
||||
|
||||
**Phase2 改造**:
|
||||
- task card 从 `research_brief` 生成,而不是只从章节标题生成;每张卡必须包含:研究目标、调研方式、推荐 search route、必读 skills、可用材料、期望 evidence schema、停止条件。
|
||||
- 新增 `phase2/enrichment_rounds/roundXX/coverage_gap.json`:每轮先评估覆盖缺口,再生成补充 task cards;避免一次性 packet 后直接写章。
|
||||
- 新增 `phase2/compressed_findings/chXX.json`:对 packets 进行压缩,但要求保留全部关键事实、原始来源、反方证据、证据落点和待补证据。
|
||||
- `search-gateway` 成为信息收集 subagent 必读 skill:默认调用 `scripts/search.py` / `SearchClient`,不得直接用 Tavily MCP、browser MCP 或平台 web search。
|
||||
|
||||
**Phase3/4 改造**:
|
||||
- chapter draft 必须从 `compressed_findings` 写,而不是直接从 packet 拼接;每章必须包含“证据落点与待补证据”表。
|
||||
- Phase3 增加 evaluator rubrics:groundedness、completeness、relevance、structure、source quality、evidence utilization、specificity、actionability、writing quality。
|
||||
- 任一核心维度低于阈值时禁止 finalize,自动生成回炉建议和补充 task cards。
|
||||
- Final assembly 只允许使用通过 Phase3 的章节和 sources,避免把 Alpha 草稿误渲染为正式 PDF/DOCX。
|
||||
|
||||
**测试计划**:
|
||||
- fixture 项目必须覆盖:material brief -> research brief -> task cards -> enrichment round -> compressed findings -> chapter draft -> Phase3 score gate。
|
||||
- 搜索测试必须验证 subagent prompt 中包含 `search-gateway`,且不会提及 Tavily MCP 作为默认路径。
|
||||
- 质量测试必须能让“泛泛咨询腔但有引用”的章节失败,让“具体审计发现+法规条款+整改动作+待补证据”的章节通过。
|
||||
|
||||
- 2026-05-06 v0.21-alpha implementation:**Research Brief 与压缩发现先行落地**
|
||||
|
||||
**已落地**:
|
||||
- `scripts/runtime/phase1.py` 新增 `phase1/research_brief.md` 与 `phase1/research_brief.json`,在 `frame` 阶段把材料简报、研究方法、工作语言、写作基调、成功标准、任务切分原则、每个任务轴的 prompt brief / search route / required skills / stop conditions 固化为文件。
|
||||
- `scripts/runtime/orchestrator.py` 生成 Phase2 task cards 时优先读取 `research_brief.json`,不再只依赖章节标题和 method axes。
|
||||
- `scripts/runtime/tasks.py` 扩展 `TaskCard` schema:`research_goal`、`research_method`、`prompt_brief`、`required_skills`、`allowed_materials`、`expected_evidence`、`stop_conditions`、`model_hint`;旧 task card 会自动补默认字段,保持 fixture 兼容。
|
||||
- `scripts/runtime/assembly.py` 新增 `build_compressed_findings()` 与 `validate_compressed_finding()`,`--build-briefs` 会同步写入 `phase2/compressed_findings/chXX.json`。
|
||||
- `--assemble-chapters` 改为从 `compressed_findings` 写中文章节,减少并发 packet 直接拼接造成的碎片化。
|
||||
- `AGENTS.md` 已同步更新 Phase1/2 真实产物、search-gateway 默认路径、Python core 验证锚点。
|
||||
|
||||
**仍未完成**:
|
||||
- `phase2/enrichment_rounds/roundXX/coverage_gap.json` 还未实现;下一步应先做 deterministic coverage evaluator,再让补充 task cards 从 gap 生成。
|
||||
- Phase3 evaluator rubrics 仍是计划项;当前 deterministic review 已能抓部分 draft 质量问题,但还没有分维度评分与 finalize gate。
|
||||
- DOCX/PPTX/图片批量 OCR、表格抽取、材料 source registry 仍放入后续资料导入增强。
|
||||
|
||||
- 2026-05-07 v0.20/v0.21-alpha search routing refinement:**Exa evidence discovery + Tavily Research 边界定锚**
|
||||
|
||||
**设计结论**:
|
||||
- Exa 更适合作为 Phase2 的受控 evidence discovery:优先返回 highlights/text,便于进入 source-quality、evidence-table 和 packet schema。
|
||||
- Tavily Research 更适合作为 Phase1 初扫、薄弱章节补证据、Phase3 回炉扫描;其综合报告不得直接替代 evidence packet 或章节正文。
|
||||
- Serper 继续承担 Scholar、Google Patents、News 与 Google-specific `site:` 检索;Brave 用于交叉验证和混合语种 fallback。
|
||||
|
||||
**已落地**:
|
||||
- `scripts/search.py` 新增 `--route evidence` 与 `--exa-category`,profile 路由加入 `evidence`。
|
||||
- `scripts/lib/search_client.py` 新增 `SearchClient.evidence()`,优先调用 Exa highlights/text,失败后降级 Tavily/Brave。
|
||||
- `scripts/runtime/tasks.py` 把 `evidence` 纳入合法 search route,并更新主要 task axes 的默认路由。
|
||||
- `scripts/runtime/workers.py` 的 `ProjectSearchProvider` 支持 `evidence` route。
|
||||
- `skills/search-gateway`、`skills/search-strategy`、`docs/search-playbook.md`、`README.md`、`AGENTS.md` 同步记录搜索分工,避免后续又回到 Tavily MCP 或中文长句搜索。
|
||||
|
||||
- 2026-05-07 v0.20.1 Antigravity native adapter:**用 Antigravity 模型配额执行研究**
|
||||
|
||||
**设计结论**:
|
||||
- Antigravity 官方机制以 `.agents/skills`、`.agents/rules`、Rules/Workflows、Task Groups 和 browser subagent 为核心;本项目在 Antigravity 中采用 skill-driven native research,而不是默认调用 Python core model workers。
|
||||
- `AGENTS.md` 继续作为跨平台总规则;Antigravity 专项约束放到 workspace rule 和 skill,避免引入非官方 SOUL.md 作为项目真源。
|
||||
- Opus 额度有限但大局观强,优先用于 Phase 0-1 和 Phase 4;Gemini 3 Flash 做流程管理,Gemini 3.1 Pro Low/High 分别用于 Phase 2/3。
|
||||
- `paperfoot/search-cli` 可作为 Antigravity 原生检索前台:多 provider、14 modes、JSON/exit code 友好;但不得替代本项目 source tier 与 source-quality 评分。
|
||||
|
||||
**已落地**:
|
||||
- 新增 `.agents/skills/antigravity-surface-adapter/SKILL.md`,定义 Antigravity native runbook、pause points、artifact 汇报、模型切换表和 `search-cli` 使用建议。
|
||||
- 新增 `.agents/rules/deep-research-antigravity.md`,要求 Antigravity 优先使用自身模型配额,Python core 只做脚手架、确定性校验、引用和出稿。
|
||||
- 撤回 `configs/models.yaml` 中 Antigravity 专用 ZenMux profile,避免误导主流程继续走 Python/ZenMux。
|
||||
- `docs/platform-adapters.md`、`README.md`、测试用例同步更新。
|
||||
|
||||
- 2026-05-07 v0.20.2 Antigravity/Gemini research integrity hardening:**反幻觉、反假搜索、workflow gates**
|
||||
|
||||
**设计结论**:
|
||||
- Gemini/Gemini CLI/Antigravity 在 deep research 中必须默认视为高幻觉风险模型;项目规则要把"诚实暴露不确定性"写成硬门槛,而不是依赖模型自觉。
|
||||
- `GEMINI.md` 适合放短而硬的项目级行为约束,并通过层级 context 与 imports 承接 `AGENTS.md`。
|
||||
- Antigravity `rules` 适合放 Always-On 约束;`workflows` 适合固化 Phase 0-4 执行顺序、人工暂停点和质量 gates。
|
||||
- Claude/Claude Code 最佳实践可借鉴:根指令要短、具体、可执行,长流程拆到 rules/skills/workflows,避免巨型上下文降低遵从性。
|
||||
|
||||
**已落地**:
|
||||
- 初版曾在 `AGENTS.md` 中加入 Antigravity native 例外、检索回执、source_id、search_log、unsupported_claims 等反幻觉硬规则;v0.20.3/v0.20.4 已将这些内容迁入 `.agents/rules`、`.agents/skills` 与 `.agents/workflows`。
|
||||
- `GEMINI.md` 重写为短约束:禁止假搜索、禁止无 source_id 事实、要求 search log,并区分 Gemini CLI 与 Antigravity native。
|
||||
- `.agents/rules/deep-research-antigravity.md` 加入 Anti-Hallucination Contract。
|
||||
- `.agents/skills/antigravity-surface-adapter/SKILL.md` 加入 phase artifacts、fact-audit、权限建议和检索日志要求。
|
||||
- 新增 `.agents/workflows/deep-research-native.md`,把四阶段 native research 写成可执行 workflow,并在每阶段设 gate。
|
||||
- `scripts/deploy_adapters.py antigravity` 同步部署 workflows;已有文件继续默认跳过,`--force` 才备份覆盖。
|
||||
|
||||
- 2026-05-07 v0.20.3 Antigravity rule/agent/skill separation:**按 Antigravity 最佳实践重新分层**
|
||||
|
||||
**设计结论**:
|
||||
- `AGENTS.md` / `GEMINI.md` 是跨工具/Antigravity 项目规则,不应承担角色定义、技能手册和详细流程。
|
||||
- `.agents/agents.md` 用于 Antigravity 角色团队定义;`.agents/rules` 放强约束;`.agents/skills` 放可复用技能;`.agents/workflows` 放 slash workflow 和阶段编排。
|
||||
- 继续保留反幻觉约束,但从 `AGENTS.md` 的长段落中移出,由 Antigravity rule/skill/workflow 承载,避免根规则膨胀影响遵从性。
|
||||
|
||||
**已落地**:
|
||||
- 新增 `.agents/agents.md`,定义 Research Manager、Phase 0-1 Strategist、Evidence Analyst、Chief Reviewer、Final Editor。
|
||||
- 瘦身 `AGENTS.md`,只保留跨平台研究底线与分层指引。
|
||||
- `antigravity-surface-adapter` skill 和 `deep-research-native` workflow 改为引用 `.agents/agents.md`。
|
||||
- `scripts/deploy_adapters.py antigravity` 同步部署 `.agents/agents.md`,默认跳过已有文件,`--force` 才备份覆盖。
|
||||
|
||||
- 2026-05-07 v0.20.4 AGENTS/GEMINI slimdown + method selection:**根规则瘦身,研究方法按场景选择**
|
||||
|
||||
**设计结论**:
|
||||
- 根 `AGENTS.md` 只保留跨工具底线、命令入口、安全边界和分层索引;Phase 0-4 工作流、Antigravity 角色、长规则和技能细则全部迁出。
|
||||
- `GEMINI.md` 只做 Gemini/Antigravity 高优先级覆盖,强调上下文加载和反假搜索。
|
||||
- 麦肯锡/MECE/SCQA 只是候选表达和咨询工具,不再作为默认研究方法;不同研究场景必须选择匹配的分析框架。
|
||||
|
||||
**已落地**:
|
||||
- 重写 `AGENTS.md`,缩短为跨工具规则和索引。
|
||||
- 重写 `GEMINI.md`,保留 Gemini 反幻觉、平台边界和 context 加载指引。
|
||||
- 新增 `.agents/skills/method-selection/SKILL.md`,覆盖市场/投资、临床、CMC/GMP、R&D、管理、政策等方法路由。
|
||||
- 参考 `199-biotechnologies/claude-deep-research-skill` 的证据持久化、claim-level verification、delta retrieve、continuation state 和 final assembly gate 设计,新增 `.agents/skills/research-quality-gates/SKILL.md`。
|
||||
- 强化 `source-quality` 与 `evidence-table`:要求 search receipt、原文访问状态、独立性 cluster、`claims_ledger.jsonl`、`coverage_matrix.md` 和不可证实 claim 显式落盘。
|
||||
- 重写 `.agents/agents.md`,只保留角色定义和 required skills。
|
||||
- 重写 `.agents/workflows/deep-research-native.md`,把方法选择设为独立 gate,加入 claim ledger、delta retrieve、coverage audit 和 continuation state gate。
|
||||
- 文档与测试同步更新。
|
||||
|
||||
- 2026-05-07 v0.20.5 Antigravity clean workspace:**修正 Antigravity 加载目录与上下文污染**
|
||||
|
||||
**问题复盘**:
|
||||
- Antigravity 实测会被完整仓库里的 `.codex`、`.opencode`、`.claude`、`.gemini` 和旧 `.agents` 提示污染,进而引用过期的 dr-pm/英文 Phase 2/并行管线等约束。
|
||||
- Antigravity 当前 workspace 规则/技能/工作流应使用 `.agent/` 单数目录;`.agents/` 复数目录不应作为 native 加载入口。
|
||||
|
||||
**已落地**:
|
||||
- 新增 `.agent/agents.md`、`.agent/rules`、`.agent/skills`、`.agent/workflows` 作为 Antigravity 唯一 native 入口。
|
||||
- `AGENTS.md`、`GEMINI.md`、Antigravity rule/skill/workflow 明确要求忽略 `.codex`、`.opencode`、`.claude`、`.gemini` 和 legacy `.agents`。
|
||||
- `scripts/deploy_adapters.py antigravity` 改为部署到 `.agent/`。
|
||||
- `scripts/runtime/skills.py` canonical skill registry 改为 `.agent/skills`,保留 legacy `.agents/skills` fallback。
|
||||
- 新增 `docs/antigravity-clean-workspace.md` 和 `scripts/export_antigravity_workspace.py`,支持 sparse checkout 或从完整仓库导出 clean workspace。
|
||||
- `.gitignore` 新增 legacy/generated platform adapter 目录,后续不再把这些目录作为 Antigravity workspace 内容。
|
||||
|
||||
- 2026-05-07 v0.20.6 Platform env rebuild:**平台配置源与运行环境解耦**
|
||||
|
||||
**设计结论**:
|
||||
- 不再把 `.agent`、`.codex`、`.opencode`、`.claude`、`.gemini` 这类隐藏运行目录作为主仓库根目录的一等入口。
|
||||
- Git 跟踪非隐藏源模板 `platform_adapters/<platform>/`;本地运行环境统一由脚本重建到 ignored `platform_envs/<platform>/`。
|
||||
- Antigravity 的正确打开方式是 `platform_envs/antigravity`,而不是完整多平台仓库根目录。
|
||||
- 将来若需要彻底隔离,也可以在 Gitea 上为 `codex/*`、`antigravity/*`、`opencode/*` 等分支分别维护平台专用视图。
|
||||
|
||||
**已落地**:
|
||||
- 新增 `platform_adapters/antigravity/agent`、`platform_adapters/codex`、`platform_adapters/opencode`、`platform_adapters/claude-code`、`platform_adapters/gemini-cli`。
|
||||
- 新增 `scripts/update_platform_envs.py`:可先 `git pull --ff-only`,再重建 `platform_envs/antigravity|codex|opencode|claude-code|gemini-cli`。
|
||||
- `scripts/deploy_adapters.py`、`scripts/export_antigravity_workspace.py`、`scripts/runtime/skills.py` 改为读取 `platform_adapters` 源模板。
|
||||
- README、GEMINI、AGENTS、platform docs 改为说明 source template + generated env 的导入逻辑。
|
||||
@@ -0,0 +1,80 @@
|
||||
profiles:
|
||||
premium:
|
||||
description: "Highest quality for formal deliverables."
|
||||
roles:
|
||||
dr_plan: "zenmux-anthropic/claude-opus-4-7"
|
||||
dr_pm: "zenmux-anthropic/claude-sonnet-4-6"
|
||||
dr_analyst: "zenmux-anthropic/claude-sonnet-4-6"
|
||||
dr_chief_editor: "zenmux/google/gemini-3.1-pro-preview"
|
||||
dr_editor_in_chief: "zenmux-anthropic/claude-opus-4-7"
|
||||
dr_verifier: "zenmux/openai/gpt-5.4"
|
||||
translate: "anthropic/claude-sonnet-4.6"
|
||||
polish: "anthropic/claude-sonnet-4.6"
|
||||
glossary: "anthropic/claude-haiku-4.5"
|
||||
balanced:
|
||||
description: "Default profile for most reports."
|
||||
roles:
|
||||
dr_plan: "zenmux-anthropic/claude-opus-4-7"
|
||||
dr_pm: "zenmux-anthropic/claude-sonnet-4-6"
|
||||
dr_analyst: "zenmux-anthropic/claude-sonnet-4-6"
|
||||
dr_chief_editor: "zenmux/google/gemini-3.1-pro-preview"
|
||||
dr_editor_in_chief: "zenmux-anthropic/claude-opus-4-7"
|
||||
dr_verifier: "zenmux/qwen/qwen3.6-plus"
|
||||
translate: "anthropic/claude-sonnet-4.6"
|
||||
polish: "anthropic/claude-sonnet-4.6"
|
||||
glossary: "anthropic/claude-haiku-4.5"
|
||||
budget:
|
||||
description: "Lower-cost exploratory profile; requires stronger review."
|
||||
roles:
|
||||
dr_plan: "zenmux/qwen/qwen3.6-plus"
|
||||
dr_pm: "zenmux/qwen/qwen3.6-plus"
|
||||
dr_analyst: "zenmux/deepseek/deepseek-v3.2"
|
||||
dr_chief_editor: "zenmux/google/gemini-2.5-pro"
|
||||
dr_editor_in_chief: "zenmux-anthropic/claude-sonnet-4-6"
|
||||
dr_verifier: "zenmux/minimax/minimax-m2.7"
|
||||
translate: "anthropic/claude-haiku-4.5"
|
||||
polish: "anthropic/claude-haiku-4.5"
|
||||
glossary: "anthropic/claude-haiku-4.5"
|
||||
cn_heavy:
|
||||
description: "China-market-heavy research with more Chinese-source verification."
|
||||
roles:
|
||||
dr_plan: "zenmux-anthropic/claude-opus-4-7"
|
||||
dr_pm: "zenmux-anthropic/claude-sonnet-4-6"
|
||||
dr_analyst: "zenmux-anthropic/claude-sonnet-4-6"
|
||||
dr_chief_editor: "zenmux/google/gemini-3.1-pro-preview"
|
||||
dr_editor_in_chief: "zenmux-anthropic/claude-opus-4-7"
|
||||
dr_verifier: "zenmux/qwen/qwen3.6-plus"
|
||||
translate: "anthropic/claude-sonnet-4.6"
|
||||
polish: "anthropic/claude-sonnet-4.6"
|
||||
glossary: "anthropic/claude-haiku-4.5"
|
||||
verifier:
|
||||
description: "Cross-model verification profile; avoid Claude for verifier."
|
||||
roles:
|
||||
dr_verifier_primary: "zenmux/openai/gpt-5.4"
|
||||
dr_verifier_backup_a: "zenmux/qwen/qwen3.6-plus"
|
||||
dr_verifier_backup_b: "zenmux/minimax/minimax-m2.7"
|
||||
dr_verifier_backup_c: "zenmux/moonshotai/kimi-k2.5"
|
||||
codex_native:
|
||||
description: "OpenAI-native profile for the Codex adapter; independent of OpenCode and ZenMux."
|
||||
roles:
|
||||
dr_plan: "gpt-5.4"
|
||||
dr_pm: "gpt-5.4"
|
||||
dr_searcher: "gpt-5.4-mini"
|
||||
dr_analyst: "gpt-5.4"
|
||||
dr_verifier: "gpt-5.4"
|
||||
dr_chief_editor: "gpt-5.4"
|
||||
dr_editor_in_chief: "gpt-5.4"
|
||||
dr_reporter: "gpt-5.4-mini"
|
||||
translate: "anthropic/claude-sonnet-4.6"
|
||||
polish: "anthropic/claude-sonnet-4.6"
|
||||
glossary: "anthropic/claude-haiku-4.5"
|
||||
reasoning:
|
||||
default: "high"
|
||||
fast: "medium"
|
||||
review: "xhigh"
|
||||
|
||||
defaults:
|
||||
profile: "balanced"
|
||||
translate_workers: 4
|
||||
polish_workers: 4
|
||||
glossary_workers: 4
|
||||
@@ -0,0 +1,93 @@
|
||||
version: 1
|
||||
|
||||
defaults:
|
||||
profile: medium
|
||||
task_types:
|
||||
source_discovery: dr_searcher
|
||||
evidence_packet: dr_analyst
|
||||
chapter_assembly: dr_analyst
|
||||
counter_verification: dr_verifier
|
||||
phase3_review: dr_chief_editor
|
||||
final_editorial: dr_editor_in_chief
|
||||
report_render: dr_reporter
|
||||
script_models:
|
||||
# Legacy compatibility only. v0.20 defaults to Chinese-native finalization.
|
||||
translate: anthropic/claude-sonnet-4.6
|
||||
glossary: anthropic/claude-haiku-4.5
|
||||
polish: anthropic/claude-sonnet-4.6
|
||||
|
||||
profiles:
|
||||
simple:
|
||||
description: Lower cost exploration profile for quick scoping.
|
||||
roles:
|
||||
dr_plan: zenmux/qwen/qwen3.6-plus
|
||||
dr_pm: zenmux/qwen/qwen3.6-plus
|
||||
dr_searcher: zenmux-anthropic/claude-haiku-4-5
|
||||
dr_analyst: zenmux/deepseek/deepseek-v3.2
|
||||
dr_verifier: zenmux/minimax/minimax-m2.7
|
||||
dr_chief_editor: zenmux/google/gemini-2.5-pro
|
||||
dr_editor_in_chief: zenmux-anthropic/claude-sonnet-4-6
|
||||
dr_reporter: zenmux-anthropic/claude-sonnet-4-6
|
||||
translate: anthropic/claude-haiku-4.5
|
||||
glossary: anthropic/claude-haiku-4.5
|
||||
polish: anthropic/claude-haiku-4.5
|
||||
|
||||
medium:
|
||||
description: Recommended default profile for most production runs.
|
||||
roles:
|
||||
dr_plan: zenmux-anthropic/claude-opus-4-7
|
||||
dr_pm: zenmux-anthropic/claude-sonnet-4-6
|
||||
dr_searcher: zenmux-anthropic/claude-haiku-4-5
|
||||
dr_analyst: zenmux-anthropic/claude-sonnet-4-6
|
||||
dr_verifier: zenmux/openai/gpt-5.4-mini
|
||||
dr_chief_editor: zenmux/google/gemini-3.1-pro-preview
|
||||
dr_editor_in_chief: zenmux-anthropic/claude-opus-4-7
|
||||
dr_reporter: zenmux-anthropic/claude-sonnet-4-6
|
||||
translate: anthropic/claude-sonnet-4.6
|
||||
glossary: anthropic/claude-haiku-4.5
|
||||
polish: anthropic/claude-sonnet-4.6
|
||||
|
||||
premium:
|
||||
description: Highest quality profile for formal client-facing deliverables.
|
||||
roles:
|
||||
dr_plan: zenmux-anthropic/claude-opus-4-7
|
||||
dr_pm: zenmux-anthropic/claude-sonnet-4-6
|
||||
dr_searcher: zenmux-anthropic/claude-haiku-4-5
|
||||
dr_analyst: zenmux-anthropic/claude-sonnet-4-6
|
||||
dr_verifier: zenmux/openai/gpt-5.4
|
||||
dr_chief_editor: zenmux/google/gemini-3.1-pro-preview
|
||||
dr_editor_in_chief: zenmux-anthropic/claude-opus-4-7
|
||||
dr_reporter: zenmux-anthropic/claude-sonnet-4-6
|
||||
translate: anthropic/claude-sonnet-4.6
|
||||
glossary: anthropic/claude-haiku-4.5
|
||||
polish: anthropic/claude-sonnet-4.6
|
||||
|
||||
cn_heavy:
|
||||
description: China-market-heavy profile with stronger CN-side verification.
|
||||
roles:
|
||||
dr_plan: zenmux-anthropic/claude-opus-4-7
|
||||
dr_pm: zenmux-anthropic/claude-sonnet-4-6
|
||||
dr_searcher: zenmux-anthropic/claude-haiku-4-5
|
||||
dr_analyst: zenmux-anthropic/claude-sonnet-4-6
|
||||
dr_verifier: zenmux/qwen/qwen3.6-plus
|
||||
dr_chief_editor: zenmux/google/gemini-3.1-pro-preview
|
||||
dr_editor_in_chief: zenmux-anthropic/claude-opus-4-7
|
||||
dr_reporter: zenmux-anthropic/claude-sonnet-4-6
|
||||
translate: anthropic/claude-sonnet-4.6
|
||||
glossary: anthropic/claude-haiku-4.5
|
||||
polish: anthropic/claude-sonnet-4.6
|
||||
|
||||
codex_native:
|
||||
description: Deprecated/misleading name. These are OpenAI models through the external Python API client, not Codex App built-in models.
|
||||
roles:
|
||||
dr_plan: gpt-5.4
|
||||
dr_pm: gpt-5.4
|
||||
dr_searcher: gpt-5.4-mini
|
||||
dr_analyst: gpt-5.4
|
||||
dr_verifier: gpt-5.4
|
||||
dr_chief_editor: gpt-5.4
|
||||
dr_editor_in_chief: gpt-5.4
|
||||
dr_reporter: gpt-5.4-mini
|
||||
translate: anthropic/claude-sonnet-4.6
|
||||
glossary: anthropic/claude-haiku-4.5
|
||||
polish: anthropic/claude-sonnet-4.6
|
||||
@@ -0,0 +1,148 @@
|
||||
version: 1
|
||||
defaults:
|
||||
method: mckinsey_market
|
||||
|
||||
methods:
|
||||
mckinsey_market:
|
||||
name: McKinsey-style market and strategy research
|
||||
best_for:
|
||||
- market research
|
||||
- investment memo
|
||||
- competitive landscape
|
||||
structure_principle: Pyramid principle with MECE chapter coverage.
|
||||
task_axes:
|
||||
- literature
|
||||
- regulatory
|
||||
- patents
|
||||
- market
|
||||
- counter
|
||||
integrated_lanes:
|
||||
- literature evidence
|
||||
- regulatory pathway
|
||||
- patent/IP position
|
||||
- market and competitor evidence
|
||||
- counter-evidence and uncertainty
|
||||
framework_sections:
|
||||
- central_thesis
|
||||
- chapter_outline
|
||||
- alternative_frameworks
|
||||
- risks_and_dependencies
|
||||
|
||||
gmp_gap_assessment:
|
||||
name: GMP consulting gap assessment and remediation
|
||||
best_for:
|
||||
- GMP audit remediation
|
||||
- quality system consulting
|
||||
- supplier audit CAPA
|
||||
structure_principle: Regulation-to-gap-to-risk-to-CAPA pathway.
|
||||
task_axes:
|
||||
- regulatory_gap
|
||||
- risk_classification
|
||||
- capa_design
|
||||
- ownership_timeline
|
||||
- verification_evidence
|
||||
- counter
|
||||
framework_sections:
|
||||
- regulatory_baseline
|
||||
- gap_matrix
|
||||
- risk_ranking
|
||||
- capa_roadmap
|
||||
- verification_plan
|
||||
|
||||
cmc_process_risk:
|
||||
name: CMC process and scale-up risk assessment
|
||||
best_for:
|
||||
- process development
|
||||
- tech transfer
|
||||
- manufacturing readiness
|
||||
structure_principle: Process-flow, CQA/CPP, scale-up, control strategy.
|
||||
task_axes:
|
||||
- process_flow
|
||||
- cqa_cpp
|
||||
- scale_up_risk
|
||||
- control_strategy
|
||||
- supply_chain
|
||||
- counter
|
||||
framework_sections:
|
||||
- process_map
|
||||
- critical_quality_attributes
|
||||
- critical_process_parameters
|
||||
- scale_up_risks
|
||||
- control_strategy
|
||||
|
||||
rd_go_no_go:
|
||||
name: R&D go/no-go decision research
|
||||
best_for:
|
||||
- project initiation
|
||||
- modality selection
|
||||
- development strategy
|
||||
structure_principle: Scientific rationale, proof-of-concept, IP/FTO, development path, go/no-go criteria.
|
||||
task_axes:
|
||||
- scientific_rationale
|
||||
- poc_evidence
|
||||
- ip_fto
|
||||
- development_path
|
||||
- commercial_window
|
||||
- counter
|
||||
framework_sections:
|
||||
- scientific_rationale
|
||||
- evidence_threshold
|
||||
- ip_fto
|
||||
- development_plan
|
||||
- go_no_go_criteria
|
||||
|
||||
management_consulting:
|
||||
name: Management consulting diagnostic and operating model
|
||||
best_for:
|
||||
- organization diagnosis
|
||||
- operating model design
|
||||
- governance and process improvement
|
||||
structure_principle: Diagnostic baseline, capability gaps, operating model, roadmap, governance.
|
||||
task_axes:
|
||||
- current_state
|
||||
- capability_gap
|
||||
- operating_model
|
||||
- governance
|
||||
- implementation_roadmap
|
||||
- counter
|
||||
framework_sections:
|
||||
- current_state_diagnosis
|
||||
- capability_gap
|
||||
- future_state_model
|
||||
- roadmap
|
||||
- governance_metrics
|
||||
|
||||
gmp_quality_operations_diagnosis:
|
||||
name: GMP quality, manufacturing process, and operations diagnosis
|
||||
best_for:
|
||||
- GMP audit remediation from client materials
|
||||
- quality system diagnosis
|
||||
- manufacturing process system diagnosis
|
||||
- operations management transformation
|
||||
structure_principle: Start from site audit evidence, map findings to regulatory baseline and operating model gaps, then design short/mid/long-term remediation.
|
||||
task_axes:
|
||||
- input_material_findings
|
||||
- nmpa_fda_ema_ich_who_baseline
|
||||
- quality_system_gap
|
||||
- manufacturing_process_risk
|
||||
- operations_management_gap
|
||||
- team_capability
|
||||
- capa_roadmap
|
||||
- verification_evidence
|
||||
- counter
|
||||
integrated_lanes:
|
||||
- site audit and recap findings
|
||||
- official regulatory and guideline baseline
|
||||
- enforcement precedents and warning letters
|
||||
- quality/manufacturing/operations gap analysis
|
||||
- remediation actions, ownership, verification evidence
|
||||
- counter-evidence and boundary conditions
|
||||
framework_sections:
|
||||
- material_evidence_map
|
||||
- regulatory_and_best_practice_baseline
|
||||
- quality_system_gap_matrix
|
||||
- manufacturing_process_risk_map
|
||||
- operations_management_diagnosis
|
||||
- people_and_capability_diagnosis
|
||||
- short_mid_long_term_roadmap
|
||||
- governance_and_verification_plan
|
||||
@@ -0,0 +1,64 @@
|
||||
profiles:
|
||||
biomed_literature:
|
||||
description: "Mechanism, clinical, systematic review, and biomedical evidence."
|
||||
order:
|
||||
- "pubmed_ncbi"
|
||||
- "clinicaltrials"
|
||||
- "fda_ema_nmpa"
|
||||
- "serper_scholar"
|
||||
- "exa_evidence_discovery"
|
||||
- "tavily_research_scan_if_needed"
|
||||
patent_heavy:
|
||||
description: "IP landscape, freedom-to-operate, and process-route research."
|
||||
order:
|
||||
- "google_patents_via_serper"
|
||||
- "uspto_epo_cnipa"
|
||||
- "company_disclosures"
|
||||
- "exa_family_discovery"
|
||||
- "tavily_gap_fill"
|
||||
china_market:
|
||||
description: "China regulatory, company, supply-chain, and market research."
|
||||
order:
|
||||
- "nmpa_cde"
|
||||
- "exchange_disclosures"
|
||||
- "serper_brave_chinese"
|
||||
- "exa_company_pages"
|
||||
- "exa_evidence_discovery"
|
||||
- "tavily_gap_fill"
|
||||
investment:
|
||||
description: "Public-company, market-size, and transaction-oriented research."
|
||||
order:
|
||||
- "sec_exchange_filings"
|
||||
- "consulting_and_database_reports"
|
||||
- "company_announcements"
|
||||
- "serper_news"
|
||||
- "exa_evidence_discovery"
|
||||
- "tavily_gap_fill"
|
||||
|
||||
apis:
|
||||
tavily:
|
||||
best_for: ["phase1_research_scan", "phase3_gap_fill", "llm_friendly_snippets"]
|
||||
evidence_role: "discovery_only_unless_original_source"
|
||||
exa:
|
||||
best_for: ["evidence_discovery", "company_pages", "terminology_check", "long_tail_professional_pages", "agent_highlights"]
|
||||
evidence_role: "candidate_source_until_scored"
|
||||
brave:
|
||||
best_for: ["cross_check", "counter_evidence", "mixed_language_search"]
|
||||
evidence_role: "discovery_only_unless_original_source"
|
||||
serper:
|
||||
best_for: ["google_scholar", "google_patents", "news"]
|
||||
evidence_role: "discovery_or_secondary"
|
||||
pubmed_ncbi:
|
||||
best_for: ["tier1_literature", "systematic_reviews", "meta_analysis"]
|
||||
evidence_role: "tier1_or_tier2"
|
||||
clinicaltrials:
|
||||
best_for: ["trial_registration", "pipeline_status", "endpoint_design"]
|
||||
evidence_role: "tier1"
|
||||
regulatory:
|
||||
best_for: ["approval_status", "label", "safety", "review_documents"]
|
||||
evidence_role: "tier1"
|
||||
|
||||
defaults:
|
||||
glossary_workers: 4
|
||||
unstable_network_workers: 3
|
||||
trace_back_to_tier_1_2: true
|
||||
@@ -0,0 +1,105 @@
|
||||
# Antigravity Clean Workspace
|
||||
|
||||
Use a clean workspace for Antigravity. Do not open the full multi-platform repository unless you are debugging adapters.
|
||||
|
||||
The full repository contains Codex, OpenCode, Claude Code, Gemini CLI, archived projects, and platform adapter source templates. Gemini models may read irrelevant files and follow stale or incompatible instructions. The clean workspace exposes only the Antigravity instruction stack plus optional Python utilities.
|
||||
|
||||
## Recommended Update Flow
|
||||
|
||||
From the full repository:
|
||||
|
||||
```bash
|
||||
python scripts/update_platform_envs.py --platform antigravity
|
||||
```
|
||||
|
||||
This command first runs `git pull --ff-only`, then rebuilds `platform_envs/antigravity`. Open `platform_envs/antigravity` in Antigravity.
|
||||
|
||||
If you already pulled the repo yourself:
|
||||
|
||||
```bash
|
||||
python scripts/update_platform_envs.py --platform antigravity --skip-pull
|
||||
```
|
||||
|
||||
## Required Directory Logic
|
||||
|
||||
Antigravity source templates live in `platform_adapters/antigravity/agent/`. The generated Antigravity workspace receives them under `.agent/`:
|
||||
|
||||
- `.agent/agents.md` defines roles only.
|
||||
- `.agent/rules/*.md` defines persistent workspace constraints.
|
||||
- `.agent/skills/*/SKILL.md` defines reusable procedures.
|
||||
- `.agent/workflows/*.md` defines slash-style workflows.
|
||||
|
||||
Other platforms are built into their own generated environments under `platform_envs/`. They are not part of Antigravity native execution.
|
||||
|
||||
## Sparse Checkout From Gitea
|
||||
|
||||
Use this when preparing an Antigravity-only checkout:
|
||||
|
||||
```bash
|
||||
git clone --filter=blob:none --no-checkout http://192.168.50.45:3000/kai/deep_research.git deep_research_antigravity
|
||||
cd deep_research_antigravity
|
||||
git sparse-checkout init --no-cone
|
||||
git sparse-checkout set \
|
||||
AGENTS.md \
|
||||
GEMINI.md \
|
||||
README.md \
|
||||
docs/antigravity-clean-workspace.md \
|
||||
docs/platform-adapters.md \
|
||||
configs \
|
||||
platform_adapters/antigravity \
|
||||
scripts/dr.py \
|
||||
scripts/runtime \
|
||||
scripts/reporting \
|
||||
scripts/deploy_adapters.py \
|
||||
scripts/update_platform_envs.py \
|
||||
scripts/export_antigravity_workspace.py \
|
||||
projects/.gitkeep
|
||||
git checkout codex/v0.20-skill-driven-python-core
|
||||
python scripts/update_platform_envs.py --platform antigravity --skip-pull
|
||||
```
|
||||
|
||||
This checkout intentionally excludes Codex/OpenCode/Claude/Gemini adapter templates, `archive`, historical `projects/**`, and generated `platform_envs/**`.
|
||||
|
||||
## Export From A Full Checkout
|
||||
|
||||
If you already have a full checkout, export a clean Antigravity workspace:
|
||||
|
||||
```bash
|
||||
python scripts/export_antigravity_workspace.py --target /path/to/deep_research_antigravity --force
|
||||
```
|
||||
|
||||
Open `/path/to/deep_research_antigravity` in Antigravity, not the full repository.
|
||||
|
||||
## Startup Prompt
|
||||
|
||||
Paste this as the first message in Antigravity:
|
||||
|
||||
```text
|
||||
You are running Antigravity native Deep Research.
|
||||
|
||||
First, read only these files:
|
||||
1. AGENTS.md
|
||||
2. GEMINI.md
|
||||
3. .agent/agents.md
|
||||
4. .agent/rules/deep-research-antigravity.md
|
||||
5. .agent/skills/antigravity-surface-adapter/SKILL.md
|
||||
6. .agent/skills/method-selection/SKILL.md
|
||||
7. .agent/skills/research-quality-gates/SKILL.md
|
||||
8. .agent/workflows/deep-research-native.md
|
||||
|
||||
This is a generated clean workspace. Do not inspect parent repository adapter templates unless I explicitly ask.
|
||||
|
||||
Use Gemini 3 Flash only as Surface Manager. Do not write report content or invent completed searches. Ask me to switch models at the workflow gates.
|
||||
|
||||
Research topic: <topic>
|
||||
Slug: <slug>
|
||||
Report purpose: <purpose>
|
||||
Target reader: <reader>
|
||||
Decision supported by the report: <decision>
|
||||
|
||||
Start with Step 1 of .agent/workflows/deep-research-native.md. Stop after Phase 1 artifacts are created and ask for approval.
|
||||
```
|
||||
|
||||
## Failure Stop Rule
|
||||
|
||||
If the model claims it searched, cleared old files, wrote a chapter, ran a pipeline, or verified evidence without producing the corresponding artifact paths and receipts, stop the run. Restart with the startup prompt above and require it to show the loaded file list first.
|
||||
@@ -0,0 +1,189 @@
|
||||
# Codex Native Adapter
|
||||
|
||||
> v0.20 起,Codex 是 Deep Research 的表层 adapter。共享核心迁移到 Python runtime:`scripts/dr.py`、`scripts/runtime/**`、`configs/models.yaml` 和 `.agents/skills`。Codex 不再复制核心调度逻辑。
|
||||
|
||||
## Architecture
|
||||
|
||||
| Layer | Shared | OpenCode | Codex |
|
||||
|---|---:|---:|---:|
|
||||
| 方法论 | `AGENTS.md` | ✅ | ✅ |
|
||||
| Skills | `.agents/skills` | 继续保留 `.opencode/skills` | ✅ |
|
||||
| Agent 定义 | Python role runtime 为准 | `.opencode/agents/*.md` 仅兼容 | `$CODEX_HOME/agents/*.toml` 仅兼容 |
|
||||
| 命令入口 | `scripts/dr.py` | `.opencode/commands/*.md` wrapper | `$CODEX_HOME/commands/*.md` wrapper |
|
||||
| Phase 4 确定性流水线 | `scripts/*.py` | ✅ | ✅ |
|
||||
|
||||
Codex 官方行为要点:
|
||||
|
||||
- 用户级配置放在 `~/.codex/config.toml` 或 `$CODEX_HOME/config.toml`;项目级 `.codex/**` 不是 v0.20 推荐路径。
|
||||
- Codex 会从项目根向当前目录读取 `AGENTS.md`。
|
||||
- repo skills 放在 `.agents/skills/*/SKILL.md`。
|
||||
- adapter templates 保存在 `codex_adapter_templates/codex/**`,部署脚本会复制到 `$CODEX_HOME`。
|
||||
- subagents/agent threads 是 Codex 表层增强能力;v0.20 默认研究并发由 Python worker pool 执行。
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
cd /Users/tankai/Documents/Projects/deep_research
|
||||
source scripts/activate.sh
|
||||
```
|
||||
|
||||
首次使用 Codex adapter 前确认:
|
||||
|
||||
```bash
|
||||
uv run python scripts/deploy_adapters.py codex --dry-run
|
||||
uv run python scripts/deploy_adapters.py codex --force
|
||||
find .agents/skills -maxdepth 2 -name SKILL.md | sort
|
||||
uv run python scripts/dr.py status <slug>
|
||||
```
|
||||
|
||||
默认部署不会写入 `config.toml`,避免覆盖现有 Codex 全局配置。只有确认要安装本项目 bundled profile 时,才运行 `uv run python scripts/deploy_adapters.py codex --force --include-config`。
|
||||
|
||||
新机器部署后可以先跑自检:
|
||||
|
||||
```bash
|
||||
uv run python scripts/deploy_check.py
|
||||
```
|
||||
|
||||
如果 `$CODEX_HOME` adapter 缺失或 skills 没同步:
|
||||
|
||||
```bash
|
||||
uv run python scripts/deploy_check.py --repair --force
|
||||
```
|
||||
|
||||
默认自动化权限:
|
||||
|
||||
- `sandbox_mode = "workspace-write"`:允许写入当前研究 workspace。
|
||||
- `approval_policy = "never"`:命令执行不逐次弹窗。
|
||||
- `web_search = "live"`:默认使用实时网络检索。
|
||||
- `[sandbox_workspace_write].network_access = true`:脚本和 MCP server 默认可访问网络。
|
||||
- Tavily / Brave / Exa MCP 默认启用,且 `required = false`,某个搜索服务临时不可用时不阻塞 Codex 主流程。
|
||||
|
||||
## Codex Commands
|
||||
|
||||
Codex custom command templates 的真源位于 `codex_adapter_templates/codex/commands/`,部署后位于 `$CODEX_HOME/commands/`。在 CLI 中也可以绕过平台命令,直接用 `scripts/dr.py prompt` 从模板展开:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py prompt dr-run dual-target-rnai-pipeline-2026
|
||||
codex exec "$(uv run python scripts/dr.py prompt dr-run dual-target-rnai-pipeline-2026)"
|
||||
```
|
||||
|
||||
推荐入口是 Python core。Codex command 只包装 CLI,不再让 Codex 主线程主动调度 subagents。
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py run <slug-or-topic>
|
||||
uv run python scripts/dr.py research <slug> --workers 6
|
||||
uv run python scripts/dr.py finalize <slug>
|
||||
```
|
||||
|
||||
分阶段命令保留为调试和人工接管入口:
|
||||
|
||||
```bash
|
||||
codex exec "$(uv run python scripts/dr.py prompt dr-init '<topic>')"
|
||||
codex exec "$(uv run python scripts/dr.py prompt dr-frame <slug>)"
|
||||
codex exec "$(uv run python scripts/dr.py prompt dr-research <slug>)"
|
||||
codex exec "$(uv run python scripts/dr.py prompt dr-review <slug>)"
|
||||
uv run python scripts/dr.py finalize <slug>
|
||||
```
|
||||
|
||||
Phase 4 默认中文原生成稿:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --model-profile medium
|
||||
```
|
||||
|
||||
旧英译中 pipeline 仅用于兼容旧项目:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --legacy-translate
|
||||
```
|
||||
|
||||
网络不稳时可显式降并发:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> \
|
||||
--model-profile medium \
|
||||
--translate-workers 1 \
|
||||
--glossary-workers 3 \
|
||||
--polish-workers 1
|
||||
```
|
||||
|
||||
术语核查策略可选:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --model-profile medium --glossary-mode low-confidence
|
||||
uv run python scripts/dr.py finalize <slug> --model-profile medium --glossary-mode full
|
||||
uv run python scripts/dr.py finalize <slug> --model-profile medium --glossary-mode off
|
||||
```
|
||||
|
||||
## Adapter Boundary
|
||||
|
||||
Codex 可以继续用于审阅、解释和少量人工接管,但默认研究并发由 Python task-card runtime 控制。模型选择与 role/task 映射以 `configs/models.yaml` 为准。
|
||||
|
||||
## Git Hygiene
|
||||
|
||||
本仓库常有大量 `projects/**` 研究产物处于修改状态。Codex adapter 提交时只 stage 系统文件:
|
||||
|
||||
```bash
|
||||
git add codex_adapter_templates .agents/skills scripts docs configs README.md PLAN.md AGENTS.md
|
||||
git diff --staged --name-only
|
||||
```
|
||||
|
||||
提交前确认 staged 列表不包含:
|
||||
|
||||
- `projects/**`
|
||||
- 已生成 PDF/DOCX/TXT
|
||||
- 临时检查脚本或一次性研究产物
|
||||
|
||||
## Deploying Adapter Files
|
||||
|
||||
不要在仓库内维护 `.codex/**`。如果需要 Codex native adapter,请把模板部署到用户级 Codex home:
|
||||
|
||||
```bash
|
||||
uv run python scripts/deploy_adapters.py codex --force
|
||||
```
|
||||
|
||||
兼容旧命令仍可用,但默认也会走外部部署:
|
||||
|
||||
```bash
|
||||
uv run python scripts/install_codex_adapter.py --force
|
||||
```
|
||||
|
||||
部署来源:
|
||||
|
||||
- `codex_adapter_templates/codex/**` → `$CODEX_HOME/**` 或 `~/.codex/**`
|
||||
- `.agents/skills/**` → `$CODEX_HOME/skills/**`
|
||||
|
||||
如果旧版本已经把仓库内 `.codex/**` 加进 Git,需要在本机清一次索引,让它回到“本地部署产物”身份:
|
||||
|
||||
```bash
|
||||
git rm -r --cached .codex
|
||||
```
|
||||
|
||||
部署后,在 Codex 中运行 `/debug-config`,确认 user config 或 `CODEX_HOME` config 已加载。
|
||||
|
||||
## Config Troubleshooting
|
||||
|
||||
如果 Codex adapter 配置生效后启动报错,先按下面顺序排查:
|
||||
|
||||
1. 确认部署目标正确:默认是 `$CODEX_HOME`,未设置时是 `~/.codex`。
|
||||
2. Tavily / Brave / Exa MCP 默认启用但不是 required。若某个 server 启动异常,先确认对应环境变量存在,再临时把该 server 改成 `enabled = false`。
|
||||
3. 如果要完全离线排障,先把第三方 MCP 全部关掉,只保留 OpenAI Docs MCP 和内置 web search。
|
||||
4. 如果仍然报错,临时保留最小配置确认 Codex 主体能启动:
|
||||
|
||||
```toml
|
||||
model = "gpt-5.4"
|
||||
model_reasoning_effort = "high"
|
||||
sandbox_mode = "workspace-write"
|
||||
approval_policy = "never"
|
||||
project_doc_max_bytes = 65536
|
||||
web_search = "live"
|
||||
|
||||
[agents]
|
||||
max_threads = 6
|
||||
max_depth = 1
|
||||
|
||||
[sandbox_workspace_write]
|
||||
network_access = true
|
||||
```
|
||||
|
||||
这个最小配置只启用模型、沙盒、项目说明、web search 与 subagent 上限;确认能启动后,再逐个恢复 profiles 和 MCP server。
|
||||
@@ -0,0 +1,80 @@
|
||||
# Model Playbook
|
||||
|
||||
> v0.12 起,本文件作为模型选择攻略本。`.opencode/opencode.json` 仍是 OpenCode 的模型白名单,`configs/models.yaml` 是跨平台策略参考。
|
||||
|
||||
## Profiles
|
||||
|
||||
### premium
|
||||
|
||||
用于高价值、长上下文、强叙事任务。成本最高,但最稳。
|
||||
|
||||
- dr-plan:Claude Opus 4.7(cache)
|
||||
- dr-editor-in-chief:Claude Opus 4.7(cache)
|
||||
- dr-pm / dr-analyst:Claude Sonnet 4.6(cache)
|
||||
- dr-chief-editor:Gemini 3.1 Pro Preview
|
||||
- dr-verifier:GPT-5.4
|
||||
- translate / polish:Claude Sonnet 4.6
|
||||
|
||||
适用:投资报告、管理层决策报告、需要交付 PDF/DOCX 的正式项目。
|
||||
|
||||
### balanced
|
||||
|
||||
默认推荐。保留关键环节的强模型,把机械任务交给更便宜模型。
|
||||
|
||||
- dr-plan:Claude Opus 4.7(cache)
|
||||
- dr-editor-in-chief:Claude Opus 4.7(cache)
|
||||
- dr-pm / dr-analyst:Claude Sonnet 4.6(cache)
|
||||
- dr-searcher:Claude Haiku 4.5
|
||||
- dr-verifier:Qwen3.6 Plus 或 GPT-5.4
|
||||
- translate / polish:Claude Sonnet 4.6,`--workers 4`
|
||||
|
||||
适用:大多数 10,000-35,000 中文字报告。
|
||||
|
||||
### budget
|
||||
|
||||
用于探索性研究或内部草稿。牺牲部分风格和深度,换取成本控制。
|
||||
|
||||
- dr-plan:Claude Sonnet 4.6 或 Qwen3.6 Plus
|
||||
- dr-editor-in-chief:Claude Sonnet 4.6
|
||||
- dr-analyst:Qwen3.6 Plus / DeepSeek V3.2
|
||||
- dr-verifier:MiniMax M2.7 / Kimi K2.5
|
||||
- translate / polish:Qwen3.6 Plus 或 Claude Haiku 4.5(需要人工抽检)
|
||||
|
||||
适用:快速扫盘、预研、内部初稿。不建议直接用于最终交付。
|
||||
|
||||
### cn-heavy
|
||||
|
||||
用于中国市场、NMPA、企业工商/中文媒体密集场景。
|
||||
|
||||
- dr-analyst:Claude Sonnet 4.6 + Qwen3.6 Plus 交叉
|
||||
- dr-verifier:Qwen3.6 Plus
|
||||
- dr-searcher:Haiku + Serper/Brave 中文关键词
|
||||
- translate / polish:Claude Sonnet 4.6
|
||||
|
||||
适用:中国药企、国产替代、供应链、政策环境、中文专有名词较多的研究。
|
||||
|
||||
### verifier
|
||||
|
||||
用于交叉模型验证,避免同模型同偏差。
|
||||
|
||||
- 首选:GPT-5.4
|
||||
- 备用:Qwen3.6 Plus
|
||||
- 低成本:MiniMax M2.7 / Kimi K2.5
|
||||
|
||||
规则:dr-verifier 不使用 Claude 家族,除非用户明确接受同源偏差风险。
|
||||
|
||||
## Switching Rules
|
||||
|
||||
- 高层结构、最终合稿、Executive Summary:优先 Opus。
|
||||
- 章节深研:Sonnet 是默认;预算敏感时用 Qwen/DeepSeek,但必须加强 verifier。
|
||||
- 事实核查与术语核查:优先 Haiku + 搜索 API;低置信度条目人工复核。
|
||||
- 翻译与润色:默认 Sonnet;并发提速优先调 `--workers`,不要盲目换便宜模型。
|
||||
- 限流时:先降并发,再换模型。
|
||||
|
||||
## Operational Defaults
|
||||
|
||||
```bash
|
||||
uv run python scripts/translate.py <slug> --workers 4 --model anthropic/claude-sonnet-4.6
|
||||
uv run python scripts/polish.py <slug> --workers 4 --model anthropic/claude-sonnet-4.6
|
||||
uv run python scripts/build_glossary.py <slug> --workers 4 --model anthropic/claude-haiku-4.5
|
||||
```
|
||||
@@ -0,0 +1,224 @@
|
||||
# v0.20 Platform Adapters
|
||||
|
||||
> v0.20 的默认核心入口是 Python core:`scripts/dr.py`、`scripts/runtime/**`、`configs/models.yaml`、`platform_adapters/**`。各平台运行环境由 `scripts/update_platform_envs.py` 重建到 `platform_envs/`。Antigravity 例外:它在生成的 `platform_envs/antigravity` 中使用 `.agent/skills` 与 `.agent/rules` 走 native Deep Research,让 Antigravity 模型配额承担主要研究工作。
|
||||
|
||||
## Shared Rule
|
||||
|
||||
除 Antigravity native 模式外,不要让平台 agent 自己调度 Phase 2 并发、模型选择或上下文压缩。默认平台只负责:
|
||||
|
||||
- 运行 `uv run python scripts/dr.py ...`
|
||||
- 展示产物路径与失败包
|
||||
- 做少量人工访谈、审阅、解释
|
||||
- 必要时调用其原生强模型做“补充审校”,但不得覆盖 Python runtime 的产物 schema
|
||||
|
||||
最小可执行链路:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py init "研究主题" --slug <slug> --method mckinsey_market
|
||||
uv run python scripts/dr.py frame <slug>
|
||||
uv run python scripts/dr.py research <slug> --workers 6
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --execute-packets
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --build-briefs
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --assemble-chapters
|
||||
uv run python scripts/dr.py review <slug>
|
||||
uv run python scripts/dr.py finalize <slug>
|
||||
```
|
||||
|
||||
Antigravity 不走这条最小链路作为默认研究主流程;详见下方 Antigravity 章节。
|
||||
|
||||
## OpenCode
|
||||
|
||||
官方机制:OpenCode 支持 `.opencode/commands/*.md` 自定义命令;文件名就是 slash command,内容是 prompt,frontmatter 可指定 `agent`、`model`、`subtask`。OpenCode 也支持 primary/subagent 两类 agent,但 v0.20 不再把平台 subagent 当默认并发机制。
|
||||
|
||||
本项目调用方式:
|
||||
|
||||
```text
|
||||
/dr-init "ADC 全球竞争格局" --slug adc-global-landscape --method mckinsey_market
|
||||
/dr-frame adc-global-landscape
|
||||
/dr-research adc-global-landscape
|
||||
/dr-review adc-global-landscape
|
||||
/dr-finalize adc-global-landscape
|
||||
/dr-status adc-global-landscape
|
||||
```
|
||||
|
||||
使用建议:
|
||||
|
||||
- OpenCode 适合做表层 TUI、人工访谈和快速查看状态。
|
||||
- 不要让 `dr-pm` 在 OpenCode 里 spawn 多个 dr-analyst;Phase 2 并发已经由 Python worker pool 控制。
|
||||
- 如果要用 OpenCode 原生模型优势,只用于 `frame` 前的人工访谈或 `review` 后的解释,不改变 `configs/models.yaml` 的 role/task 映射。
|
||||
|
||||
## Codex
|
||||
|
||||
官方机制:Codex CLI 使用 `AGENTS.md` 作为项目指令;用户级配置位于 `~/.codex/config.toml` 或 `$CODEX_HOME/config.toml`,项目级 `.codex/**` 只作为可选覆盖。v0.20 推荐用部署脚本把 adapter 模板写到用户级 Codex home,避免在研究项目里维护 `.codex`。Codex 可通过 `/model` 选择 GPT 系列模型、通过 `/permissions` 调整审批/沙盒,也支持多 agent thread,但 v0.20 默认不使用它做研究并发。
|
||||
|
||||
本项目调用方式:
|
||||
|
||||
```bash
|
||||
uv run python scripts/deploy_adapters.py codex --force
|
||||
codex
|
||||
```
|
||||
|
||||
默认部署不会复制 `config.toml`,避免覆盖用户级 Codex 设置;只有明确需要 bundled `deep-research` profile 时才加 `--include-config`,然后用 `codex --profile deep-research`。
|
||||
|
||||
在 Codex 里直接要求:
|
||||
|
||||
```text
|
||||
运行:uv run python scripts/dr.py run "ADC 全球竞争格局" --slug adc-global-landscape --method mckinsey_market
|
||||
```
|
||||
|
||||
或用已有 wrapper prompt:
|
||||
|
||||
```bash
|
||||
codex exec "$(uv run python scripts/dr.py prompt dr-run 'adc-global-landscape')"
|
||||
codex exec "$(uv run python scripts/dr.py prompt dr-research 'adc-global-landscape')"
|
||||
```
|
||||
|
||||
使用建议:
|
||||
|
||||
- Codex 原生 GPT 系列适合代码改造、回归测试、schema/debug、review。
|
||||
- 研究模型混合仍由 Python core 调 ZenMux;Codex 当前会话模型不决定 `dr_analyst`、`dr_verifier` 等 role。
|
||||
- `codex_native` profile 可用于偏 OpenAI/GPT 的执行环境,但仍通过 `configs/models.yaml` 解析。
|
||||
|
||||
## Claude Code
|
||||
|
||||
官方机制:Claude Code 推荐用 `.claude/skills/<name>/SKILL.md` 定义可调用 skill;目录名成为 slash command。旧 `.claude/commands/*.md` 仍兼容,但 skill 优先。Claude Code 的优势是 Claude/Opus/Sonnet 对长文风格和中文润色的稳定性。
|
||||
|
||||
本项目调用方式:
|
||||
|
||||
```bash
|
||||
claude
|
||||
```
|
||||
|
||||
在 Claude Code 中:
|
||||
|
||||
```text
|
||||
/dr-run "ADC 全球竞争格局" --slug adc-global-landscape --method mckinsey_market
|
||||
/dr-research adc-global-landscape
|
||||
/dr-finalize adc-global-landscape
|
||||
```
|
||||
|
||||
使用建议:
|
||||
|
||||
- Claude Code 适合 Phase 1 人工访谈增强、Phase 4 中文风格润色建议、复杂报告结构讨论。
|
||||
- 默认不要让 Claude Code 直接整章写作或并发 spawn;让 Python core 生成 packets、briefs、drafts。
|
||||
- 若想优先用 Claude/Opus 成本包,可在 `configs/models.yaml` 里选择或新增 profile,而不是在 Claude Code prompt 里手工指定。
|
||||
|
||||
## Gemini CLI
|
||||
|
||||
官方机制:Gemini CLI 支持 `GEMINI.md` 作为项目记忆,也支持 `.gemini/commands/*.toml` 自定义命令;TOML command 用 `prompt` 字段,支持 `{{args}}` 参数和 `!{...}` shell 注入。
|
||||
|
||||
本项目调用方式:
|
||||
|
||||
```bash
|
||||
gemini
|
||||
```
|
||||
|
||||
在 Gemini CLI 中:
|
||||
|
||||
```text
|
||||
/dr:run "ADC 全球竞争格局" --slug adc-global-landscape --method mckinsey_market
|
||||
/dr:research adc-global-landscape
|
||||
/dr:review adc-global-landscape
|
||||
/dr:finalize adc-global-landscape
|
||||
```
|
||||
|
||||
使用建议:
|
||||
|
||||
- Gemini CLI 适合长上下文审校、框架替代方案、图表/多模态材料理解。
|
||||
- 对需要本地 shell 的命令,Gemini CLI 会在执行 shell injection 前要求确认,这是好事。
|
||||
- 研究执行仍以 Python core 为准;Gemini 模型可作为 `phase3_review` 或 `final_editorial` profile 的候选模型。
|
||||
|
||||
## Antigravity
|
||||
|
||||
官方资料显示,Antigravity 是 agent-first IDE:主 Agent 可跨 editor、terminal、browser 工作;浏览器操作由 browser subagent 执行;Agent Manager 可管理多个任务流和 artifacts。基于 Codex 的 skill-driven 经验,本项目在 Antigravity 中不再默认把研究主流程交给 Python model workers,而是让 Antigravity 用自己的模型配额按 phase 执行研究。
|
||||
|
||||
本项目已提供 Antigravity adapter 源模板。注意:Git 跟踪的是非隐藏源目录 `platform_adapters/antigravity/agent/`;Antigravity 实际打开的是脚本生成的 `platform_envs/antigravity`,其中才包含 `.agent/` 单数目录。
|
||||
|
||||
- `platform_adapters/antigravity/agent/agents.md`:Antigravity 角色定义,只定义 Research Manager / Strategist / Analyst / Reviewer / Final Editor 等角色。
|
||||
- `platform_adapters/antigravity/agent/skills/antigravity-surface-adapter/SKILL.md`:Antigravity 专用执行说明。
|
||||
- `platform_adapters/antigravity/agent/skills/method-selection/SKILL.md`:按场景选择研究方法,避免默认套用麦肯锡/MECE。
|
||||
- `platform_adapters/antigravity/agent/skills/research-quality-gates/SKILL.md`:把 search receipt、source access、claims ledger、delta retrieve、continuation state 和 final fact check 做成阶段质量门。
|
||||
- `platform_adapters/antigravity/agent/rules/deep-research-antigravity.md`:workspace rule,约束其优先使用 Antigravity 模型配额,避免主流程落回 ZenMux。
|
||||
- `platform_adapters/antigravity/agent/workflows/deep-research-native.md`:可按 slash workflow 执行的四阶段研究流程与反幻觉 gate。
|
||||
|
||||
推荐方式是重建 clean workspace,只让 Antigravity 看到必要文件:
|
||||
|
||||
```bash
|
||||
python scripts/update_platform_envs.py --platform antigravity
|
||||
```
|
||||
|
||||
然后打开 `platform_envs/antigravity`。也可以使用 sparse checkout,见 `docs/antigravity-clean-workspace.md`。
|
||||
|
||||
部署到另一个 Antigravity workspace:
|
||||
|
||||
```bash
|
||||
uv run python scripts/deploy_adapters.py antigravity --target /path/to/workspace --dry-run
|
||||
uv run python scripts/deploy_adapters.py antigravity --target /path/to/workspace
|
||||
```
|
||||
|
||||
该命令只写 workspace-local `.agent/agents.md`、`.agent/skills`、`.agent/rules` 和 `.agent/workflows`,不修改全局 Antigravity/Gemini 设置;已有文件默认跳过,`--force` 才会备份为 `.bak` 后覆盖。
|
||||
|
||||
本项目调用方式:
|
||||
|
||||
1. 在 Antigravity 打开 `platform_envs/antigravity`,不要打开完整多平台仓库。
|
||||
2. 在 Customizations / Rules 中确认 workspace rule 已启用;若未自动启用,手动 at mention `deep-research-antigravity` 或直接引用该文件。
|
||||
3. 选择模型:
|
||||
|
||||
| Phase / 工作 | Antigravity model | 用法 |
|
||||
|---|---|---|
|
||||
| Surface 管理、读 skill、状态推进 | Gemini 3 Flash | 管任务清单、跑轻量命令、收集 artifact |
|
||||
| Phase 0-1 材料解读、框架规划 | Claude Opus 4.6 (Thinking) | 大局观、研究假设、章节结构 |
|
||||
| Phase 2 证据包与章节草稿 | Gemini 3.1 Pro (Low) | 质量/速度均衡,按 skill 写 artifacts |
|
||||
| Phase 3 总编审校 | Gemini 3.1 Pro (High) | 先试高强度 Gemini,不行再换 |
|
||||
| Phase 4 最终统稿 | Claude Opus 4.6 (Thinking) | 保证中文终稿和交付质量 |
|
||||
|
||||
4. 给 Agent Manager 一个明确任务:
|
||||
|
||||
```text
|
||||
请加载 .agent/agents.md、.agent/rules/deep-research-antigravity.md、.agent/skills/antigravity-surface-adapter/SKILL.md、.agent/skills/research-quality-gates/SKILL.md 和 AGENTS.md。
|
||||
这是生成的 Antigravity clean workspace,不要读取父级仓库里的其他平台 adapter。
|
||||
用 Gemini 3 Flash 做流程管理,按 skill 要求在需要时提示我切换模型。
|
||||
研究主题:"ADC 全球竞争格局",slug: adc-global-landscape,method: mckinsey_market。
|
||||
请先创建/确认项目目录,然后进入 Phase 0-1,并在生成 phase1/framework.md 和 research_brief 后暂停。
|
||||
```
|
||||
|
||||
使用建议:
|
||||
|
||||
- Antigravity 的 Gemini/Opus/Gemini Computer Use/Browser 能力适合可视化 QA、PDF/HTML 预览、跨文件审阅。
|
||||
- Opus 额度有限,但 Phase 0-1 和 Phase 4 的价值最高,优先花在框架和终稿,不花在 routine 管理。
|
||||
- 不要默认运行 `dr.py run`、`research --execute-packets`、`research --assemble-chapters`,这些会把主流程重新导向 Python/ZenMux。
|
||||
- Python core 可用于 `init/status/skills validate/finalize/render` 等辅助动作。
|
||||
- 若本机安装了 `paperfoot/search-cli` 的 `search` 命令,Antigravity Phase 0-2 可优先用 `search agent-info`、`search ... --json` 做统一检索入口。
|
||||
- Phase 2 不只产出章节草稿;必须维护 `search_log.jsonl`、`sources.jsonl`、`claims_ledger.jsonl`、`coverage_matrix.md` 和 `unsupported_claims.md`,否则 Phase 3/4 不得声称已验证。
|
||||
- 不建议依赖 SOUL.md:它不是 Antigravity 官方 Deep Research 约束入口。本项目用 `AGENTS.md`、`.agent/agents.md`、`.agent/rules`、`.agent/skills` 和 `.agent/workflows` 分层约束。
|
||||
|
||||
## Model Strategy Across Platforms
|
||||
|
||||
| Platform | Surface model priority | Deep Research model source |
|
||||
|---|---|---|
|
||||
| OpenCode | 可用 Claude/ZenMux provider 做 TUI 增强 | `configs/models.yaml` |
|
||||
| Codex | GPT 系列用于代码、测试、schema、review | `configs/models.yaml` |
|
||||
| Claude Code | Opus/Sonnet 用于访谈、中文风格、结构讨论 | `configs/models.yaml` |
|
||||
| Gemini CLI | Gemini 用于长上下文、多模态、框架审阅 | `configs/models.yaml` |
|
||||
| Antigravity | Gemini Flash/Opus/Gemini Pro 分 phase 执行研究 | `platform_envs/antigravity/.agent/skills` + Antigravity model selector |
|
||||
|
||||
核心原则:除 Antigravity 外,平台模型负责“怎么帮用户操作项目”,ZenMux/Python role 模型负责“研究任务用哪个模型执行”。Antigravity 专门走 native 模式,以消耗 Antigravity 自身模型配额并降低 Python-core 碎片化风险。
|
||||
|
||||
## Sources
|
||||
|
||||
- OpenCode commands and agents: https://opencode.ai/docs/commands/ , https://opencode.ai/docs/agents/
|
||||
- Codex CLI slash commands and config: https://developers.openai.com/codex/cli/slash-commands , https://developers.openai.com/codex/config-reference
|
||||
- Claude Code skills/slash commands: https://code.claude.com/docs/en/slash-commands
|
||||
- Gemini CLI custom commands: https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/custom-commands.md
|
||||
- Google Antigravity announcement: https://blog.google/products-and-platforms/products/gemini/gemini-3/
|
||||
- Google Antigravity rules/workflows: https://antigravity.google/docs/rules-workflows
|
||||
- Google Antigravity skills: https://antigravity.google/docs/skills
|
||||
- Google Antigravity models: https://antigravity.google/docs/models
|
||||
- Google Antigravity permissions: https://antigravity.google/docs/agent-permissions
|
||||
- paperfoot/search-cli skill: https://github.com/paperfoot/search-cli/blob/master/SKILL.md
|
||||
- Gemini CLI GEMINI.md context: https://geminicli.com/docs/cli/gemini-md/
|
||||
- Gemini CLI GEMINI.md examples issue: https://github.com/google-gemini/gemini-cli/issues/9241
|
||||
- Practical GEMINI.md hierarchy: https://medium.com/google-cloud/practical-gemini-cli-instruction-following-gemini-md-hierarchy-part-1-3ba241ac5496
|
||||
- Claude Code best-practice CLAUDE.md: https://github.com/shanraisshan/claude-code-best-practice/blob/main/CLAUDE.md
|
||||
- Claude MD guide: https://github.com/MuhammadUsmanGM/claude-code-best-practices/blob/main/guides/claude-md-guide.md
|
||||
- Writing a good CLAUDE.md: https://www.humanlayer.dev/blog/writing-a-good-claude-md
|
||||
@@ -0,0 +1,49 @@
|
||||
# Platform Branch Strategy
|
||||
|
||||
Use one of two clean separation patterns.
|
||||
|
||||
## Preferred Default: Source Templates + Rebuilt Envs
|
||||
|
||||
The main branch tracks only source templates:
|
||||
|
||||
- `platform_adapters/antigravity`
|
||||
- `platform_adapters/codex`
|
||||
- `platform_adapters/opencode`
|
||||
- `platform_adapters/claude-code`
|
||||
- `platform_adapters/gemini-cli`
|
||||
|
||||
Local runnable environments are generated and ignored:
|
||||
|
||||
- `platform_envs/antigravity`
|
||||
- `platform_envs/codex`
|
||||
- `platform_envs/opencode`
|
||||
- `platform_envs/claude-code`
|
||||
- `platform_envs/gemini-cli`
|
||||
|
||||
Update flow:
|
||||
|
||||
```bash
|
||||
git pull --ff-only
|
||||
python scripts/update_platform_envs.py --platform antigravity --skip-pull
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```bash
|
||||
python scripts/update_platform_envs.py --platform all
|
||||
```
|
||||
|
||||
Open the generated platform env, not the full repository.
|
||||
|
||||
## Alternative: Per-Platform Branches
|
||||
|
||||
If a platform keeps ignoring generated-env boundaries, split Gitea branches:
|
||||
|
||||
- `main`: Python core, docs, canonical skills, shared configs.
|
||||
- `platform/codex`: Codex-only working tree.
|
||||
- `platform/antigravity`: Antigravity-only working tree.
|
||||
- `platform/opencode`: OpenCode-only working tree.
|
||||
- `platform/claude-code`: Claude Code-only working tree.
|
||||
- `platform/gemini-cli`: Gemini CLI-only working tree.
|
||||
|
||||
In that mode, platform branches should remove unrelated platform directories entirely. Merge shared runtime changes from `main`; do not merge one platform branch into another.
|
||||
@@ -0,0 +1,106 @@
|
||||
# Search API Playbook
|
||||
|
||||
> v0.9 起,本文件作为搜索 API 选择攻略本。搜索返回本身多为发现入口,结论支撑仍以 AGENTS.md 的 Tier 1-2 信源为准。
|
||||
|
||||
## Default Pattern
|
||||
|
||||
v0.12 起,默认搜索路径收敛到项目内 Python 网关:
|
||||
|
||||
```bash
|
||||
uv run python scripts/search.py "<query>" --route scholar --num-results 10 --year-low 2023
|
||||
uv run python scripts/search.py "<query>" --route evidence --num-results 10 --json --trace
|
||||
uv run python scripts/search.py "<query>" --route patents --num-results 10
|
||||
uv run python scripts/search.py "<query>" --route news --num-results 10 --time-range m
|
||||
uv run python scripts/search.py "<query>" --route general --num-results 10
|
||||
uv run python scripts/ground.py "<query>" --json
|
||||
```
|
||||
|
||||
其中 `scholar / patents / news` 默认走严格模式(Serper 失败不静默降级);需要容错时显式加 `--no-strict-specialized`。`evidence` 是 v0.20.1 之后新增的受控证据发现路由,优先用 Exa highlights/text 为 evidence packet 提供候选来源。
|
||||
|
||||
MCP server 只作为交互式补漏和特殊工具能力,不作为文献、专利、新闻检索主路径。这样 OpenCode、Codex、Gemini CLI、Claude Code 都能复用同一套路由,减少每个平台单独配置 Tavily/Exa/Brave MCP 的依赖。
|
||||
|
||||
## Search Sources
|
||||
|
||||
### Tavily
|
||||
|
||||
- 优点:LLM 友好,摘要质量稳定,适合快速发现方向。
|
||||
- 用法:初扫、普通网页、报告线索、交叉补漏;`research()` 更适合 Phase 1 初步扫描、薄弱章节补证据、Phase 3 回炉。
|
||||
- 风险:不能把普通网页当结论支撑,必须追溯原始来源。
|
||||
- 规则:Tavily Research 输出必须保存为过程文件,并经过 source-quality 评分、去重和 source_id 归一化;不要直接把 Tavily 的综合报告当作章节正文或最终证据。
|
||||
|
||||
### Exa
|
||||
|
||||
- 优点:neural/agent search,对官网、公司页、长尾专业内容召回好;highlights/text 适合喂给 agent 做证据筛选。
|
||||
- 用法:`scripts/search.py --route evidence`、术语核查、公司/产品名纠错、专业网页发现、章节证据补强。
|
||||
- 风险:macOS 代理环境容易 TLS EOF,项目内 `SearchClient` 已使用 `trust_env=False` 绕开系统代理。
|
||||
|
||||
### Brave
|
||||
|
||||
- 优点:独立搜索引擎,适合与 Tavily/Exa 交叉验证。
|
||||
- 用法:Phase 1 初扫、反方证据、中文/英文混合搜索。
|
||||
- 风险:结果质量波动,需要人工筛 Tier。
|
||||
|
||||
### Serper
|
||||
|
||||
- 优点:Google Search / Scholar / News 代理,免费额度较高。
|
||||
- 用法:Google Scholar、Google Patents、新闻时效检索。
|
||||
- 风险:专利是 `site:patents.google.com` 技巧,不等同官方专利库。
|
||||
- 项目内调用:`scripts/search.py --route scholar|patents|news`。
|
||||
|
||||
### PubMed / NCBI
|
||||
|
||||
- 优点:生物医药论文的一手入口。
|
||||
- 用法:机制、临床、系统综述、meta 分析。
|
||||
- 风险:无 API key 限流较低;摘要不足以替代全文判断。
|
||||
|
||||
### ClinicalTrials.gov / ChiCTR
|
||||
|
||||
- 优点:临床试验注册的一手来源。
|
||||
- 用法:管线、适应症、试验阶段、终点设计、入组状态。
|
||||
- 风险:注册信息不等于结果;需要结合论文、公司披露、监管文件。
|
||||
|
||||
### openFDA / FDA / EMA / NMPA
|
||||
|
||||
- 优点:监管公告与标签信息,Tier 1。
|
||||
- 用法:批准状态、安全性、适应症、审评文件。
|
||||
- 风险:不同监管地区口径不同,必须注明地区与日期。
|
||||
|
||||
### Patents
|
||||
|
||||
- 优点:IP 与工艺路线研究的核心证据。
|
||||
- 用法:Google Patents、USPTO、EPO、CNIPA。
|
||||
- 风险:专利文本难读,权利要求和实施例要分开判断。
|
||||
|
||||
## Recommended Profiles
|
||||
|
||||
## v0.20 Routing Decision
|
||||
|
||||
- Phase 1 初步扫描:Tavily Research + Exa evidence,目标是形成假设、反证方向、章节任务切分。
|
||||
- Phase 2 evidence packet:优先 `fda/scholar/patents/news` 等专用路由;需要补充候选证据时用 `evidence`,不要只用 `general`。
|
||||
- Phase 3 回炉:按 critique 中的证据缺口定向调用 Tavily Research 或 Exa evidence,输出仍需进入 packet/schema。
|
||||
- General route:只做宽泛发现和兜底,不作为“默认最佳搜索”。
|
||||
|
||||
## Recommended Profiles
|
||||
|
||||
### biomed_literature
|
||||
|
||||
PubMed / NCBI → ClinicalTrials → FDA/EMA/NMPA → `scripts/search.py --route scholar` → `scripts/search.py --route evidence` → Tavily/Brave 补漏。
|
||||
|
||||
### patent_heavy
|
||||
|
||||
`scripts/search.py --route patents` → USPTO/EPO/CNIPA → 公司年报/招股书 → Exa/Tavily 补同族专利线索。
|
||||
|
||||
### china_market
|
||||
|
||||
NMPA/CDE → 港交所/上交所/深交所披露 → 中文专业数据库/媒体 → Brave/Serper 中文搜索。
|
||||
|
||||
### investment
|
||||
|
||||
SEC/交易所披露 → Evaluate/IQVIA/咨询报告 → 公司公告 → 新闻仅作时效入口。
|
||||
|
||||
## Failure Handling
|
||||
|
||||
- 大量 SSL/TLS 错误:先把 workers 降到 3,再重跑。
|
||||
- API 限流:保留缓存结果,断点续跑,不要强制 `--force`。
|
||||
- 搜索返回普通网页:只做线索,继续追原始论文、监管、专利或公司披露。
|
||||
- 中英文译名冲突:写入 glossary,标 medium/low confidence,交人工复核。
|
||||
@@ -0,0 +1,763 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Generate formal meeting minutes PDF for Yugong Biotech audit remediation.
|
||||
"""
|
||||
|
||||
from reportlab.lib.pagesizes import A4
|
||||
from reportlab.lib import colors
|
||||
from reportlab.lib.units import cm
|
||||
from reportlab.lib.styles import ParagraphStyle
|
||||
from reportlab.platypus import (
|
||||
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
|
||||
HRFlowable, KeepTogether
|
||||
)
|
||||
from reportlab.pdfbase import pdfmetrics
|
||||
from reportlab.pdfbase.ttfonts import TTFont
|
||||
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
|
||||
import os
|
||||
|
||||
# ── 字体注册 ──────────────────────────────────────────────────────────────────
|
||||
pdfmetrics.registerFont(TTFont('STHeiti', '/System/Library/Fonts/STHeiti Medium.ttc', subfontIndex=0))
|
||||
pdfmetrics.registerFont(TTFont('STHeitiLight', '/System/Library/Fonts/STHeiti Light.ttc', subfontIndex=0))
|
||||
|
||||
# ── 颜色定义 ──────────────────────────────────────────────────────────────────
|
||||
DARK_BLUE = colors.HexColor('#1B3A6B')
|
||||
MID_BLUE = colors.HexColor('#2E6DA4')
|
||||
LIGHT_BLUE = colors.HexColor('#D6E4F0')
|
||||
RED_CRIT = colors.HexColor('#C0392B')
|
||||
ORANGE_MAJ = colors.HexColor('#E67E22')
|
||||
YELLOW_MIN = colors.HexColor('#F1C40F')
|
||||
BG_CRIT = colors.HexColor('#FADBD8')
|
||||
BG_MAJ = colors.HexColor('#FDEBD0')
|
||||
BG_MIN = colors.HexColor('#FEF9E7')
|
||||
BG_HEAD = colors.HexColor('#EBF5FB')
|
||||
GRAY_LINE = colors.HexColor('#BDC3C7')
|
||||
WHITE = colors.white
|
||||
DARK_GRAY = colors.HexColor('#2C3E50')
|
||||
LIGHT_GRAY = colors.HexColor('#F2F3F4')
|
||||
|
||||
# ── 段落样式 ──────────────────────────────────────────────────────────────────
|
||||
def make_styles():
|
||||
base = {'fontName': 'STHeiti', 'leading': 16}
|
||||
return {
|
||||
'title': ParagraphStyle('title',
|
||||
fontName='STHeiti', fontSize=16, leading=22,
|
||||
alignment=TA_CENTER, textColor=WHITE, spaceAfter=4),
|
||||
'subtitle': ParagraphStyle('subtitle',
|
||||
fontName='STHeitiLight', fontSize=8.5, leading=13,
|
||||
alignment=TA_CENTER, textColor=colors.HexColor('#D6EAF8'), spaceAfter=2),
|
||||
'section': ParagraphStyle('section',
|
||||
fontName='STHeiti', fontSize=12, leading=18,
|
||||
textColor=WHITE, spaceBefore=6, spaceAfter=4),
|
||||
'subsection': ParagraphStyle('subsection',
|
||||
fontName='STHeiti', fontSize=10.5, leading=16,
|
||||
textColor=DARK_BLUE, spaceBefore=8, spaceAfter=4),
|
||||
'body': ParagraphStyle('body',
|
||||
fontName='STHeitiLight', fontSize=9.5, leading=15,
|
||||
textColor=DARK_GRAY, spaceAfter=3, alignment=TA_LEFT),
|
||||
'body_bold': ParagraphStyle('body_bold',
|
||||
fontName='STHeiti', fontSize=9.5, leading=15,
|
||||
textColor=DARK_GRAY, spaceAfter=3),
|
||||
'cell': ParagraphStyle('cell',
|
||||
fontName='STHeitiLight', fontSize=8.5, leading=13,
|
||||
textColor=DARK_GRAY),
|
||||
'cell_bold': ParagraphStyle('cell_bold',
|
||||
fontName='STHeiti', fontSize=8.5, leading=13,
|
||||
textColor=DARK_GRAY),
|
||||
'cell_crit': ParagraphStyle('cell_crit',
|
||||
fontName='STHeiti', fontSize=8.5, leading=13,
|
||||
textColor=RED_CRIT),
|
||||
'cell_maj': ParagraphStyle('cell_maj',
|
||||
fontName='STHeiti', fontSize=8.5, leading=13,
|
||||
textColor=ORANGE_MAJ),
|
||||
'cell_min': ParagraphStyle('cell_min',
|
||||
fontName='STHeiti', fontSize=8.5, leading=13,
|
||||
textColor=colors.HexColor('#9B7D11')),
|
||||
'footer': ParagraphStyle('footer',
|
||||
fontName='STHeitiLight', fontSize=7.5, leading=11,
|
||||
textColor=colors.HexColor('#7F8C8D'), alignment=TA_CENTER),
|
||||
'cell_header': ParagraphStyle('cell_header',
|
||||
fontName='STHeiti', fontSize=8.5, leading=13,
|
||||
textColor=WHITE),
|
||||
'reg_title': ParagraphStyle('reg_title',
|
||||
fontName='STHeiti', fontSize=9.5, leading=14,
|
||||
textColor=MID_BLUE, spaceAfter=2),
|
||||
'bullet': ParagraphStyle('bullet',
|
||||
fontName='STHeitiLight', fontSize=9, leading=14,
|
||||
textColor=DARK_GRAY, leftIndent=12, spaceAfter=2),
|
||||
}
|
||||
|
||||
S = make_styles()
|
||||
|
||||
# ── 辅助:带背景色的节标题 ────────────────────────────────────────────────────
|
||||
def section_header(text, color=MID_BLUE, text_style='section'):
|
||||
data = [[Paragraph(text, S[text_style])]]
|
||||
t = Table(data, colWidths=[17.5*cm])
|
||||
t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,-1), color),
|
||||
('TOPPADDING', (0,0), (-1,-1), 5),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 5),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 10),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 10),
|
||||
('ROWBACKGROUNDS', (0,0), (-1,-1), [color]),
|
||||
]))
|
||||
return t
|
||||
|
||||
def info_table(rows):
|
||||
"""Two-column key-value table for meeting info."""
|
||||
data = [[Paragraph(k, S['cell_bold']), Paragraph(v, S['cell'])]
|
||||
for k, v in rows]
|
||||
t = Table(data, colWidths=[3.8*cm, 13.7*cm])
|
||||
t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (0,-1), BG_HEAD),
|
||||
('BACKGROUND', (1,0), (1,-1), WHITE),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 4),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 4),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 6),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 6),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
return t
|
||||
|
||||
# ── 主文档构建 ────────────────────────────────────────────────────────────────
|
||||
def build_pdf(output_path):
|
||||
doc = SimpleDocTemplate(
|
||||
output_path,
|
||||
pagesize=A4,
|
||||
leftMargin=2.0*cm, rightMargin=2.0*cm,
|
||||
topMargin=2.2*cm, bottomMargin=2.2*cm,
|
||||
title='愚公生物(百时美)供应商审计整改会议纪要',
|
||||
author='愚公生物科技有限公司 质量管理部',
|
||||
)
|
||||
|
||||
story = []
|
||||
W = 17.5 * cm # 可用宽度
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 封面标题区
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
cover_data = [
|
||||
[Paragraph('愚公生物科技有限公司(百时美)', S['subtitle'])],
|
||||
[Paragraph('供应商审计问题复盘与质量整改专项会议纪要', S['title'])],
|
||||
[Paragraph('SUPPLIER AUDIT REMEDIATION — INTERNAL MEETING MINUTES', S['subtitle'])],
|
||||
[Paragraph('文件编号:YG-QA-MOM-2026-001 版本:V1.0 密级:内部', S['subtitle'])],
|
||||
]
|
||||
cover_t = Table(cover_data, colWidths=[W])
|
||||
cover_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,-1), DARK_BLUE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 12),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 12),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 14),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 14),
|
||||
]))
|
||||
story.append(cover_t)
|
||||
story.append(Spacer(1, 0.4*cm))
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 一、会议基本信息
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
story.append(section_header('一、会议基本信息'))
|
||||
story.append(Spacer(1, 0.2*cm))
|
||||
story.append(info_table([
|
||||
('会议主题', '申基供应商审计问题复盘、质量体系整改及 4000 万订单配合工作'),
|
||||
('会议日期', '2026 年 4 月 10 日'),
|
||||
('会议地点', '愚公生物科技有限公司 会议室'),
|
||||
('主持人', '任宏杰(说话人 A)'),
|
||||
('参会人员', '任宏杰(A,主持)、二袁(B)、说话人 C、毕海(D)、说话人 E'),
|
||||
('记录人', '质量管理部'),
|
||||
('核心背景', '申基承接制药企业 CDMO 业务,委托愚公生物生产关键工具酶原料。\n'
|
||||
'申基依其客户要求对愚公生物开展现场供应商审计,发现若干缺陷。\n'
|
||||
'本次会议为愚公生物内部复盘,制定整改方案与行动计划。\n'
|
||||
'4000 万元订单执行不受本次审计直接影响,各方共担提考连带责任。'),
|
||||
]))
|
||||
story.append(Spacer(1, 0.5*cm))
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 二、适用质量法规体系综述
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
story.append(section_header('二、酶类原料供应商适用质量法规体系综述'))
|
||||
story.append(Spacer(1, 0.25*cm))
|
||||
|
||||
story.append(Paragraph('2.1 原料定位判断', S['subsection']))
|
||||
story.append(Paragraph(
|
||||
'愚公生物生产的工具酶(含 RI 核糖核酸酶抑制剂等)在申基 CDMO 场景中,以工艺辅助或关键'
|
||||
'原料身份介入药物生产,<b>不作为最终药品活性成分(API)存在于制成品中</b>。依据 ICH Q7、'
|
||||
'IPEC-PQG GMP 指南及 FDA/EMA 相关指导原则,其定位层级如下:',
|
||||
S['body']))
|
||||
|
||||
pos_data = [
|
||||
[Paragraph('定位层级', S['cell_header']),
|
||||
Paragraph('判断依据', S['cell_header']),
|
||||
Paragraph('适用情景', S['cell_header']),
|
||||
Paragraph('适用标准', S['cell_header'])],
|
||||
[Paragraph('API 起始物料\n(API Starting Material)', S['cell']),
|
||||
Paragraph('酶直接掺入 API 结构,或残留物影响 API 关键质量属性(CQAs)', S['cell']),
|
||||
Paragraph('酶参与关键化学反应步骤,残留显著影响杂质谱', S['cell']),
|
||||
Paragraph('ICH Q7 全文、供应商审计、DMF 备案', S['cell'])],
|
||||
[Paragraph('关键原料 / 工艺助剂\n(Critical Reagent)\n★ 当前最可能定位', S['cell_bold']),
|
||||
Paragraph('酶仅参与上游工艺步骤,最终产品中不含酶活或酶蛋白;\n但其质量直接影响产品 CQA(如活性、纯度、内毒素)', S['cell']),
|
||||
Paragraph('RI 酶用于 mRNA/蛋白合成工艺,\n纯化后被去除', S['cell']),
|
||||
Paragraph('ICH Q7(原材料章节)、IPEC-PQG GMP(基础)、\nISO 9001:2015、质量协议(QA)', S['cell'])],
|
||||
[Paragraph('辅料 / 工艺助剂\n(Excipient/Processing Aid)', S['cell']),
|
||||
Paragraph('酶以非治疗性功能加入制剂,如增稠、稳定等', S['cell']),
|
||||
Paragraph('较少见于工具酶场景', S['cell']),
|
||||
Paragraph('IPEC-PQG GMP、EXCiPACT 认证、ISO 9001', S['cell'])],
|
||||
]
|
||||
pos_t = Table(pos_data, colWidths=[3.5*cm, 5*cm, 4*cm, 5*cm])
|
||||
pos_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
|
||||
('TEXTCOLOR', (0,0), (-1,0), WHITE),
|
||||
('FONTNAME', (0,0), (-1,0), 'STHeiti'),
|
||||
('BACKGROUND', (0,2), (-1,2), LIGHT_BLUE),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 4),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 4),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 5),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 5),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, LIGHT_BLUE, WHITE]),
|
||||
]))
|
||||
story.append(pos_t)
|
||||
story.append(Spacer(1, 0.3*cm))
|
||||
|
||||
story.append(Paragraph('2.2 核心适用法规框架', S['subsection']))
|
||||
|
||||
reg_rows = [
|
||||
('ICH Q7\n(API GMP)', 'GMP 原材料章节要求供应商评估与批准;关键原材料须执行三批次全检基准测试;质量协议中须明确检验方法、CoA 要求、供应商变更通知条款。'),
|
||||
('IPEC-PQG GMP 指南\n(辅料/关键原料)', '适用于药物辅料及工艺助剂生产商;要求在工艺中"有理可循"的节点执行 GMP;覆盖文件管理、变更控制、偏差管理、清洁验证、稳定性研究。与 ISO 9001 互补。'),
|
||||
('ISO 9001:2015\n(质量管理体系)', '作为最低基线的质量管理体系;涵盖记录控制、不合格品管理、持续改进、内审等。不能替代药品 GMP,但为药企客户审计的基础期望。'),
|
||||
('中国 NMPA\n相关法规', '《原辅料及直接接触药品包装材料供应商审计指南》(2020年):药企须对关键原辅料供应商定期审计;供应商须具备与产品风险相称的质量体系;原辅料变更须履行评估与报告程序。'),
|
||||
('质量协议(QA)\n与供应商资质', '申基作为 CDMO 依托其下游客户要求,须与愚公生物签订正式质量协议,约定:CoA 内容与放行标准、审计权利、变更通知时限、可溯源性要求、稳定性和储存条件、内毒素/生物负载限度。'),
|
||||
('关键检测要求\n(酶原料特有)', '活性(RI 活性等效力测定)、纯度(SEC-HPLC)、内毒素(LAL)、生物负载(TAMC/TYMC)、宿主细胞蛋白(HCP)、残余 DNA、重金属;稳定性数据(支持储存条件)。'),
|
||||
]
|
||||
for title, content in reg_rows:
|
||||
data = [[Paragraph(title, S['reg_title']), Paragraph(content, S['cell'])]]
|
||||
t = Table(data, colWidths=[3.8*cm, 13.7*cm])
|
||||
t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (0,-1), BG_HEAD),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 5),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 5),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 6),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 6),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
story.append(t)
|
||||
story.append(Spacer(1, 0.15*cm))
|
||||
|
||||
story.append(Paragraph(
|
||||
'结论:愚公生物作为药物关键工具酶原料供应商,不必全面执行药品 GMP(21 CFR Part 211 或《药品生产质量管理规范》),'
|
||||
'但须建立并有效运行<b>以 ISO 9001 为基础、参照 IPEC-PQG GMP 指南核心要求的质量体系</b>,并满足申基及其客户在'
|
||||
'质量协议中约定的特定要求,包括:数据完整性、验证体系、关键参数检测(尤其 RI 活性)及稳定性研究。',
|
||||
S['body']))
|
||||
story.append(Spacer(1, 0.5*cm))
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 三、审计缺陷项分级分析
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
story.append(section_header('三、审计缺陷项严重等级分析'))
|
||||
story.append(Spacer(1, 0.2*cm))
|
||||
|
||||
# 分级说明
|
||||
legend_data = [
|
||||
[Paragraph('严重(Critical)', S['cell_crit']),
|
||||
Paragraph('重大(Major)', S['cell_maj']),
|
||||
Paragraph('一般(Minor)', S['cell_min'])],
|
||||
[Paragraph('直接危及产品质量/安全性,或存在系统性数据诚信问题,不可接受,须立即整改', S['cell']),
|
||||
Paragraph('显著违反质量体系要求,可能导致产品质量问题,须限期整改', S['cell']),
|
||||
Paragraph('程序性缺陷,当前影响有限,须计划整改', S['cell'])],
|
||||
]
|
||||
legend_t = Table(legend_data, colWidths=[W/3, W/3, W/3])
|
||||
legend_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (0,-1), BG_CRIT),
|
||||
('BACKGROUND', (1,0), (1,-1), BG_MAJ),
|
||||
('BACKGROUND', (2,0), (2,-1), BG_MIN),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 5),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 5),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 6),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 6),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
('ALIGN', (0,0), (-1,0), 'CENTER'),
|
||||
]))
|
||||
story.append(legend_t)
|
||||
story.append(Spacer(1, 0.35*cm))
|
||||
|
||||
# ── 3.1 严重缺陷 ──────────────────────────────────────────────────────────
|
||||
story.append(section_header('3.1 严重缺陷(Critical)', color=RED_CRIT))
|
||||
story.append(Spacer(1, 0.2*cm))
|
||||
|
||||
crit_header = [
|
||||
Paragraph('编号', S['cell_header']),
|
||||
Paragraph('缺陷描述', S['cell_header']),
|
||||
Paragraph('法规依据', S['cell_header']),
|
||||
Paragraph('风险说明', S['cell_header']),
|
||||
]
|
||||
crit_items = [
|
||||
('C-01', '系统性记录造假与数据完整性严重缺失',
|
||||
'记录普遍事后补写;一批生产对应三批数据;温湿度/压差辅助记录迎审时统一补填,笔迹一眼可辨,与主批记录时间矛盾;批记录存在明显造假痕迹。',
|
||||
'ICH Q7 第 6 章;IPEC-PQG GMP 4.5;ISO 9001 7.5;FDA Data Integrity Guidance(2018)',
|
||||
'数据诚信(Data Integrity)是 GMP/质量体系的核心基石。系统性造假导致审计方对所有数据完全不信任,无法证明产品质量受控,直接危及下游客户的药品申报。'),
|
||||
('C-02', 'RI 活性检测能力缺失,未纳入质量标准',
|
||||
'生产端荧光仪无法检测 RI 活性;RI 活性效力测定未纳入原酶及成品质量标准;无法证明每批产品活性符合要求。',
|
||||
'ICH Q7 11.1;IPEC-PQG GMP 8.1;FDA Potency Guidance;质量协议约定检测项目',
|
||||
'RI 活性是该产品的核心关键质量属性(CQA)。无活性检测即无法保证产品功能一致性,直接影响客户药物工艺结果,属最高级别产品质量风险。'),
|
||||
('C-03', '清洁验证严重缺失(交叉污染风险)',
|
||||
'100+ 品种共线生产,无任何残留限度设定、无棉签回收率验证、无中转容器清洁验证;无法证明产品间无交叉污染。',
|
||||
'IPEC-PQG GMP 6.4;ICH Q7 第 12 章;EU GMP Annex 15',
|
||||
'多品种共线而无清洁验证,存在产品间交叉污染的实质性风险,可能导致客户产品出现工艺外源污染物,危及药品安全性与有效性。'),
|
||||
]
|
||||
|
||||
for code, title, desc, ref, risk in crit_items:
|
||||
header_row = [
|
||||
Paragraph(f'<b>{code}</b>', S['cell_crit']),
|
||||
Paragraph(f'<b>{title}</b>', S['cell_crit']),
|
||||
Paragraph('', S['cell']),
|
||||
Paragraph('', S['cell']),
|
||||
]
|
||||
desc_row = [
|
||||
Paragraph('缺陷描述', S['cell_bold']),
|
||||
Paragraph(desc, S['cell']),
|
||||
Paragraph('法规依据', S['cell_bold']),
|
||||
Paragraph(ref, S['cell']),
|
||||
]
|
||||
risk_row = [
|
||||
Paragraph('风险说明', S['cell_bold']),
|
||||
Paragraph(risk, S['cell']),
|
||||
Paragraph('', S['cell']),
|
||||
Paragraph('', S['cell']),
|
||||
]
|
||||
t = Table([header_row, desc_row, risk_row],
|
||||
colWidths=[1.8*cm, 6.8*cm, 2*cm, 6.9*cm])
|
||||
t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,0), BG_CRIT),
|
||||
('BACKGROUND', (0,1), (0,-1), LIGHT_GRAY),
|
||||
('BACKGROUND', (2,1), (2,-1), LIGHT_GRAY),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('SPAN', (1,0), (3,0)),
|
||||
('SPAN', (1,2), (3,2)),
|
||||
('TOPPADDING', (0,0), (-1,-1), 4),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 4),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 5),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 5),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
story.append(KeepTogether([t, Spacer(1, 0.2*cm)]))
|
||||
|
||||
# ── 3.2 重大缺陷 ──────────────────────────────────────────────────────────
|
||||
story.append(Spacer(1, 0.15*cm))
|
||||
story.append(section_header('3.2 重大缺陷(Major)', color=ORANGE_MAJ))
|
||||
story.append(Spacer(1, 0.2*cm))
|
||||
|
||||
maj_items = [
|
||||
('M-01', '文件体系不具可执行性,照搬药企模板',
|
||||
'文件大量照搬恒瑞/天晴模板,与公司实际人力、产能、工艺严重不符;存在替换页、纸张颜色不一致等低级错误;文件被审计方整体质疑。',
|
||||
'IPEC-PQG GMP 4.1;ISO 9001 7.5;ICH Q7 第 6 章'),
|
||||
('M-02', '文件发放、接收、销毁流程缺失,虚拟执行',
|
||||
'无接收人记录、文件名错误、发放流程形同虚设;存在虚拟执行痕迹(文件从未真实流转)。',
|
||||
'IPEC-PQG GMP 4.2;ICH Q7 6.5;ISO 9001 7.5.3'),
|
||||
('M-03', '偏差/OOS/OOT 管理体系完全缺失',
|
||||
'无任何偏差、超标(OOS)、超趋势(OOT)记录与处理程序;审计方判定"产品是检出来的,不是生产出来的"。',
|
||||
'ICH Q7 第 15 章;IPEC-PQG GMP 5.2;FDA OOS Guidance(2006)'),
|
||||
('M-04', '工艺验证报告不可信,关键参数未覆盖',
|
||||
'工艺验证报告未覆盖关键工艺参数、收率及内毒素去除效率;批记录与工艺规程描述不一致;纯化多峰即收,无固定标准。',
|
||||
'ICH Q7 第 12 章;IPEC-PQG GMP 7.1;EU GMP Annex 15'),
|
||||
('M-05', '稳定性研究缺失,产品全生命周期数据空白',
|
||||
'原酶未开展稳定性研究;现有方案设计不合理(25℃放置 12 个月,不符合酶类特性);无法为储存条件和效期提供数据支撑。',
|
||||
'ICH Q1A(R2);IPEC-PQG GMP 8.2;ICH Q7 11.6'),
|
||||
('M-06', 'QA/QC 人员专业能力严重不足,QA 负责人不称职',
|
||||
'QA/QC 团队多为外行,不了解酶行业特性;QA 负责人言语轻浮、以第三方心态应对客户,现场被当场质疑;人员一人多岗,审计方直接判定数据不可信。',
|
||||
'ICH Q7 第 2 章;IPEC-PQG GMP 3.2;ISO 9001 7.2'),
|
||||
('M-07', '关键设备缺失,设备标识不全',
|
||||
'缺少灭菌锅、干燥箱等必要设备;砝码、设备标识不全;荧光仪无法满足 RI 活性检测要求。',
|
||||
'ICH Q7 第 5 章;IPEC-PQG GMP 6.1;ISO 9001 7.1'),
|
||||
('M-08', '酶与 buffer 未分离管理,不符合规范',
|
||||
'酶与 buffer 混合管理,无独立稳定性和质量控制;不符合 GMP/IPEC 产品分类管理规范。',
|
||||
'IPEC-PQG GMP 5.1;ICH Q7 11.2'),
|
||||
]
|
||||
|
||||
maj_header = [
|
||||
Paragraph('编号', S['cell_header']),
|
||||
Paragraph('缺陷名称', S['cell_header']),
|
||||
Paragraph('缺陷描述', S['cell_header']),
|
||||
Paragraph('法规依据', S['cell_header']),
|
||||
]
|
||||
maj_data = [maj_header] + [
|
||||
[Paragraph(f'<b>{c}</b>', S['cell_maj']),
|
||||
Paragraph(f'<b>{t}</b>', S['cell_bold']),
|
||||
Paragraph(d, S['cell']),
|
||||
Paragraph(r, S['cell'])]
|
||||
for c, t, d, r in maj_items
|
||||
]
|
||||
maj_t = Table(maj_data, colWidths=[1.5*cm, 3.5*cm, 7.8*cm, 4.7*cm])
|
||||
maj_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,0), ORANGE_MAJ),
|
||||
('TEXTCOLOR', (0,0), (-1,0), WHITE),
|
||||
('FONTNAME', (0,0), (-1,0), 'STHeiti'),
|
||||
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, BG_MAJ]),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 4),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 4),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 5),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 5),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
story.append(maj_t)
|
||||
story.append(Spacer(1, 0.35*cm))
|
||||
|
||||
# ── 3.3 一般缺陷 ──────────────────────────────────────────────────────────
|
||||
story.append(section_header('3.3 一般缺陷(Minor)', color=colors.HexColor('#9B7D11')))
|
||||
story.append(Spacer(1, 0.2*cm))
|
||||
|
||||
min_items = [
|
||||
('N-01', '现场卫生问题',
|
||||
'下水管道锈蚀严重,现场整洁度不达标,影响客户观感与检查结论。',
|
||||
'IPEC-PQG GMP 6.3;ISO 9001 7.1'),
|
||||
('N-02', '文件低级错误(替换页、颜色不一致)',
|
||||
'文件中存在替换页、纸张颜色不一致等低级错误,直接导致文件整体可信度下降。',
|
||||
'ICH Q7 6.2;IPEC-PQG GMP 4.2'),
|
||||
('N-03', '批记录数据项不完整(缺少计算过程)',
|
||||
'批记录中关键数据缺少计算过程记录,数据可追溯性不足(此项与 C-01 系统造假有别,属记录习惯问题)。',
|
||||
'ICH Q7 6.4;IPEC-PQG GMP 4.5'),
|
||||
]
|
||||
|
||||
min_header = [
|
||||
Paragraph('编号', S['cell_header']),
|
||||
Paragraph('缺陷名称', S['cell_header']),
|
||||
Paragraph('缺陷描述', S['cell_header']),
|
||||
Paragraph('法规依据', S['cell_header']),
|
||||
]
|
||||
min_data = [min_header] + [
|
||||
[Paragraph(f'<b>{c}</b>', S['cell_min']),
|
||||
Paragraph(f'<b>{t}</b>', S['cell_bold']),
|
||||
Paragraph(d, S['cell']),
|
||||
Paragraph(r, S['cell'])]
|
||||
for c, t, d, r in min_items
|
||||
]
|
||||
min_t = Table(min_data, colWidths=[1.5*cm, 3.5*cm, 7.8*cm, 4.7*cm])
|
||||
min_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#9B7D11')),
|
||||
('TEXTCOLOR', (0,0), (-1,0), WHITE),
|
||||
('FONTNAME', (0,0), (-1,0), 'STHeiti'),
|
||||
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, BG_MIN]),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 4),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 4),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 5),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 5),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
story.append(min_t)
|
||||
story.append(Spacer(1, 0.5*cm))
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 四、整改行动计划
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
story.append(section_header('四、整改行动计划(CAPA)'))
|
||||
story.append(Spacer(1, 0.15*cm))
|
||||
story.append(Paragraph(
|
||||
'以下行动计划以缺陷严重等级为优先序,明确责任部门/人及预估完成日期。'
|
||||
'所有整改措施须由 QA 部门完成审核后方可关闭。',
|
||||
S['body']))
|
||||
story.append(Spacer(1, 0.25*cm))
|
||||
|
||||
# ── 4.1 严重缺陷行动项 ────────────────────────────────────────────────────
|
||||
story.append(Paragraph('4.1 严重缺陷整改行动项(须立即启动)', S['subsection']))
|
||||
|
||||
action_header = [
|
||||
Paragraph('关联\n缺陷', S['cell_header']),
|
||||
Paragraph('行动项', S['cell_header']),
|
||||
Paragraph('具体措施', S['cell_header']),
|
||||
Paragraph('责任人', S['cell_header']),
|
||||
Paragraph('预估完成\n日期', S['cell_header']),
|
||||
]
|
||||
|
||||
crit_actions = [
|
||||
('C-01', 'A-01\n禁止事后\n补录并建立\n数据诚信\n管理制度',
|
||||
'① 即日起发布内部令:禁止任何形式的事后补录,违者追责\n'
|
||||
'② 制定《数据完整性管理程序》,涵盖原始记录、电子数据、审计追踪\n'
|
||||
'③ 所有批记录和辅助记录须当日填写,QA 每日抽查\n'
|
||||
'④ 对现有库存批记录完整性进行回顾,提出整改方案\n'
|
||||
'⑤ 开展全员数据诚信培训(1 次/月)',
|
||||
'毕海(QA)\n全员配合', '2026-05-01\n(①②即日起执行)'),
|
||||
('C-02', 'A-02\n建立 RI 活\n性检测能力\n并纳入质量\n标准',
|
||||
'① 立即协调研发部荧光仪,临时用于 RI 活性检测\n'
|
||||
'② 任宏杰负责制定 RI 活性效力测定方案,完成方法验证\n'
|
||||
'③ 采购/租赁正式 RI 活性检测设备(二袁负责对接采购)\n'
|
||||
'④ 将 RI 活性纳入原酶及成品质量标准,修订 QS 文件\n'
|
||||
'⑤ 对历史存档批次进行补充 RI 活性检测(留样检测)',
|
||||
'任宏杰(研发)\n二袁(采购)\n新 QA 负责人', '2026-07-15\n(设备临时方案\n2026-05-15)'),
|
||||
('C-03', 'A-03\n建立清洁\n验证体系',
|
||||
'① 梳理 100+ 品种的共线生产矩阵,按风险分级\n'
|
||||
'② 制定《清洁验证主计划》(CVP),明确残留限度计算方法(基于 HBEL/PDE)\n'
|
||||
'③ 优先完成高风险品种组合的棉签回收率验证和中转容器清洁验证\n'
|
||||
'④ 建立清洁验证记录模板及日常监控程序',
|
||||
'毕海(QA)\n新 QA 负责人\n生产部', '2026-08-31\n(CVP 文件\n2026-06-01)'),
|
||||
]
|
||||
|
||||
action_data = [action_header]
|
||||
for defect, action, measures, owner, date in crit_actions:
|
||||
action_data.append([
|
||||
Paragraph(f'<b>{defect}</b>', S['cell_crit']),
|
||||
Paragraph(action, S['cell_bold']),
|
||||
Paragraph(measures, S['cell']),
|
||||
Paragraph(owner, S['cell_bold']),
|
||||
Paragraph(date, S['cell_bold']),
|
||||
])
|
||||
ca_t = Table(action_data, colWidths=[1.5*cm, 2.2*cm, 8.3*cm, 2.5*cm, 3.0*cm])
|
||||
ca_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,0), RED_CRIT),
|
||||
('TEXTCOLOR', (0,0), (-1,0), WHITE),
|
||||
('FONTNAME', (0,0), (-1,0), 'STHeiti'),
|
||||
('ROWBACKGROUNDS', (0,1), (-1,-1), [BG_CRIT, WHITE]),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 4),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 4),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 5),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 5),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
story.append(ca_t)
|
||||
story.append(Spacer(1, 0.35*cm))
|
||||
|
||||
# ── 4.2 重大缺陷行动项 ────────────────────────────────────────────────────
|
||||
story.append(Paragraph('4.2 重大缺陷整改行动项', S['subsection']))
|
||||
|
||||
maj_actions = [
|
||||
('M-01\nM-02', 'A-04\n重建文件\n管理体系',
|
||||
'① 全面梳理现有文件,废止不可执行的模板,重新编写贴合公司实际的 SOP\n'
|
||||
'② 建立文件发放、接收、销毁的纸质/电子台账,保留完整签字痕迹\n'
|
||||
'③ 统一文件格式、纸张规格,消除低级错误\n'
|
||||
'④ 新 QA 负责人牵头,每季度开展文件适用性审查',
|
||||
'新 QA 负责人\n毕海', '2026-06-30'),
|
||||
('M-03', 'A-05\n建立偏差/\nOOS/OOT\n管理程序',
|
||||
'① 编写《偏差管理规程》《OOS 调查程序》《OOT 趋势分析程序》\n'
|
||||
'② 对历史生产数据进行回顾,识别并补充登记已发生的偏差/OOS\n'
|
||||
'③ 对 QA/QC 人员开展专项培训',
|
||||
'新 QA 负责人', '2026-06-15'),
|
||||
('M-04', 'A-06\n完善工艺\n验证报告',
|
||||
'① 补充工艺验证报告中关键工艺参数(KPP)、收率、内毒素去除效率数据\n'
|
||||
'② 制定固定纯化标准(收峰标准),与工艺规程保持一致\n'
|
||||
'③ 执行至少 3 批次连续工艺验证,确保批次间一致性',
|
||||
'任宏杰(研发)\n生产部\n新 QA 负责人', '2026-08-31'),
|
||||
('M-05', 'A-07\n启动稳定性\n研究',
|
||||
'① 制定《原酶稳定性研究方案》:检测项目简化为酶活性 + 内毒素,避免过度冗余\n'
|
||||
'② 参照 ICH Q1A 条件(2-8℃实时 + 25℃加速),启动长期稳定性研究\n'
|
||||
'③ 酶与 buffer 分开单独开展稳定性研究\n'
|
||||
'④ 稳定性数据支持质量标准中的效期和储存条件设定',
|
||||
'任宏杰(研发)\n新 QA 负责人', '2026-07-31\n(方案批准)\n2026-08-01\n(入样启动)'),
|
||||
('M-06', 'A-08\n更换 QA 负\n责人,优化\n质量团队',
|
||||
'① 即日起免除 QA 负责人左胜职务,由毕海临时代管 QA 事务\n'
|
||||
'② 毕海组织面试不少于 20 名 QA 候选人(林毅/董方辅助推荐)\n'
|
||||
'③ 优先从具备酶行业知识的研发骨干中培养,要求懂酶 + 懂法规\n'
|
||||
'④ 确定新 QA 负责人后,明确其职责边界(对接客户、向研发/生产提需求)\n'
|
||||
'⑤ 加强 QA/QC 人员的持续培训与考核机制',
|
||||
'毕海(牵头)\n任宏杰(配合)', '面试启动:即日\n2026-06-01\n(到岗目标)'),
|
||||
('M-07', 'A-09\n补齐关键\n设备',
|
||||
'① 二袁对接采购:灭菌锅、干燥箱、砝码、设备标识\n'
|
||||
'② 研发部荧光仪优先调配至生产端用于 RI 活性检测\n'
|
||||
'③ 所有设备需完成校准/验证后方可投入使用',
|
||||
'二袁(采购)\n任宏杰(设备调配)', '2026-05-31'),
|
||||
('M-08', 'A-10\n酶与 buffer\n分离管理',
|
||||
'① 将酶与 buffer 分开存储、分开建立质量标准\n'
|
||||
'② 分别开展稳定性研究(纳入 A-07 统筹)\n'
|
||||
'③ 修订相关 SOP 和批记录模板',
|
||||
'新 QA 负责人\n生产部', '2026-06-30'),
|
||||
]
|
||||
|
||||
ma_header = [
|
||||
Paragraph('关联\n缺陷', S['cell_header']),
|
||||
Paragraph('行动项', S['cell_header']),
|
||||
Paragraph('具体措施', S['cell_header']),
|
||||
Paragraph('责任人', S['cell_header']),
|
||||
Paragraph('预估完成\n日期', S['cell_header']),
|
||||
]
|
||||
ma_data = [ma_header]
|
||||
for defect, action, measures, owner, date in maj_actions:
|
||||
ma_data.append([
|
||||
Paragraph(f'<b>{defect}</b>', S['cell_maj']),
|
||||
Paragraph(action, S['cell_bold']),
|
||||
Paragraph(measures, S['cell']),
|
||||
Paragraph(owner, S['cell_bold']),
|
||||
Paragraph(date, S['cell_bold']),
|
||||
])
|
||||
ma_t = Table(ma_data, colWidths=[1.5*cm, 2.2*cm, 8.3*cm, 2.5*cm, 3.0*cm])
|
||||
ma_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,0), ORANGE_MAJ),
|
||||
('TEXTCOLOR', (0,0), (-1,0), WHITE),
|
||||
('FONTNAME', (0,0), (-1,0), 'STHeiti'),
|
||||
('ROWBACKGROUNDS', (0,1), (-1,-1), [BG_MAJ, WHITE]),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 4),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 4),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 5),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 5),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
story.append(ma_t)
|
||||
story.append(Spacer(1, 0.35*cm))
|
||||
|
||||
# ── 4.3 一般缺陷行动项 ────────────────────────────────────────────────────
|
||||
story.append(Paragraph('4.3 一般缺陷整改行动项', S['subsection']))
|
||||
|
||||
min_actions = [
|
||||
('N-01', 'A-11\n现场卫生\n整改',
|
||||
'① 即日安排人员清理下水管道锈蚀,必要时更换管道\n② 建立日常现场卫生检查制度(每日巡检记录)',
|
||||
'生产部\n毕海(督导)', '2026-05-15'),
|
||||
('N-02', 'A-12\n消除文件\n低级错误',
|
||||
'① 系统排查现有文件中的替换页、纸张颜色不一致问题,统一重印\n② 制定文件印制和替换标准操作程序',
|
||||
'新 QA 负责人', '2026-06-30'),
|
||||
('N-03', 'A-13\n完善批记\n录数据项',
|
||||
'① 修订批记录模板,新增计算过程记录栏\n② 对现有操作人员开展批记录填写规范培训',
|
||||
'新 QA 负责人\n生产部', '2026-06-30'),
|
||||
]
|
||||
|
||||
mi_header = [
|
||||
Paragraph('关联\n缺陷', S['cell_header']),
|
||||
Paragraph('行动项', S['cell_header']),
|
||||
Paragraph('具体措施', S['cell_header']),
|
||||
Paragraph('责任人', S['cell_header']),
|
||||
Paragraph('预估完成\n日期', S['cell_header']),
|
||||
]
|
||||
mi_data = [mi_header]
|
||||
for defect, action, measures, owner, date in min_actions:
|
||||
mi_data.append([
|
||||
Paragraph(f'<b>{defect}</b>', S['cell_min']),
|
||||
Paragraph(action, S['cell_bold']),
|
||||
Paragraph(measures, S['cell']),
|
||||
Paragraph(owner, S['cell_bold']),
|
||||
Paragraph(date, S['cell_bold']),
|
||||
])
|
||||
mi_t = Table(mi_data, colWidths=[1.5*cm, 2.2*cm, 8.3*cm, 2.5*cm, 3.0*cm])
|
||||
mi_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#9B7D11')),
|
||||
('TEXTCOLOR', (0,0), (-1,0), WHITE),
|
||||
('FONTNAME', (0,0), (-1,0), 'STHeiti'),
|
||||
('ROWBACKGROUNDS', (0,1), (-1,-1), [BG_MIN, WHITE]),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 4),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 4),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 5),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 5),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
story.append(mi_t)
|
||||
story.append(Spacer(1, 0.5*cm))
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 五、整改里程碑时间轴汇总
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
story.append(section_header('五、整改里程碑时间轴汇总'))
|
||||
story.append(Spacer(1, 0.2*cm))
|
||||
|
||||
timeline_header = [
|
||||
Paragraph('里程碑节点', S['cell_header']),
|
||||
Paragraph('主要行动项', S['cell_header']),
|
||||
Paragraph('责任人', S['cell_header']),
|
||||
Paragraph('目标日期', S['cell_header']),
|
||||
]
|
||||
timeline_data = [timeline_header,
|
||||
[Paragraph('★ 立即启动\n(≤ 1 周)', S['cell_crit']),
|
||||
Paragraph('A-01 发布数据诚信禁令;A-08 免除左胜职务、毕海代管QA;A-09 研发设备调配至生产;A-11 现场清洁启动', S['cell']),
|
||||
Paragraph('毕海、任宏杰、二袁', S['cell_bold']),
|
||||
Paragraph('2026-04-22', S['cell_bold'])],
|
||||
[Paragraph('第一阶段\n(1个月内)', S['cell_crit']),
|
||||
Paragraph('A-01 数据诚信制度落地;A-08 启动QA招聘(面试≥20人);A-09 设备采购启动;A-11 现场卫生完成', S['cell']),
|
||||
Paragraph('毕海(主)\n二袁(采购)', S['cell_bold']),
|
||||
Paragraph('2026-05-15', S['cell_bold'])],
|
||||
[Paragraph('第二阶段\n(2个月内)', S['cell_maj']),
|
||||
Paragraph('A-02 RI临时检测方案上线;A-05 偏差/OOS/OOT程序建立;A-08 新QA负责人到岗;A-03 清洁验证主计划发布', S['cell']),
|
||||
Paragraph('新QA负责人\n任宏杰', S['cell_bold']),
|
||||
Paragraph('2026-06-15', S['cell_bold'])],
|
||||
[Paragraph('第三阶段\n(3个月内)', S['cell_maj']),
|
||||
Paragraph('A-04 文件体系重建完成;A-06 工艺验证报告补充完成;A-07 稳定性研究入样启动;A-10 酶/buffer分离管理完成;A-12/13 批记录规范化', S['cell']),
|
||||
Paragraph('新QA负责人\n任宏杰\n生产部', S['cell_bold']),
|
||||
Paragraph('2026-06-30', S['cell_bold'])],
|
||||
[Paragraph('第四阶段\n(4~5个月内)', S['cell_maj']),
|
||||
Paragraph('A-02 RI活性正式纳入质量标准并完成方法验证;A-06 3批次工艺验证完成;A-09 正式设备到位并完成验证', S['cell']),
|
||||
Paragraph('任宏杰\n新QA负责人', S['cell_bold']),
|
||||
Paragraph('2026-07-31', S['cell_bold'])],
|
||||
[Paragraph('第五阶段\n(≤6个月)', S['cell_bold']),
|
||||
Paragraph('A-03 清洁验证关键品种完成;A-02 RI活性检测体系完全建立;准备接受申基/客户复查审计', S['cell']),
|
||||
Paragraph('毕海\n新QA负责人\n全员', S['cell_bold']),
|
||||
Paragraph('2026-08-31', S['cell_bold'])],
|
||||
]
|
||||
tl_t = Table(timeline_data, colWidths=[2.8*cm, 9.2*cm, 2.8*cm, 2.7*cm])
|
||||
tl_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
|
||||
('TEXTCOLOR', (0,0), (-1,0), WHITE),
|
||||
('FONTNAME', (0,0), (-1,0), 'STHeiti'),
|
||||
('ROWBACKGROUNDS', (0,1), (-1,-1), [BG_CRIT, BG_CRIT, BG_MAJ, BG_MAJ, BG_MAJ, LIGHT_BLUE]),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 5),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 5),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 6),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 6),
|
||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
||||
]))
|
||||
story.append(tl_t)
|
||||
story.append(Spacer(1, 0.5*cm))
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 六、决议与签字
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
story.append(section_header('六、会议决议与签署'))
|
||||
story.append(Spacer(1, 0.2*cm))
|
||||
|
||||
decisions = [
|
||||
'本次会议就申基供应商审计发现的全部问题达成整改共识,与会人员承诺按照上述行动计划推进落实。',
|
||||
'4000 万元订单执行不受本次审计直接影响,各方共担下游药企提考连带责任,应以主人翁心态推进整改。',
|
||||
'整改优先级排序:RI 活性检测体系建立 → 数据诚信管理 → 清洁验证 → QA 人员优化 → 文件体系重建 → 稳定性研究。',
|
||||
'所有整改措施的完成情况须由新任 QA 负责人进行验证和记录,整改完成后须准备向申基/客户提交整改报告并接受复查审计。',
|
||||
'毕海为本次整改的首要协调人,任宏杰负责研发端支持,二袁负责客户沟通与采购事务。',
|
||||
]
|
||||
for i, d in enumerate(decisions, 1):
|
||||
story.append(Paragraph(f'{i}. {d}', S['body']))
|
||||
story.append(Spacer(1, 0.5*cm))
|
||||
|
||||
sign_data = [
|
||||
[Paragraph('主持人', S['cell_bold']),
|
||||
Paragraph('任宏杰 签名:_______________', S['cell']),
|
||||
Paragraph('日期:_____________', S['cell'])],
|
||||
[Paragraph('质量代表', S['cell_bold']),
|
||||
Paragraph('毕海 签名:_______________', S['cell']),
|
||||
Paragraph('日期:_____________', S['cell'])],
|
||||
[Paragraph('商务/对外', S['cell_bold']),
|
||||
Paragraph('二袁 签名:_______________', S['cell']),
|
||||
Paragraph('日期:_____________', S['cell'])],
|
||||
[Paragraph('参会确认', S['cell_bold']),
|
||||
Paragraph('说话人 C 签名:_______________', S['cell']),
|
||||
Paragraph('日期:_____________', S['cell'])],
|
||||
[Paragraph('参会确认', S['cell_bold']),
|
||||
Paragraph('说话人 E 签名:_______________', S['cell']),
|
||||
Paragraph('日期:_____________', S['cell'])],
|
||||
]
|
||||
sign_t = Table(sign_data, colWidths=[2.8*cm, 9*cm, 5.7*cm])
|
||||
sign_t.setStyle(TableStyle([
|
||||
('BACKGROUND', (0,0), (0,-1), BG_HEAD),
|
||||
('GRID', (0,0), (-1,-1), 0.4, GRAY_LINE),
|
||||
('TOPPADDING', (0,0), (-1,-1), 8),
|
||||
('BOTTOMPADDING', (0,0), (-1,-1), 8),
|
||||
('LEFTPADDING', (0,0), (-1,-1), 6),
|
||||
('RIGHTPADDING', (0,0), (-1,-1), 6),
|
||||
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
|
||||
]))
|
||||
story.append(sign_t)
|
||||
story.append(Spacer(1, 0.4*cm))
|
||||
|
||||
# ── 页脚说明 ──────────────────────────────────────────────────────────────
|
||||
story.append(HRFlowable(width=W, thickness=0.5, color=GRAY_LINE))
|
||||
story.append(Spacer(1, 0.1*cm))
|
||||
story.append(Paragraph(
|
||||
'本文件为愚公生物科技有限公司(百时美)内部保密文件,未经授权不得对外披露。\n'
|
||||
'文件编号:YG-QA-MOM-2026-001 版本:V1.0 生效日期:2026-04-15 制定部门:质量管理部',
|
||||
S['footer']))
|
||||
|
||||
doc.build(story)
|
||||
print(f'PDF generated: {output_path}')
|
||||
|
||||
if __name__ == '__main__':
|
||||
output = '/Users/tankai/Documents/Projects/deep_research/愚公生物_申基审计整改会议纪要_2026-04-10.pdf'
|
||||
build_pdf(output)
|
||||
@@ -0,0 +1,23 @@
|
||||
# Antigravity Environment
|
||||
|
||||
Open this directory in Antigravity.
|
||||
|
||||
Antigravity is the only platform in this project that should run Deep Research natively with platform model quota. Use Gemini 3 Flash only as the surface manager, then switch models by phase as instructed in `.agent/workflows/deep-research-native.md`.
|
||||
|
||||
Start by loading:
|
||||
|
||||
- `AGENTS.md`
|
||||
- `GEMINI.md`
|
||||
- `.agent/agents.md`
|
||||
- `.agent/rules/deep-research-antigravity.md`
|
||||
- `.agent/skills/antigravity-surface-adapter/SKILL.md`
|
||||
- `.agent/skills/method-selection/SKILL.md`
|
||||
- `.agent/skills/research-quality-gates/SKILL.md`
|
||||
- `.agent/workflows/deep-research-native.md`
|
||||
|
||||
Do not open the parent repository for production research. Rebuild this environment from the parent repository with:
|
||||
|
||||
```bash
|
||||
./setup.sh init antigravity
|
||||
./setup.sh update antigravity
|
||||
```
|
||||
@@ -0,0 +1,88 @@
|
||||
# Deep Research Agent Team
|
||||
|
||||
This file defines Antigravity roles only. Put persistent constraints in `.agents/rules/`, reusable capabilities in `.agents/skills/`, and phase sequencing in `.agents/workflows/`.
|
||||
|
||||
## Research Manager
|
||||
|
||||
Primary model: Gemini 3 Flash.
|
||||
|
||||
Purpose:
|
||||
|
||||
- Manage the task list, phase transitions, model switches, and approval gates.
|
||||
- Load the relevant rules, skills, and workflow.
|
||||
- Keep all artifacts under `projects/<slug>/`.
|
||||
|
||||
Must not:
|
||||
|
||||
- Perform deep reasoning that belongs to a phase specialist.
|
||||
- Claim that search or verification happened without receipts.
|
||||
- Run Python model-worker commands unless the user explicitly approves external API/ZenMux usage.
|
||||
|
||||
## Phase 0-1 Strategist
|
||||
|
||||
Primary model: Claude Opus 4.6 (Thinking).
|
||||
|
||||
Purpose:
|
||||
|
||||
- Interpret materials, audience, and decision purpose.
|
||||
- Select the most appropriate research method or method mix.
|
||||
- Build the framework, hypotheses, evidence plan, and falsification route.
|
||||
|
||||
Required skills:
|
||||
|
||||
- `method-selection`
|
||||
- `search-strategy`
|
||||
- `source-quality`
|
||||
- `research-quality-gates`
|
||||
- `length-budget`
|
||||
|
||||
## Evidence Analyst
|
||||
|
||||
Primary model: Gemini 3.1 Pro (Low).
|
||||
|
||||
Purpose:
|
||||
|
||||
- Execute task-card research.
|
||||
- Maintain search logs and source ledgers.
|
||||
- Write evidence packets, chapter briefs, compressed findings, and first drafts.
|
||||
|
||||
Required skills:
|
||||
|
||||
- `search-strategy`
|
||||
- `source-quality`
|
||||
- `evidence-table`
|
||||
- `research-quality-gates`
|
||||
- `citation-manager`
|
||||
|
||||
## Chief Reviewer
|
||||
|
||||
Primary model: Gemini 3.1 Pro (High).
|
||||
|
||||
Purpose:
|
||||
|
||||
- Audit method fit, logic, structure, evidence quality, counter-evidence, and unsupported claims.
|
||||
- Produce a clear go / rework / fail decision.
|
||||
|
||||
Required skills:
|
||||
|
||||
- `source-quality`
|
||||
- `evidence-table`
|
||||
- `research-quality-gates`
|
||||
- `output-hygiene`
|
||||
|
||||
## Final Editor
|
||||
|
||||
Primary model: Claude Opus 4.6 (Thinking).
|
||||
|
||||
Purpose:
|
||||
|
||||
- Produce the final Chinese report from approved drafts and verified sources.
|
||||
- Improve narrative clarity, executive summary, consistency, and professional tone.
|
||||
- Preserve source traceability and downgrade unsupported claims.
|
||||
|
||||
Required skills:
|
||||
|
||||
- `citation-manager`
|
||||
- `research-quality-gates`
|
||||
- `humanizer-cn`
|
||||
- `output-hygiene`
|
||||
@@ -0,0 +1,36 @@
|
||||
# Deep Research Antigravity Rule
|
||||
|
||||
When operating this repository from Google Antigravity, use Antigravity as the primary Deep Research executor and use the repository as the method, artifact, and validation framework.
|
||||
|
||||
## Non-Negotiables
|
||||
|
||||
- Use Antigravity's model quota for main research work.
|
||||
- Do not default to Python core model-worker commands such as `run`, `research --execute-packets`, or `research --assemble-chapters`, because they may route work through ZenMux/API credits.
|
||||
- It is acceptable to write phase artifacts directly in Antigravity when following the project skills and evidence schema.
|
||||
- Use `.agents/skills/antigravity-surface-adapter/SKILL.md` whenever the user asks for Antigravity usage, phase execution, model planning, or quota planning.
|
||||
- Keep all research outputs under `projects/<slug>/`.
|
||||
- Use Python scripts only for scaffolding, deterministic checks, citation/report rendering, status, and local material processing unless the user explicitly approves external model/API usage.
|
||||
|
||||
## Anti-Hallucination Contract
|
||||
|
||||
- No tool receipt, no search claim. The agent may not write that it has searched, checked, verified, or confirmed anything unless a search/browser/terminal/MCP tool call actually happened and the result is logged.
|
||||
- No source ID, no factual claim. Every concrete fact in drafts must map to a `source_id` in `sources.jsonl` and a row in `claims_ledger.jsonl`, or be visibly marked as unverified.
|
||||
- No snippet laundering. Search result snippets, AI summaries, and memory are only leads; they cannot support final claims.
|
||||
- Failed access must be explicit. If a page, PDF, registry, patent, or filing cannot be opened, mark it as inaccessible and do not quote exact values from it.
|
||||
- Each phase must maintain `phaseX/search_log.md` or `phaseX/search_log.jsonl`.
|
||||
- Each evidence packet must include `search_receipts`, `sources`, `evidence_spans`, `counter_evidence`, and `unsupported_claims`.
|
||||
- Phase 2 must maintain `claims_ledger.jsonl`, `coverage_matrix.md`, and `rejected_sources.jsonl`.
|
||||
- Before resuming or handing off work, update `continuation_state.json`.
|
||||
- When evidence is thin, write "该观点证据不足,待进一步验证" rather than smoothing over the gap.
|
||||
|
||||
## Quota Discipline
|
||||
|
||||
- Surface manager: Gemini 3 Flash.
|
||||
- Phase 0-1: Claude Opus 4.6 (Thinking).
|
||||
- Phase 2: Gemini 3.1 Pro (Low).
|
||||
- Phase 3: Gemini 3.1 Pro (High), with fallback to another model only if quality is inadequate.
|
||||
- Phase 4: Claude Opus 4.6 (Thinking).
|
||||
|
||||
## Pause Points
|
||||
|
||||
Pause after Phase 1 and Phase 3. Ask the user to confirm the framework or critique decision before moving to the next major phase.
|
||||
@@ -0,0 +1,148 @@
|
||||
---
|
||||
name: antigravity-surface-adapter
|
||||
description: Guides Google Antigravity to run Deep Research natively with Antigravity model quotas, while using this repository's skills, source standards, artifacts, and optional Python utilities for validation/rendering.
|
||||
---
|
||||
|
||||
# Antigravity Deep Research Adapter
|
||||
|
||||
Use this skill when the user asks to run, plan, review, or finalize a Deep Research project from Google Antigravity.
|
||||
|
||||
## Core Rule
|
||||
|
||||
Antigravity is the research operator. Use Antigravity's own model selector and task execution to perform the research phases. Python core is an auxiliary toolbox for project scaffolding, deterministic checks, citation/report rendering, and status inspection; do not let it silently route the main research through ZenMux unless the user explicitly asks.
|
||||
|
||||
The Deep Research method still comes from this repo:
|
||||
|
||||
- Follow `AGENTS.md` for evidence, source tiers, word budgets, pause points, and output hygiene.
|
||||
- Load project skills from `.agents/skills/*` as needed.
|
||||
- Write all artifacts under `projects/<slug>/`.
|
||||
- Keep claims traceable through search receipts, source IDs, and `claims_ledger.jsonl`.
|
||||
|
||||
## Anti-Hallucination Contract
|
||||
|
||||
This project treats Gemini-family research as high risk for false confidence. Follow these rules mechanically:
|
||||
|
||||
1. No tool receipt, no search claim. Do not write "I searched", "confirmed", "official data shows", or similar unless the tool call happened and is recorded.
|
||||
2. No source ID, no factual claim. Every concrete fact needs a `source_id` and claim-ledger entry.
|
||||
3. Search snippets are leads, not evidence. Open the original paper, filing, registry, patent, guideline, or company disclosure before citing.
|
||||
4. Failed access is a finding. Write that the source could not be opened; do not infer exact numbers from inaccessible pages.
|
||||
5. Log all searches in `phaseX/search_log.md` or `phaseX/search_log.jsonl`.
|
||||
6. Keep an `unsupported_claims` list. It is better to expose uncertainty than to make the report look complete.
|
||||
7. Keep `continuation_state.json` current so a resumed Antigravity session can continue from artifacts, not chat memory.
|
||||
8. Before finishing each phase, sample at least 10 factual claims and verify that each has a source ID, opened source, evidence locator, and claim-ledger record.
|
||||
|
||||
## Antigravity Model Plan
|
||||
|
||||
Roles are defined in `.agents/agents.md`. This skill only maps phase work to models:
|
||||
|
||||
| Phase | Model | Purpose |
|
||||
|---|---|
|
||||
| Surface management | Gemini 3 Flash | Read skills, maintain task list, move phase by phase, run light shell commands, collect artifacts. |
|
||||
| Phase 0-1 | Claude Opus 4.6 (Thinking) | Material interpretation, strategic framing, research method choice, bold hypotheses, chapter architecture. |
|
||||
| Phase 2 | Gemini 3.1 Pro (Low) | Evidence collection, chapter research packets, first-pass chapter drafts. |
|
||||
| Phase 3 | Gemini 3.1 Pro (High) | Independent critique, counter-evidence review, logic and evidence gap analysis. |
|
||||
| Phase 4 | Claude Opus 4.6 (Thinking) | Final Chinese editorial integration, executive summary, wording quality, final consistency pass. |
|
||||
|
||||
Gemini 3 Flash should remain the phase manager. It can ask the user to switch to the phase model before heavy thinking, then resume management after the phase artifact is written.
|
||||
|
||||
## Python Core Boundary
|
||||
|
||||
Use Python core only when it helps without taking over the research model budget:
|
||||
|
||||
- Good: scaffold folders, parse local materials, validate sources/citations, render PDF/DOCX, show status.
|
||||
- Risky: `research --execute-packets`, `run`, or any command that calls model workers through `configs/models.yaml`.
|
||||
- If a command would call model workers, ask the user first and state that it may use ZenMux/API credits instead of Antigravity quota.
|
||||
|
||||
Safe utility examples:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py init "研究主题" --slug <slug> --method <method>
|
||||
uv run python scripts/dr.py status <slug>
|
||||
uv run python scripts/dr.py skills validate
|
||||
uv run python scripts/dr.py finalize <slug> --no-pdf --no-docx
|
||||
```
|
||||
|
||||
## Native Runbook
|
||||
|
||||
1. Open the repository root in Antigravity.
|
||||
2. Start with Gemini 3 Flash as Research Manager. Load `.agents/agents.md`, this skill, `AGENTS.md`, `method-selection`, `search-strategy`, `source-quality`, `evidence-table`, `research-quality-gates`, `citation-manager`, `length-budget`, and `output-hygiene`.
|
||||
3. Create or confirm `projects/<slug>/` and the phase folders. Use Python `init` only for scaffolding if helpful.
|
||||
4. Phase 0-1: ask the user to switch to Claude Opus 4.6 (Thinking). Produce:
|
||||
|
||||
- `phase1/material_brief.md`
|
||||
- `phase1/framework.md`
|
||||
- `phase1/method_decision.md`
|
||||
- `phase1/research_brief.md`
|
||||
- `phase1/research_brief.json`
|
||||
- `phase1/search_log.md`
|
||||
- `phase1/assumptions.md`
|
||||
- `phase1/unsupported_claims.md`
|
||||
|
||||
5. Pause for user confirmation.
|
||||
6. Phase 2: ask the user to switch to Gemini 3.1 Pro (Low). Build evidence packets and chapter drafts without Python model workers:
|
||||
|
||||
- `phase2/task_cards.json`
|
||||
- `phase2/search_log.jsonl`
|
||||
- `phase2/sources.jsonl`
|
||||
- `phase2/rejected_sources.jsonl`
|
||||
- `phase2/claims_ledger.jsonl`
|
||||
- `phase2/coverage_matrix.md`
|
||||
- `phase2/packets/*.json`
|
||||
- `phase2/chapter_briefs/*.json`
|
||||
- `phase2/compressed_findings/*.json`
|
||||
- `phase2/drafts/chXX.md`
|
||||
- `phase2/unsupported_claims.md`
|
||||
|
||||
If a claim lacks support, use delta retrieval: write the gap, run targeted searches, update sources and the claim ledger, then either verify or visibly caveat the claim.
|
||||
|
||||
7. Phase 3: ask the user to switch to Gemini 3.1 Pro (High). Produce `phase3/critique.md`, with explicit go/rework/fail decision, claim-ledger audit, contradiction audit, and a source-audit table for at least 10 core facts.
|
||||
8. Pause for user decision.
|
||||
9. Phase 4: ask the user to switch to Claude Opus 4.6 (Thinking). Produce `phase4/final_zh.md`, `phase4/editorial_notes.md`, and `phase4/final_fact_check.md`. New facts require new receipts and claim-ledger rows. Use deterministic renderers afterward for PDF/DOCX.
|
||||
|
||||
## Search Strategy
|
||||
|
||||
If the `search` CLI from `paperfoot/search-cli` is installed, prefer it as the Antigravity-native search front door:
|
||||
|
||||
```bash
|
||||
search agent-info
|
||||
search search -q "CRISPR clinical trial 2025" -m academic --json
|
||||
search search -q "BRCA1 gene patent" -m patents --json
|
||||
search search -q "FDA warning letter CAPA pharmaceutical" -m general --json
|
||||
search search -q "biotech market update 2026" -m news --json
|
||||
```
|
||||
|
||||
Useful modes for this repo: `academic`, `scholar`, `patents`, `news`, `deep`, `extract`, `similar`, and `general`.
|
||||
|
||||
Do not treat synthesized search answers as evidence. Every important claim still needs source IDs, tier rating, source score, and preferably original PDFs/pages or official records.
|
||||
|
||||
If `search` is not installed, use the existing project search tools or Antigravity browser, but keep the same source-tier discipline.
|
||||
|
||||
## Suggested Antigravity Permissions
|
||||
|
||||
Within this workspace, the user may allow:
|
||||
|
||||
- `read_file(<workspace>)`
|
||||
- `write_file(<workspace>)`
|
||||
- `command(uv run python scripts/)`
|
||||
- `command(search)`
|
||||
- `command(pandoc)`
|
||||
|
||||
Keep these as Ask/Deny unless the user explicitly allows them:
|
||||
|
||||
- writes outside the workspace
|
||||
- global Antigravity/Gemini settings
|
||||
- destructive git commands
|
||||
- reading `secrets.env`
|
||||
- broad downloads or package installs
|
||||
|
||||
## What To Report Back
|
||||
|
||||
Always report concrete artifact paths:
|
||||
|
||||
- `projects/<slug>/phase1/research_brief.md`
|
||||
- `projects/<slug>/phase2/task_cards.json`
|
||||
- `projects/<slug>/phase2/packet_errors/` if present
|
||||
- `projects/<slug>/phase3/critique.md`
|
||||
- `projects/<slug>/phase4/*.pdf` and `*.docx`
|
||||
|
||||
If a phase fails, report the failing artifact and the rework plan. Do not hide model switches, quota-sensitive steps, or missing evidence.
|
||||
@@ -0,0 +1,166 @@
|
||||
---
|
||||
name: citation-manager
|
||||
description: 引用管理规范。规定 [src_xxx] 编号体系、sources.jsonl 字段标准、跨章节去重规则、参考文献列表生成格式(GB/T 7714)。
|
||||
---
|
||||
|
||||
# 引用管理规范
|
||||
|
||||
## 一、src_id 编号规则
|
||||
|
||||
### 全局唯一编号
|
||||
|
||||
`src_id` 在整个项目内**全局唯一**,格式:`src_XXX`(3 位数字,不足补零)。
|
||||
|
||||
- 由 dr-analyst 在首次引用时分配
|
||||
- 按发现顺序递增:`src_001`, `src_002`, ...
|
||||
- 跨章节引用同一来源时,使用**相同 ID**
|
||||
|
||||
### 分配流程
|
||||
|
||||
1. dr-analyst 发现一条新信源
|
||||
2. 读取 `projects/<slug>/phase2/sources.jsonl`,找当前最大 ID
|
||||
3. 分配下一个 ID(如当前最大为 `src_023`,下一个为 `src_024`)
|
||||
4. 写入 sources.jsonl
|
||||
|
||||
### 草稿中的引用格式
|
||||
|
||||
行内引用:`数据或观点 [src_042]`
|
||||
|
||||
多来源:`数据或观点 [src_042][src_058]`
|
||||
|
||||
---
|
||||
|
||||
## 二、sources.jsonl 字段标准
|
||||
|
||||
每行一个 JSON 对象(JSONL 格式):
|
||||
|
||||
```jsonl
|
||||
{
|
||||
"id": "src_001",
|
||||
"tier": 1,
|
||||
"score": 8.5,
|
||||
"type": "journal",
|
||||
"title": "论文标题",
|
||||
"authors": ["Zhang S", "Li M"],
|
||||
"year": 2024,
|
||||
"venue": "Nature Medicine",
|
||||
"impact_factor": 58.7,
|
||||
"url": "https://doi.org/10.1038/...",
|
||||
"doi": "10.1038/...",
|
||||
"accessed_at": "2026-04-20",
|
||||
"abstract": "2-3句摘要",
|
||||
"key_data": {
|
||||
"sample_size": 1200,
|
||||
"primary_endpoint": "OS 改善 23%"
|
||||
},
|
||||
"used_in": ["ch02", "ch05.sec3"],
|
||||
"conflict_of_interest": null,
|
||||
"notes": "RCT 主要终点数据在 Table 2"
|
||||
}
|
||||
```
|
||||
|
||||
### type 字段枚举值
|
||||
|
||||
| 值 | 含义 |
|
||||
|---|---|
|
||||
| `journal` | 期刊论文(含综述) |
|
||||
| `trial` | 临床试验(ClinicalTrials.gov 注册信息) |
|
||||
| `regulatory` | 监管机构公告/审批文件 |
|
||||
| `patent` | 专利文件 |
|
||||
| `report` | 咨询/行业报告 |
|
||||
| `disclosure` | 上市公司披露(年报/招股书/SEC)|
|
||||
| `preprint` | 预印本(bioRxiv/medRxiv)|
|
||||
| `news` | 专业媒体报道(Tier 3 用) |
|
||||
|
||||
### 必填字段
|
||||
|
||||
`id`, `tier`, `score`, `type`, `title`, `year`, `url`(或 `doi`)
|
||||
|
||||
---
|
||||
|
||||
## 三、去重规则
|
||||
|
||||
dr-pm 在 Phase 2 结束时执行去重:
|
||||
|
||||
```python
|
||||
# 伪代码
|
||||
seen_urls = {}
|
||||
seen_dois = {}
|
||||
unique_sources = []
|
||||
|
||||
for source in all_sources:
|
||||
key = source.get("doi") or source.get("url")
|
||||
if key not in seen_urls:
|
||||
seen_urls[key] = True
|
||||
unique_sources.append(source)
|
||||
else:
|
||||
# 合并 used_in 字段
|
||||
existing = seen_urls[key]
|
||||
existing["used_in"] = list(set(existing["used_in"] + source["used_in"]))
|
||||
```
|
||||
|
||||
去重后,草稿文件里的 [src_xxx] 标注**不需要更改**,因为 ID 是全局分配的。
|
||||
|
||||
---
|
||||
|
||||
## 四、参考文献列表生成(GB/T 7714-2015)
|
||||
|
||||
dr-reporter 从 sources.jsonl 生成参考文献列表时,按以下格式:
|
||||
|
||||
### 期刊论文
|
||||
```
|
||||
[src_001] ZHANG S, LI M. 论文标题[J]. Nature Medicine, 2024, 30(5): 1234-1245. DOI: 10.1038/...
|
||||
```
|
||||
|
||||
### 报告/白皮书
|
||||
```
|
||||
[src_042] McKinsey & Company. 报告标题[R]. McKinsey Global Institute, 2024.
|
||||
```
|
||||
|
||||
### 监管文件
|
||||
```
|
||||
[src_018] FDA. NDA 申请审批公告[EB/OL]. (2024-03-15)[2026-04-20]. https://www.fda.gov/...
|
||||
```
|
||||
|
||||
### 临床试验
|
||||
```
|
||||
[src_055] ClinicalTrials.gov. 试验名称 (NCT12345678)[EB/OL]. (2023-01-01)[2026-04-20]. https://clinicaltrials.gov/...
|
||||
```
|
||||
|
||||
### 专利
|
||||
```
|
||||
[src_067] 发明人. 专利名称[P]. 专利号, 申请日.
|
||||
```
|
||||
|
||||
### 排序规则
|
||||
|
||||
参考文献按在正文中**首次出现的顺序**排列,即 [src_001] 在最前,以此类推。
|
||||
|
||||
---
|
||||
|
||||
## 五、引用完整性检查(dr-chief-editor 用)
|
||||
|
||||
审校时检查:
|
||||
1. 正文中所有 [src_xxx] 都在 sources.jsonl 里有对应记录
|
||||
2. sources.jsonl 里所有 ID 在正文中都有引用(无孤立信源)
|
||||
3. 所有 Tier 1 信源的 URL 或 DOI 格式正确
|
||||
|
||||
检查脚本(可用 bash 执行):
|
||||
```bash
|
||||
# 提取正文中的所有 src_id
|
||||
grep -oE 'src_[0-9]+' projects/<slug>/phase4/final.md | sort -u > /tmp/cited.txt
|
||||
|
||||
# 提取 sources.jsonl 中的所有 id
|
||||
python3 -c "
|
||||
import json
|
||||
ids = []
|
||||
with open('projects/<slug>/phase2/sources.jsonl') as f:
|
||||
for line in f:
|
||||
d = json.loads(line)
|
||||
ids.append(d['id'])
|
||||
print('\n'.join(sorted(ids)))
|
||||
" > /tmp/registered.txt
|
||||
|
||||
# 找差集
|
||||
diff /tmp/cited.txt /tmp/registered.txt
|
||||
```
|
||||
@@ -0,0 +1,267 @@
|
||||
---
|
||||
name: en-zh-translation
|
||||
description: 生物医药英译中规范。专有名词双语对照策略、术语表管理、断句重构原则、数字与标点转换、去翻译腔。dr-translator 必读。
|
||||
---
|
||||
|
||||
# 英译中规范(生物医药专业报告)
|
||||
|
||||
## 你的身份
|
||||
|
||||
你是生物医药专业报告的翻译编辑,不是机器翻译。目标:译文读起来**像母语中文写作者的原创**,不是"翻译腔"。
|
||||
|
||||
---
|
||||
|
||||
## 一、整体原则
|
||||
|
||||
### 1. 忠实于内容,不忠实于句式
|
||||
|
||||
英文长句拆成中文短句。英文习惯的 "X, which is Y, was Z" 嵌套结构,中文应断为两到三句。
|
||||
|
||||
**反例(翻译腔)**:
|
||||
> 这种药物,它是 GLP-1 受体激动剂家族中的一员,被证明在降低 HbA1c 方面是有效的。
|
||||
|
||||
**改写**:
|
||||
> 这种药物属于 GLP-1 受体激动剂家族,能有效降低 HbA1c。
|
||||
|
||||
### 2. 不保留英文的被动语态
|
||||
|
||||
英文被动 → 中文主动(或不提主语)。
|
||||
|
||||
- "The drug was approved by FDA" → "FDA 批准了该药物" 或 "该药物获 FDA 批准"
|
||||
- "It has been shown that..." → 直接说"研究显示..."或"数据显示..."
|
||||
|
||||
### 3. 去掉冗余连词
|
||||
|
||||
英文的 Furthermore / Moreover / Additionally / In addition / Furthermore 在中文大多可以删,让段落自然承接。
|
||||
|
||||
---
|
||||
|
||||
## 二、专有名词双语对照策略
|
||||
|
||||
### 首次出现原则
|
||||
|
||||
专有名词**首次出现**时用"中文(英文)"格式,之后只用中文或英文单独一致使用:
|
||||
|
||||
- 首次:`糖苷水解酶 101 家族(GH101 family)`
|
||||
- 之后:`GH101 家族` 或 `糖苷水解酶 101 家族`(选一种风格用到底)
|
||||
|
||||
### 行业惯例优先
|
||||
|
||||
以下术语在行业中**中英混用是标准做法**,不要强制翻译:
|
||||
|
||||
- 直接保留英文:FDA, EMA, NMPA, FEV1, BEC, sST2, CAT, SGRQ, BLA, NDA, IND, ICH, CMC, CDMO, CDMO, GH101, IgG, mAb, ADC, BsAb, GLP-1, PD-1, CAR-T, HbA1c, IL-4, IL-5, IL-13, IL-33, ST2, Th2, ILC2s
|
||||
- 中英并列的术语:抗体偶联药物(ADC)、单克隆抗体(mAb)、慢性阻塞性肺疾病(COPD)
|
||||
|
||||
### 动词/形容词类翻译
|
||||
|
||||
这类不保留英文:
|
||||
|
||||
| 英文 | 中文 |
|
||||
|---|---|
|
||||
| significant | 显著(需跟数据)|
|
||||
| substantial | 大幅 |
|
||||
| demonstrate | 表明 / 显示 |
|
||||
| exhibit | 表现出 |
|
||||
| propose | 提出 |
|
||||
| investigate | 研究 |
|
||||
| establish | 建立 / 确立 |
|
||||
| confirm | 证实 |
|
||||
| underscore | (直接删,见 humanizer-cn) |
|
||||
| highlight | (直接删或改为"指出") |
|
||||
|
||||
---
|
||||
|
||||
## 三、数字与单位转换
|
||||
|
||||
### 数字表达
|
||||
|
||||
- 英文 "12,000" → 中文 "12,000"(保留千分位逗号)
|
||||
- 英文 "1.2 billion USD" → 中文 "12 亿美元"
|
||||
- 英文 "3.5 million patients" → 中文 "350 万名患者"
|
||||
- 英文 "23%" → 中文 "23%"
|
||||
|
||||
### 量词
|
||||
|
||||
数字后面中文要加量词:
|
||||
|
||||
| 英文 | 中文 |
|
||||
|---|---|
|
||||
| 12 studies | 12 项研究 |
|
||||
| 3 companies | 3 家公司 |
|
||||
| 5 patents | 5 项专利 |
|
||||
| 20 patients | 20 名患者 |
|
||||
| 1.2 billion | 12 亿 |
|
||||
| 3 years | 3 年 |
|
||||
| 6 months | 6 个月 |
|
||||
|
||||
### 时间格式
|
||||
|
||||
- "2024" → "2024 年"
|
||||
- "2020-2025" → "2020-2025 年"(用半角连字符)
|
||||
- "Q4 2025" → "2025 年第 4 季度" 或 "2025 Q4"
|
||||
- "March 2024" → "2024 年 3 月"
|
||||
|
||||
### 百分比
|
||||
|
||||
- "30%" → "30%"
|
||||
- "up to 60%" → "最高 60%"
|
||||
- "approximately 40%" → "约 40%"
|
||||
|
||||
---
|
||||
|
||||
## 四、标点转换
|
||||
|
||||
### 必须转为中文标点的情况
|
||||
|
||||
中文段落中,句内标点必须是**中文全角标点**:
|
||||
|
||||
| 英文 | 中文 |
|
||||
|---|---|
|
||||
| `,` | `,` |
|
||||
| `.` | `。` |
|
||||
| `;` | `;` |
|
||||
| `:` | `:` |
|
||||
| `?` | `?` |
|
||||
| `!` | `!` |
|
||||
| `"..."` | `"..."` |
|
||||
| `'...'` | `'...'` |
|
||||
| `(...)` | `(...)` |
|
||||
| `—` | `——`(中文全角破折号是两个连一起)|
|
||||
| `...` | `……`(中文省略号六个点)|
|
||||
|
||||
### 保留英文标点的情况
|
||||
|
||||
- 英文术语、代码、URL 内部的标点
|
||||
- 行内引用的英文原文
|
||||
- 数据单位前后:`3.2 mg/kg`(数字和单位之间用英文斜杠)
|
||||
|
||||
---
|
||||
|
||||
## 五、句子结构重构
|
||||
|
||||
### 英文长句→中文短句
|
||||
|
||||
**原文**:
|
||||
> The observation that sST2 levels, which have been validated as a prognostic biomarker in heart failure and included in ACC/AHA guidelines, are elevated in COPD patients during acute exacerbations suggests a potential cross-disease mechanism.
|
||||
|
||||
**烂翻译**:
|
||||
> sST2 水平(它已被验证为心力衰竭的预后生物标志物并被纳入 ACC/AHA 指南)在 COPD 患者急性加重期间升高的观察结果,提示了潜在的跨疾病机制。
|
||||
|
||||
**好翻译**:
|
||||
> sST2 已是心力衰竭领域的预后生物标志物,纳入 ACC/AHA 指南多年。COPD 患者在急性加重期间 sST2 水平升高,提示这两类疾病可能共享同一条炎症通路。
|
||||
|
||||
### 修饰语位置
|
||||
|
||||
英文习惯把修饰语放后面(of / which / that 从句),中文要前置或拆句。
|
||||
|
||||
- "the company that pioneered O-glycosidase commercialization in 1990" → "1990 年率先实现 O-糖苷酶商业化的那家公司"(前置)
|
||||
- 或拆句:"NEB 公司在 1990 年率先将 O-糖苷酶商业化"
|
||||
|
||||
---
|
||||
|
||||
## 六、段落重构
|
||||
|
||||
### 英文段落首句原则
|
||||
|
||||
英文学术/商业写作的段落一般首句即论点(Topic sentence),后面是论据。翻译时保留这一结构,不要打乱。
|
||||
|
||||
### 段落长度调整
|
||||
|
||||
- 英文习惯长段(150-200 词 / ≈ 250-330 字)
|
||||
- 中文如果一段超过 400 字,读起来累。超过 400 字应考虑拆段。
|
||||
- 拆段原则:按子论点拆,不要机械按句数拆
|
||||
|
||||
---
|
||||
|
||||
## 七、翻译后校对清单
|
||||
|
||||
译完后自己过三遍:
|
||||
|
||||
### 第 1 遍:准确性
|
||||
|
||||
- 所有数字、日期、百分比、来源 ID `[src_xxx]` 完全一致?
|
||||
- 所有专有名词首次出现有中英对照?
|
||||
- 没有错译、漏译?
|
||||
|
||||
### 第 2 遍:流畅性
|
||||
|
||||
- 有没有"的"字过多?(`X 的 Y 的 Z 的 W` 这种链式改为"X 下的 Y 中的 Z")
|
||||
- 有没有翻译腔?("...的话"、"...的话说"、"对于...来说"、"在...方面")
|
||||
- 句子长度是否有节奏变化?全长句或全短句都不行
|
||||
- 读一遍念出来,是否自然?
|
||||
|
||||
### 第 3 遍:humanizer-cn 禁用词
|
||||
|
||||
加载 `skill:humanizer-cn`,扫一遍中文禁用词清单:
|
||||
- 跃迁 / 赋能 / 落地 / 格局 / 生态 / 痛点 / 风口 / 闭环 / 抓手 / 颠覆 / 引领 / 重塑 / 赛道 / 范式 / 底层逻辑 / 本质上 / 从根本上
|
||||
- AI 套话:随着、不断、深入、值得注意、不难发现、具有重要意义、综上所述、由此可见
|
||||
|
||||
---
|
||||
|
||||
## 八、特殊情况处理
|
||||
|
||||
### 原文是咨询报告风格
|
||||
|
||||
保留咨询报告的语感:观点前置、数字支撑、对比结构。不要为了"接地气"而口语化。
|
||||
|
||||
### 原文包含表格
|
||||
|
||||
表格翻译时:
|
||||
- 表头翻译
|
||||
- 单元格数字保留原格式
|
||||
- 专有名词保留英文(节省宽度)
|
||||
- 表格标题用 `表 X-Y:<内容>(数据来源:[src_xxx])`
|
||||
|
||||
### 原文包含图表
|
||||
|
||||
图表标题和说明翻译;图表本身(如果是 matplotlib 生成的 PNG)可能需要 dr-reporter 用中文字体重新生成。
|
||||
|
||||
### 原文包含 SCQA 式段落(如 Executive Summary)
|
||||
|
||||
SCQA 结构保留(因为这是麦肯锡式叙事),但不要标注 "S/C/Q/A"字样,按 `mckinsey-method skill` 要求写成融合式。
|
||||
|
||||
---
|
||||
|
||||
## 九、术语表维护
|
||||
|
||||
dr-translator 在翻译过程中维护项目级术语表:
|
||||
|
||||
```
|
||||
projects/<slug>/phase4/glossary.json
|
||||
{
|
||||
"GH101 family": "糖苷水解酶 101 家族",
|
||||
"endoglycosidase": "内切糖苷酶",
|
||||
"O-glycosylation": "O-糖基化",
|
||||
"Core 1": "核心 1 型",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
这个术语表会作为 final report 里的"术语表(Glossary)"章节,双语对照呈现。
|
||||
|
||||
---
|
||||
|
||||
## 十、输出要求
|
||||
|
||||
### 文件命名
|
||||
|
||||
- 英文稿:`projects/<slug>/phase4/final_en.md`
|
||||
- 中文稿:`projects/<slug>/phase4/final_zh.md`(dr-translator 产出)
|
||||
- 中文稿润色后:仍然 `final_zh.md`(dr-polisher 原地修改)
|
||||
- PDF 主稿:`final.pdf`(中文)
|
||||
- PDF 英文参考版:`final_en.pdf`
|
||||
- DOCX 主稿:`final.docx`(中文)
|
||||
|
||||
### 交付汇报
|
||||
|
||||
翻译完成后向调用者返回:
|
||||
|
||||
```
|
||||
翻译完成
|
||||
英文源:projects/<slug>/phase4/final_en.md (X words)
|
||||
中文译:projects/<slug>/phase4/final_zh.md (X 字)
|
||||
膨胀率:X%(预期 1.4 倍)
|
||||
术语表:projects/<slug>/phase4/glossary.json (X 条)
|
||||
翻译质检:humanizer-cn 禁用词 X 项(已清理)
|
||||
下一步:等待 dr-polisher 做最终润色
|
||||
```
|
||||
@@ -0,0 +1,202 @@
|
||||
---
|
||||
name: evidence-table
|
||||
description: 证据矩阵规范。规定每条核心结论必须有对应的证据记录,格式、字段、置信度分级和文件结构。dr-analyst 撰写初稿时使用,dr-verifier 追加反方证据时使用,dr-chief-editor 审校时作为核验基准。
|
||||
---
|
||||
|
||||
# 证据矩阵规范
|
||||
|
||||
## 核心原则
|
||||
|
||||
**每条结论必须可追溯**。报告中每一个有 [src_xxx] 标注的观点,都必须在对应章节的 evidence 文件中有一行记录。
|
||||
|
||||
Antigravity native 模式下,证据不能只停留在模型上下文或章节草稿里。除章节 evidence markdown 外,还必须维护机器可审计的 claim ledger,让 Phase 3/4 可以逐条核验。
|
||||
|
||||
---
|
||||
|
||||
## Antigravity Native 证据落盘
|
||||
|
||||
Phase 2 必须至少维护以下文件:
|
||||
|
||||
- `projects/<slug>/phase2/search_log.jsonl`:检索、打开、抽取的回执
|
||||
- `projects/<slug>/phase2/sources.jsonl`:稳定 source registry
|
||||
- `projects/<slug>/phase2/claims_ledger.jsonl`:原子 claim 台账
|
||||
- `projects/<slug>/phase2/coverage_matrix.md`:章节/任务覆盖矩阵
|
||||
- `projects/<slug>/phase2/unsupported_claims.md`:未证实或仅弱证据支持的观点
|
||||
|
||||
`claims_ledger.jsonl` 每行必须是一个原子事实或判断,字段至少包括:
|
||||
|
||||
```json
|
||||
{
|
||||
"claim_id": "ch03_C012",
|
||||
"chapter": "ch03",
|
||||
"claim_type": "fact|trend|comparison|causal|forecast|recommendation",
|
||||
"claim": "...",
|
||||
"supporting_source_ids": ["src_042", "src_087"],
|
||||
"counter_source_ids": ["src_103"],
|
||||
"evidence_spans": [
|
||||
{
|
||||
"source_id": "src_042",
|
||||
"locator": "Table 2",
|
||||
"summary": "..."
|
||||
}
|
||||
],
|
||||
"confidence": "high|medium|low|unsupported",
|
||||
"verification_status": "verified|partially_verified|conflicted|unsupported",
|
||||
"needs_delta_retrieve": false,
|
||||
"visible_caveat_required": false
|
||||
}
|
||||
```
|
||||
|
||||
正文、章节 evidence markdown、`claims_ledger.jsonl` 三者必须能互相对上:
|
||||
|
||||
- 正文的 `Cxx/Fxx/Txx` ID 必须在 evidence markdown 和 `claims_ledger.jsonl` 中存在;
|
||||
- `claims_ledger.jsonl` 中 `verification_status=unsupported` 的 claim 必须进入 `unsupported_claims.md`;
|
||||
- `needs_delta_retrieve=true` 的 claim 必须补做定向检索,或在正文显式降级;
|
||||
- Phase 4 不得新增未进入 claim ledger 的事实。
|
||||
|
||||
---
|
||||
|
||||
## 证据矩阵文件格式
|
||||
|
||||
文件路径:`projects/<slug>/phase2/evidence/chXX-evidence.md`
|
||||
|
||||
### 文件结构
|
||||
|
||||
```markdown
|
||||
# 第 X 章 <标题> — 证据矩阵
|
||||
|
||||
生成时间:<datetime>
|
||||
研究员:dr-analyst
|
||||
字数统计:<N> 字 / 配额 <N> 字
|
||||
|
||||
---
|
||||
|
||||
## 核心结论证据表
|
||||
|
||||
| 结论 ID | 观点摘要(≤30字) | 支持证据 1 | 支持证据 2 | 置信度 | 备注 |
|
||||
|---|---|---|---|---|---|
|
||||
| C01 | <观点> | [src_001] <标题> Tier1 | [src_002] <标题> Tier2 | 高 | |
|
||||
| C02 | <观点> | [src_003] <标题> Tier2 | **[待验证]** 仅 1 个来源 | 中 | 需补充 |
|
||||
| C03 | <观点> | [src_004] <标题> Tier1 | [src_005] <标题> Tier1 | 高 | |
|
||||
|
||||
---
|
||||
|
||||
## 置信度说明
|
||||
|
||||
- **高**:2 个以上独立 Tier 1-2 信源支持,无重大反方证据
|
||||
- **中**:只有 1 个 Tier 1-2 信源,或有轻微反方证据
|
||||
- **低**:仅 Tier 3 信源,或有实质性反方证据
|
||||
- **[待验证]**:找不到第 2 个独立信源,在正文明确标注
|
||||
|
||||
---
|
||||
|
||||
## 信源详情
|
||||
|
||||
<!-- 每条 [src_xxx] 的完整信息 -->
|
||||
|
||||
**[src_001]**
|
||||
- 标题:
|
||||
- 作者/机构:
|
||||
- 年份:
|
||||
- URL/DOI:
|
||||
- Tier:1
|
||||
- 评分:8.5
|
||||
- 摘要(2-3句):
|
||||
|
||||
**[src_002]**
|
||||
...
|
||||
|
||||
---
|
||||
|
||||
## 反方证据(dr-verifier 填写)
|
||||
|
||||
<!-- dr-verifier 完成后追加以下内容 -->
|
||||
|
||||
### 验证摘要
|
||||
- 核验结论数:X
|
||||
- 发现反方证据:X 条
|
||||
- 补足待验证:X 条
|
||||
- 重大挑战:X 条
|
||||
|
||||
### 反方证据详情
|
||||
|
||||
#### 针对结论 C01:<观点摘要>
|
||||
- 反方证据:<内容>
|
||||
- 来源:[src_xxx] | Tier X
|
||||
- 处理建议:保留并注明争议 / 修改措辞 / 删除
|
||||
|
||||
<!-- 如有重大挑战 -->
|
||||
CRITICAL: <说明>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 正文中反方证据段落的写作规范(v0.8 新)
|
||||
|
||||
### 标题必须观点化,不能叫 "反驳证据 / Counter-Evidence"
|
||||
|
||||
**问题诊断**:v0.7 发现每章末尾 dr-analyst 会机械地写 `## 反驳证据`,标题重复而空洞,读者看了没有信息增益。
|
||||
|
||||
**新规则**:正文反方证据段落的标题必须:
|
||||
|
||||
1. **用二级 H2 或三级 H3 标题**(统一层级,禁止用加粗段冒充标题)
|
||||
2. **包含具体判断**,不要用"反驳证据" / "反方证据" / "Counter-Evidence" 这种模板化命名
|
||||
3. 至少要回答:**"对前述论点的哪一方面提出了什么挑战?"**
|
||||
|
||||
### 可接受的命名示例
|
||||
|
||||
| ✗ 不推荐 | ✓ 推荐 |
|
||||
|---|---|
|
||||
| 反驳证据 | 另一种声音:管线虚胖还是真实进展? |
|
||||
| Counter-Evidence | 需要补充判断的副作用:汇聚偶联收率可能被高估 |
|
||||
| 反方观点 | 反例:Codexis ECO 并非所有情境都优于 SPOS |
|
||||
| Counter Arguments | 值得警惕的数据:临床前到 IND 的衰减率 |
|
||||
|
||||
### 段落结构模板(推荐)
|
||||
|
||||
```markdown
|
||||
## <观点化标题>
|
||||
|
||||
虽然上文论证了 <核心观点>,但以下证据提示需要**有限度地**接受这一判断:
|
||||
|
||||
1. **<反方论点 1>**:<具体数据或案例> [src_xxx]。影响评估:<说明>
|
||||
2. **<反方论点 2>**:<具体数据或案例> [src_xxx]。影响评估:<说明>
|
||||
|
||||
综合而言,核心结论仍成立,但需在 <某个具体维度> 上留出缓冲。
|
||||
```
|
||||
|
||||
### 禁止的写法
|
||||
|
||||
- 单独用 **加粗段** 冒充反方证据标题(`**反方证据:** ...`)
|
||||
- 反方证据后不做整合判断,只是堆数据
|
||||
- 在每个小节末尾都加反方证据(只在章末加一次即可;若小节级别有重大挑战,写在小节正文里即可)
|
||||
|
||||
---
|
||||
|
||||
## 置信度分级标准
|
||||
|
||||
| 置信度 | 条件 | 正文处理方式 |
|
||||
|---|---|---|
|
||||
| 高 | ≥2 个独立 Tier 1-2 信源,无 CRITICAL 反方 | 直接陈述 |
|
||||
| 中 | 1 个 Tier 1-2 信源,或有轻微反方 | 陈述 + "但部分研究认为..." |
|
||||
| 低 | 仅 Tier 3,或有实质反方 | 必须加 "[待验证]" 标注 |
|
||||
| [待验证] | 无法找到第 2 个独立来源 | 正文明确写 "该观点仅有 1 个来源支持,待验证" |
|
||||
|
||||
---
|
||||
|
||||
## 结论 ID 命名规则
|
||||
|
||||
- `C01`-`C99`:正向核心结论
|
||||
- `F01`-`F09`:事实性陈述(不需要观点判断)
|
||||
- `T01`-`T09`:趋势判断(通常需要时间序列数据支撑)
|
||||
|
||||
dr-analyst 在撰写草稿时,给每个有 [src_xxx] 的观点分配一个 ID,在草稿和 evidence 文件里保持一致。
|
||||
|
||||
---
|
||||
|
||||
## 硬性规则
|
||||
|
||||
1. 草稿中每个 [src_xxx] 必须在 evidence 文件里有对应行
|
||||
2. 草稿中标注 `[待验证]` 的观点必须在 evidence 表里有对应行(置信度列写"低/待验证")
|
||||
3. dr-verifier 只能在"反方证据"段落追加,不能修改"核心结论证据表"
|
||||
4. CRITICAL 标注的问题,dr-chief-editor 审校时必须明确处理(不能忽略)
|
||||
@@ -0,0 +1,356 @@
|
||||
---
|
||||
name: humanizer-cn
|
||||
description: 去除 AI 味的中英双语写作规则。基于 Wikipedia Signs of AI Writing + blader/humanizer + 生物医药中文报告特化经验。dr-polisher 必读;dr-editor-in-chief 和 dr-translator 也应遵循。
|
||||
---
|
||||
|
||||
# Humanizer(中英双语去 AI 味规范)
|
||||
|
||||
## 你的任务
|
||||
|
||||
拿到文稿后,**按以下流程处理**:
|
||||
|
||||
1. **扫描**全文,识别所有 AI 模式(下述 28 条)
|
||||
2. **重写**问题段落,保留原意,换掉 AI-ism
|
||||
3. **注入人味**:不只是删除坏模式,要加入真正的个性
|
||||
4. **做最后一遍自问**:问自己"这段里还有什么显得是 AI 写的?"逐条修正
|
||||
|
||||
---
|
||||
|
||||
## 核心原则
|
||||
|
||||
> **避免 AI 模式只是一半工作。没有灵魂的干净文字和 slop 一样明显。好的写作背后有真人。**
|
||||
|
||||
---
|
||||
|
||||
## 英文规则(Phase 2/3 工作语言)
|
||||
|
||||
### 1. 过度渲染"意义/遗产/更宏大趋势"
|
||||
|
||||
**禁用词**:stands/serves as, is a testament/reminder, pivotal/crucial/key moment, underscores importance, reflects broader, symbolizing enduring, contributing to, setting the stage for, marking a shift, key turning point, evolving landscape
|
||||
|
||||
**反例**:
|
||||
> The Institute was established in 1989, marking a pivotal moment in the evolution of regional statistics and reflecting broader decentralization trends.
|
||||
|
||||
**改写**:
|
||||
> The Institute was established in 1989 to collect regional statistics independently from the national office.
|
||||
|
||||
### 2. 空泛归因 / Weasel Words
|
||||
|
||||
**禁用词**:Industry reports suggest, Observers have cited, Experts argue, Some critics argue, several sources, It has been noted
|
||||
|
||||
**反例**:
|
||||
> Experts believe this river plays a crucial role in the regional ecosystem.
|
||||
|
||||
**改写**:
|
||||
> A 2019 survey by the Chinese Academy of Sciences found that this river supports 12 endemic fish species.
|
||||
|
||||
### 3. -ing 短语堆砌(伪深度)
|
||||
|
||||
**禁用模式**:highlighting/underscoring/emphasizing/ensuring/reflecting/contributing to/cultivating/fostering/encompassing/showcasing
|
||||
|
||||
**反例**:
|
||||
> The architect chose blue, green, and gold, symbolizing Texas bluebonnets, reflecting the community's deep connection to the land.
|
||||
|
||||
**改写**:
|
||||
> The architect chose blue, green, and gold to reference local bluebonnets and the Gulf coast.
|
||||
|
||||
### 4. 高频 AI 词汇
|
||||
|
||||
**禁用**:Actually, additionally, align with, crucial, delve, emphasizing, enduring, enhance, fostering, garner, highlight (v), interplay, intricate, key (adj), landscape (abstract), pivotal, showcase, tapestry, testament, underscore, valuable, vibrant
|
||||
|
||||
### 5. 规避 "is/are"(Copula Avoidance)
|
||||
|
||||
**禁用模式**:X serves as Y / X stands as Y / X marks Y / X represents Y / X boasts / X features / X offers
|
||||
|
||||
**反例**:
|
||||
> Gallery 825 serves as LAAA's exhibition space and boasts over 3,000 square feet.
|
||||
|
||||
**改写**:
|
||||
> Gallery 825 is LAAA's exhibition space, with 3,000 square feet.
|
||||
|
||||
### 6. 负向平行(Negative Parallelism)
|
||||
|
||||
**禁用**:It's not just X, it's Y / Not only X but Y / more than just
|
||||
|
||||
### 7. 三段式(Rule of Three)
|
||||
|
||||
不为凑数拼三项。"The event features keynote sessions, panel discussions, and networking opportunities" → "The event includes talks and panels with informal networking between sessions."
|
||||
|
||||
### 8. 同义词循环(Elegant Variation)
|
||||
|
||||
避免在连续句子里对同一概念使用"the protagonist / the main character / the central figure / the hero"。一个叫法用到底即可。
|
||||
|
||||
### 9. 伪范围(False Ranges)
|
||||
|
||||
**禁用**:from X to Y 当 X 和 Y 不在同一量纲上。
|
||||
|
||||
"Our journey has taken us from the Big Bang to the cosmic web, from star formation to dark matter" → "The book covers the Big Bang, star formation, and dark matter."
|
||||
|
||||
### 10. 被动/无主语片段
|
||||
|
||||
"No configuration file needed" → "You do not need a configuration file."
|
||||
"The results are preserved automatically" → "The system preserves the results automatically."
|
||||
|
||||
### 11. 破折号过度使用
|
||||
|
||||
长破折号每章不超过 3 处。绝大多数情况下可以用逗号、句号或括号改写。
|
||||
|
||||
### 12. 内联粗体列表(Inline-header bullets)
|
||||
|
||||
**反例**:
|
||||
- **Speed:** Code generation is significantly faster.
|
||||
- **Quality:** Output quality has been enhanced.
|
||||
- **Adoption:** Usage continues to grow.
|
||||
|
||||
**改写为段落**:
|
||||
> The tool speeds up code generation substantially and improves output through better training. Adoption has grown alongside these improvements.
|
||||
|
||||
### 13. 标题 Title Case
|
||||
|
||||
**禁用**:## Strategic Negotiations And Global Partnerships
|
||||
**改为**:## Strategic negotiations and global partnerships
|
||||
|
||||
### 14. Emoji 装饰
|
||||
|
||||
禁止在标题、段落开头用 emoji(🚀 💡 ✅)。
|
||||
|
||||
### 15. Curly Quotes
|
||||
|
||||
"这种引号" 改为普通 "straight quotes"。
|
||||
|
||||
### 16. Chatbot 残留
|
||||
|
||||
**禁用**:I hope this helps, Of course!, Certainly!, You're absolutely right!, Would you like..., Let me know, Here is a..., Great question!
|
||||
|
||||
### 17. 知识截止声明
|
||||
|
||||
**禁用**:as of [date], up to my last training update, While specific details are limited, based on available information
|
||||
|
||||
### 18. 谄媚语气
|
||||
|
||||
**禁用**:Great question! You're absolutely right! That's an excellent point.
|
||||
|
||||
### 19. Filler 短语
|
||||
|
||||
| 禁用 | 改为 |
|
||||
|---|---|
|
||||
| In order to achieve this goal | To achieve this |
|
||||
| Due to the fact that | Because |
|
||||
| At this point in time | Now |
|
||||
| In the event that | If |
|
||||
| Has the ability to | Can |
|
||||
| It is important to note that | (直接删) |
|
||||
|
||||
### 20. 过度 Hedging
|
||||
|
||||
"It could potentially possibly be argued that..." → "The policy may..."
|
||||
|
||||
### 21. 通用正向总结
|
||||
|
||||
**禁用**:The future looks bright. Exciting times lie ahead. A major step in the right direction.
|
||||
|
||||
**改为**:具体说清楚下一步做什么。
|
||||
|
||||
### 22. 连字符成对词过多
|
||||
|
||||
AI 对常用词对几乎 100% 加连字符(third-party, cross-functional, data-driven, decision-making, well-known, high-quality, real-time, long-term, end-to-end)。人类用得不那么整齐。选择性去掉连字符。
|
||||
|
||||
### 23. 权威套话
|
||||
|
||||
**禁用**:The real question is, at its core, in reality, what really matters, fundamentally, the deeper issue, the heart of the matter
|
||||
|
||||
这些都是 AI 假装切穿表象直达真相的套路,删掉后真相还是在那里。
|
||||
|
||||
### 24. Signposting 预告
|
||||
|
||||
**禁用**:Let's dive in, let's explore, let's break this down, here's what you need to know, without further ado
|
||||
|
||||
直接进入内容,不要预告。
|
||||
|
||||
### 25. 标题后重复一遍标题内容
|
||||
|
||||
```
|
||||
## Performance
|
||||
Speed matters.
|
||||
When users hit a slow page, they leave.
|
||||
```
|
||||
|
||||
删掉 "Speed matters"。
|
||||
|
||||
### 26. 过度 boldface
|
||||
|
||||
不要在每一句里加粗 **这个** 和 **那个**。一段里粗体超过 2 处,说明你没认真思考该强调什么。
|
||||
|
||||
---
|
||||
|
||||
## 中文规则(Phase 4 翻译后适用)
|
||||
|
||||
中文有一套自己的 AI 味。以下是核心禁用清单。
|
||||
|
||||
### CN-1:AI 高频词(见到即替换)
|
||||
|
||||
| 禁用词 | 替换策略 |
|
||||
|---|---|
|
||||
| 跃迁 / 跃升 / 跃上 | 改为"升至 / 提升到" |
|
||||
| 赋能 | 改为"帮助 / 支持 / 推动" |
|
||||
| 落地 | 改为"实施 / 推行 / 执行" |
|
||||
| 格局 | 具体说清楚是"竞争格局"还是"市场格局" |
|
||||
| 生态 / 生态圈 | 少用,具体说"上下游企业" |
|
||||
| 深度 / 深度的 | 少用,改为具体描述 |
|
||||
| 痛点 | 改为"问题 / 困难" |
|
||||
| 风口 | 直接说"市场机会" |
|
||||
| 闭环 / 打通闭环 | 改为"完成了完整流程" |
|
||||
| 抓手 | 删掉,直接说动作 |
|
||||
| 颠覆 / 颠覆性 | 少用,过度戏剧化 |
|
||||
| 引领 / 引领性 | 改为具体的"率先做了..." |
|
||||
| 重塑 / 重构 | 改为"改变 / 改组" |
|
||||
| 赛道 | 改为"细分领域 / 市场" |
|
||||
| 范式 | 改为"方式 / 模式" |
|
||||
| 底层逻辑 | 改为"根本原因 / 核心机制" |
|
||||
| 本质上 / 从根本上 | 直接删除,讲具体内容 |
|
||||
|
||||
### CN-2:AI 套话(整句清除)
|
||||
|
||||
**禁用**:
|
||||
- "随着 X 的不断发展"
|
||||
- "在 X 背景下 / 在这一背景下"
|
||||
- "值得注意的是"
|
||||
- "不难发现"
|
||||
- "显而易见"
|
||||
- "毫无疑问"
|
||||
- "具有重要意义"
|
||||
- "发挥了重要作用"
|
||||
- "起到了 X 的作用"
|
||||
- "综上所述"
|
||||
- "由此可见"
|
||||
- "总的来说"
|
||||
- "据报道"
|
||||
- "有研究表明 / 有专家认为"(除非说出具体是哪项研究/哪位专家)
|
||||
|
||||
### CN-3:规避"是"的冗余句式(AI 极高频)
|
||||
|
||||
| 禁用 | 改为 |
|
||||
|---|---|
|
||||
| X 标志着 Y | X 是 Y / 从此 Y 成立 |
|
||||
| X 代表着 Y | X 是 Y |
|
||||
| X 构成 Y | X 是 Y |
|
||||
| X 成为 Y | 直接用 "X 是 Y" |
|
||||
| X 跃升为 Y | X 升到 Y |
|
||||
| X 彰显着 Y | X 说明 Y |
|
||||
| X 体现了 Y | X 说明 Y / X 显示 Y |
|
||||
|
||||
### CN-4:三段式堆砌(Rule of Three)
|
||||
|
||||
中文 AI 特别爱拼三段:
|
||||
- "短期、中期、长期"
|
||||
- "需求侧、供给侧、政策侧"
|
||||
- "技术、资本、市场"
|
||||
- "硬实力、软实力、巧实力"
|
||||
|
||||
不为凑数拼三段。如果只有两个要点就说两个,四个就说四个,节奏自然一些。
|
||||
|
||||
### CN-5:空洞形容词(必须跟数据)
|
||||
|
||||
- 巨大 → "250 亿美元"
|
||||
- 快速 → "CAGR 23%"
|
||||
- 显著 → "降低 40%(p<0.001)"
|
||||
- 强劲 → "增速高于同行 8 个百分点"
|
||||
- 显著领先 → "领先第二名 30% 市场份额"
|
||||
|
||||
无数据形容词直接删。
|
||||
|
||||
### CN-6:破折号规范
|
||||
|
||||
- 中文用全角破折号 `——`(两个连接起来)
|
||||
- 每章不超过 3 处
|
||||
- 多数情况可改为逗号、括号、句号
|
||||
|
||||
### CN-7:负向平行
|
||||
|
||||
**禁用**:
|
||||
- "不仅...更..."
|
||||
- "不仅仅是...,更是..."
|
||||
- "不是...而是..."
|
||||
- "不只是...,还是..."
|
||||
|
||||
偶用可以,成段出现必改。
|
||||
|
||||
### CN-8:过度书面腔 / 翻译腔
|
||||
|
||||
- "使...得以..." → "让 X 能 Y"
|
||||
- "通过...方式 / 通过...的方式" → "用 X / 以 X"
|
||||
- "对于 X 而言" → "X 的..."
|
||||
- "在 X 方面" → 具体说哪方面
|
||||
- "就 X 来说" → 删
|
||||
|
||||
### CN-9:内联粗体小标题(每段开头都加粗)
|
||||
|
||||
**反例**:
|
||||
- **技术层面**:xxx
|
||||
- **商业层面**:xxx
|
||||
- **风险层面**:xxx
|
||||
|
||||
改为叙述段落。保留加粗的前提是:真的是关键强调,而不是装饰。
|
||||
|
||||
### CN-10:章节标题 / 小节标题禁止用符号开头
|
||||
|
||||
禁止:🚀 / ✅ / 💡 / ⚠️ 等 emoji 开头。如果是正式提示标志,在正文中用文字表述。
|
||||
|
||||
---
|
||||
|
||||
## 注入人味(Add Soul)
|
||||
|
||||
干净但没灵魂的文字和 AI slop 一样明显。合格的报告要有:
|
||||
|
||||
### 有立场
|
||||
|
||||
不要只报告事实——对事实有判断。"定价策略存在风险"比"定价策略有利有弊"好。
|
||||
|
||||
### 节奏变化
|
||||
|
||||
短句。再长一些的句子慢慢把意思讲清楚。混着用。
|
||||
|
||||
### 承认不确定
|
||||
|
||||
真人会说"我不确定",AI 不会。允许出现"这个趋势能否持续还需观察"、"目前数据尚不足以做判断"这种诚实表达。
|
||||
|
||||
### 具体而非抽象
|
||||
|
||||
- "用户体验有待改善" → "首次打开页面要 8 秒,用户很可能就离开了"
|
||||
- "存在风险" → "最大风险是 NEB 可能用专利诉讼拖延 18-24 个月"
|
||||
|
||||
### 有节制的第一人称
|
||||
|
||||
研究报告一般不用"我",但是"我们认为 / 本报告认为"比"一般认为"好。
|
||||
|
||||
---
|
||||
|
||||
## 最后的自审流程
|
||||
|
||||
写完一段后,问自己三个问题:
|
||||
|
||||
1. **这句话是真人会说的吗?** 读出来听听看是否拗口做作
|
||||
2. **能更具体吗?** 任何抽象词都问能否换成数据/案例
|
||||
3. **删掉这句会失去什么?** 如果没损失,删
|
||||
|
||||
---
|
||||
|
||||
## Process Summary(给调用 agent 的操作清单)
|
||||
|
||||
拿到一份待润色的稿子后:
|
||||
|
||||
1. **扫描并标记**:全文搜索上述禁用词和模式
|
||||
2. **逐段重写**:按规则替换
|
||||
3. **检查节奏**:段落长短、句子长短是否有变化
|
||||
4. **删减冗余**:空话 / 套话 / 无数据形容词
|
||||
5. **核对格式**:没有 emoji、粗体不过度、标题 sentence case、破折号节制
|
||||
6. **So What 检验**:每段都得有价值
|
||||
7. **最后一遍自问**:这段还有哪里像 AI?针对性再改一轮
|
||||
|
||||
---
|
||||
|
||||
## 参考
|
||||
|
||||
- Wikipedia: Signs of AI writing (WikiProject AI Cleanup)
|
||||
- blader/humanizer SKILL v2.5.1
|
||||
- 9MW1911 综合战略报告(中文风格参考)
|
||||
@@ -0,0 +1,172 @@
|
||||
---
|
||||
name: length-budget
|
||||
description: 报告字数预算分配与执行校验。支持 4 种字数模式(自动/简明/详细/深度),英中互换规则(英文词数 ≈ 中文字数 × 0.7),章节配额算法与补写策略。Phase 1 用于设定预算,Phase 2/4 用于自检。
|
||||
---
|
||||
|
||||
# 字数预算系统
|
||||
|
||||
## 一、四种字数模式(Phase 1 访谈时选择)
|
||||
|
||||
用户在 /dr-init 访谈时选定其中一种,写入 manifest.word_budget_mode:
|
||||
|
||||
| 模式 | 中文字数目标 | 英文词数目标 | 章节数 | 适用场景 |
|
||||
|---|---|---|---|---|
|
||||
| `auto` | 按类型默认 | 按类型默认 | 8-12 | 不明确时默认 |
|
||||
| `concise` | 8,000-12,000 | 5,600-8,400 | 6-8 | 高管一阅即过 |
|
||||
| `detailed` | 20,000-35,000 | 14,000-24,500 | 10-12 | 标准专业报告 |
|
||||
| `deep` | 50,000-80,000 | 35,000-56,000 | 12-15 | 深度研究/行业专著 |
|
||||
|
||||
**auto 模式的默认字数**(按报告类型):
|
||||
|
||||
| 报告类型 | 中文字数 | 英文词数 | 章节数 |
|
||||
|---|---|---|---|
|
||||
| 综述 | 12,000 | 8,400 | 8-10 |
|
||||
| 研究 | 35,000 | 24,500 | 10-12 |
|
||||
| 投资 | 22,000 | 15,400 | 10-12 |
|
||||
| 管理/工艺 | 18,000 | 12,600 | 9-11 |
|
||||
|
||||
**字数只是参考,以把问题讲清楚为第一优先**。过少则内容单薄,过多则注水。目标区间±20% 内都可接受。
|
||||
|
||||
---
|
||||
|
||||
## 二、英文-中文字数换算
|
||||
|
||||
**核心换算率**:1 个英文词 ≈ 1.4-1.5 个中文字
|
||||
|
||||
Phase 2 产出英文,Phase 4 翻译为中文后字数会自然膨胀约 40%。预算时:
|
||||
- Phase 2 英文稿:按英文词数目标 × 1.0 写
|
||||
- Phase 4 中文稿:英文词数 × 1.4 应落在中文字数目标的 ±15% 内
|
||||
|
||||
自动换算工具:
|
||||
|
||||
```python
|
||||
def en_words_to_zh_chars(en_words: int) -> int:
|
||||
return int(en_words * 1.4)
|
||||
|
||||
def zh_chars_to_en_words(zh_chars: int) -> int:
|
||||
return int(zh_chars / 1.4)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、章节配额分配(dr-plan 在 Phase 1 用)
|
||||
|
||||
### 三层优先级
|
||||
|
||||
```
|
||||
P0(核心章,2-3 章):每章 = 总字数 × 13-16%
|
||||
P1(主干章,3-5 章):每章 = 总字数 × 8-11%
|
||||
P2(辅助章,2-3 章):每章 = 总字数 × 5-7%
|
||||
引言 / 结论章:各 = 总字数 × 6-8%
|
||||
```
|
||||
|
||||
### 约束
|
||||
|
||||
- 章节字数差距 ≤ ±30%(防止头重脚轻)
|
||||
- 结论章 ≥ 总字数 × 10%
|
||||
- 每节 ≥ 600 字(英文 ≥ 420 词),不足则合并节
|
||||
|
||||
### 示例:30,000 字研究报告分配
|
||||
|
||||
| 章 | 定位 | 中文配额 | 英文配额 |
|
||||
|---|---|---|---|
|
||||
| 第 1 章 引言 | intro | 1,800 | 1,260 |
|
||||
| 第 2 章 核心论点 | P0 | 4,500 | 3,150 |
|
||||
| 第 3 章 机制剖析 | P0 | 4,500 | 3,150 |
|
||||
| 第 4 章 临床证据 | P1 | 3,300 | 2,310 |
|
||||
| 第 5 章 竞争格局 | P1 | 3,000 | 2,100 |
|
||||
| 第 6 章 产业链 | P1 | 2,700 | 1,890 |
|
||||
| 第 7 章 政策监管 | P1 | 2,400 | 1,680 |
|
||||
| 第 8 章 风险 | P2 | 1,800 | 1,260 |
|
||||
| 第 9 章 国际对比 | P2 | 1,500 | 1,050 |
|
||||
| 第 10 章 趋势判断 | P1 | 2,100 | 1,470 |
|
||||
| 第 11 章 结论与建议 | conclusion | 2,400 | 1,680 |
|
||||
| **合计** | | **30,000** | **21,000** |
|
||||
|
||||
---
|
||||
|
||||
## 四、Phase 2 执行校验
|
||||
|
||||
dr-analyst 每章交稿前自检,dr-pm 每批校验。
|
||||
|
||||
### 英文字数统计
|
||||
|
||||
```bash
|
||||
# 英文词数
|
||||
wc -w projects/<slug>/phase2/drafts/chXX.md
|
||||
```
|
||||
|
||||
### 中文字数统计(未来用)
|
||||
|
||||
```python
|
||||
def count_chinese_words(text: str) -> int:
|
||||
import re
|
||||
cn = sum(1 for c in text if '\u4e00' <= c <= '\u9fff')
|
||||
text_no_cn = re.sub(r'[\u4e00-\u9fff]', ' ', text)
|
||||
en = len(re.findall(r"[A-Za-z]+(?:[-'][A-Za-z]+)*", text_no_cn))
|
||||
return cn + en
|
||||
```
|
||||
|
||||
### 校验逻辑
|
||||
|
||||
```
|
||||
1. 读 chXX.md 统计英文词数
|
||||
2. 对照 framework 中该章配额
|
||||
3. 判断:
|
||||
实际/配额 < 0.7 → 不合格,继续挖掘证据补写
|
||||
0.7 ≤ 比值 < 0.85 → 警告,建议补足
|
||||
0.85 ≤ 比值 ≤ 1.3 → 合格
|
||||
比值 > 1.3 → 超纲,考虑精简或拆分
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、字数不足的正确补救路径
|
||||
|
||||
**绝对禁止为凑数注水**("在此背景下"、"随着...的不断发展"等空话)。字数不足的应对顺序:
|
||||
|
||||
1. **检查证据覆盖**:该章观点是否有 ≥2 独立 Tier 1-2 信源?若无 → 检索补证据
|
||||
2. **展开数据细节**:把表格里的数字展开成文字分析(趋势、拐点、对比)
|
||||
3. **增加案例**:用 1-2 个具体公司/产品案例佐证抽象观点
|
||||
4. **补反方证据**:把反方证据段落写详细(500-800 字)
|
||||
5. **延伸推论**:对核心判断做"若成立则..."和"若不成立则..."分支
|
||||
6. **国际对比**:若原文只讲中国,加一段国际对比
|
||||
|
||||
---
|
||||
|
||||
## 六、manifest 字段规范
|
||||
|
||||
```json
|
||||
{
|
||||
"word_budget_mode": "detailed",
|
||||
"target_words_zh": 30000,
|
||||
"target_words_en": 21000,
|
||||
"min_words_zh": 24000,
|
||||
"chapter_quotas_en": [
|
||||
{"index": 1, "title": "...", "en_words": 1260, "priority": "intro"},
|
||||
{"index": 2, "title": "...", "en_words": 3150, "priority": "P0"}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、Phase 4 翻译后中文字数校验
|
||||
|
||||
翻译完成后:
|
||||
1. 读 final_zh.md,按中英混排规则统计字数
|
||||
2. 对照 manifest.target_words_zh
|
||||
3. 落在 ±15% 区间内 → 合格
|
||||
4. 不合格 → dr-polisher 在润色时适度扩展/压缩
|
||||
|
||||
---
|
||||
|
||||
## 八、硬规则
|
||||
|
||||
1. ✅ auto 模式按类型默认,其他模式按用户选择
|
||||
2. ✅ 章节字数差距 ≤ ±30%
|
||||
3. ✅ 结论章 ≥ 全文 10%
|
||||
4. ✅ Phase 2 英文稿每章自检,不足 70% 配额必须补
|
||||
5. ✅ Phase 4 中文稿整体字数校验在 ±15% 内
|
||||
6. ❌ 禁止为凑数注水(AI 套话、重复表述)
|
||||
7. ❌ 禁止对字数"打折"交稿
|
||||
@@ -0,0 +1,177 @@
|
||||
---
|
||||
name: mckinsey-method
|
||||
description: 顶级咨询公司(麦肯锡/BCG/德勤)研究报告写作方法论。金字塔原理、MECE、观点型标题、证据-数据-案例三要素、So What 自检。SCQA 仅用于 Executive Summary 和各章引入段,严禁每节机械套用。所有写作类 agent(dr-analyst/dr-editor-in-chief/dr-polisher)必读。
|
||||
---
|
||||
|
||||
# 顶级咨询报告写作方法论(精炼版)
|
||||
|
||||
## 核心定位
|
||||
|
||||
本文档是报告写作的**唯一风格准则**。读过 9MW1911 综合战略报告吗?那是目标风格。读起来像咨询公司资深合伙人在跟董事会讲话,不像 AI 生成的综述。
|
||||
|
||||
---
|
||||
|
||||
## 一、金字塔原理(Pyramid Principle)
|
||||
|
||||
**结论先行,论据支撑,论据之间 MECE。**
|
||||
|
||||
```
|
||||
章标题(= 一句判断)
|
||||
↓
|
||||
章首 2-3 段:直接给出本章结论 + 核心逻辑
|
||||
↓
|
||||
节 2.1(= 支撑论点 1)
|
||||
节首 1 段:本节论点 + 核心证据
|
||||
数据/事实/案例(带 [src_xxx])
|
||||
So What:这意味着什么
|
||||
↓
|
||||
节 2.2(= 支撑论点 2)
|
||||
...
|
||||
```
|
||||
|
||||
**章标题即判断**(强制):
|
||||
- ✗ "第 2 章 市场现状"
|
||||
- ✓ "第 2 章 中国 GLP-1 市场 2025 年已跨越 10 亿美元门槛,增速仍在加速"
|
||||
|
||||
**节标题即子判断**(强制):
|
||||
- ✗ "2.1 竞争格局"
|
||||
- ✓ "2.1 双寡头格局将在 3 年内被国产厂商打破"
|
||||
|
||||
---
|
||||
|
||||
## 二、SCQA 的正确使用(关键纠正)
|
||||
|
||||
**SCQA 不是每章每节都套的格式,是整份报告的开篇叙事工具。**
|
||||
|
||||
### 允许使用的位置(仅以下三处)
|
||||
|
||||
1. **Executive Summary 开头**(最重要):用 SCQA 引出报告核心命题
|
||||
2. **第 1 章引言**:用 SCQA 建立整份报告的分析框架
|
||||
3. **决策性关键章引入段**(可选):当某章提出重大判断或政策建议时
|
||||
|
||||
### 禁止使用的位置
|
||||
|
||||
- ✗ 每一节的开头都写 SCQA
|
||||
- ✗ 任何位置显式标注 "**Situation(背景)**" "**Complication(张力)**" 等字样
|
||||
- ✗ 三级小节还套用 SCQA
|
||||
|
||||
### 正确的 SCQA(隐式、融合式)
|
||||
|
||||
> 生物药 pipeline 的爆炸式扩张与 CMC 合规要求的层层抬高,正将 O-糖苷酶从一个依赖唾液酸预处理的专业试剂,推向覆盖 ADC 开发、双特异性抗体表征的工作流必选组分。然而,30 年来主导市场的 NEB 经典产品,对唾液酸化底物无活性这一根本局限始终未被突破。这就引出了一个核心问题:当下一代工程酶在 2019-2024 年集中商业化、市场标准正在重构时,后来者的进入窗口是否真实存在?本报告认为,窗口存在,但持续时间不超过 36 个月。
|
||||
|
||||
(这段里有 S/C/Q/A 四个要素,但没有任何显式标注,读起来像一段自然的论述。)
|
||||
|
||||
### 错误的 SCQA(显式标注式)
|
||||
|
||||
> **Situation(背景)**:生物药 pipeline 扩张...
|
||||
> **Complication(张力)**:NEB 经典产品局限...
|
||||
> **Question(问题)**:窗口是否存在?
|
||||
> **Answer(答案)**:本章认为...
|
||||
|
||||
(这种写法是典型的 AI 套路,在最终报告里绝对禁止出现。)
|
||||
|
||||
---
|
||||
|
||||
## 三、MECE(章节划分铁律)
|
||||
|
||||
**Mutually Exclusive, Collectively Exhaustive — 互斥且穷尽。**
|
||||
|
||||
自检:
|
||||
- 如果读者读完第 3 章再读第 5 章,会不会觉得"刚才好像说过这个"?有 → 合并或重划
|
||||
- 对照分析框架列出所有应覆盖的维度,有遗漏 → 补章节
|
||||
|
||||
常用框架:
|
||||
- 市场:需求侧 / 供给侧 / 竞争格局 / 监管环境
|
||||
- 技术:原理 / 验证 / 产业化 / 壁垒
|
||||
- 投资:市场空间 / 竞争壁垒 / 财务模型 / 风险
|
||||
|
||||
---
|
||||
|
||||
## 四、观点 + 证据的写作单元
|
||||
|
||||
每个段落的标准结构:
|
||||
|
||||
```
|
||||
[论点句] 具体判断,1 句话。
|
||||
[证据 1] 根据 <具体来源>,<数据> [src_xxx]。
|
||||
[证据 2] 进一步,<案例/对比> [src_xxx]。
|
||||
[So What] 这意味着 <对上层论点的意义>。
|
||||
```
|
||||
|
||||
### 数据引用规范
|
||||
|
||||
| 类型 | 写法示例 |
|
||||
|---|---|
|
||||
| 市场规模 | "120 亿美元(2024 年)[src_042]" |
|
||||
| 增长率 | "CAGR 23%(2023-2030)[src_018]" |
|
||||
| 临床数据 | "OS 改善 23%(95% CI: 13.8-16.6,p<0.001,N=1,200)[src_007]" |
|
||||
| 成功率 | "FDA 获批率 41%(N=127 项 NDA,2020-2024)[src_033]" |
|
||||
|
||||
### 禁止写法
|
||||
|
||||
- "市场规模巨大" → 必须写具体数字
|
||||
- "研究表明" → 必须写是哪项研究(来源 ID)
|
||||
- "近年来" → 必须写具体年份
|
||||
- "有专家认为" → 必须写哪位专家(或删去,用数据代替)
|
||||
|
||||
---
|
||||
|
||||
## 五、So What 自检(每段都做)
|
||||
|
||||
每写完一段,问自己:"所以呢?这对读者有什么意义?"
|
||||
|
||||
- 答案是"只是客观描述" → **要么删,要么补 So What 句**
|
||||
- So What 句通常放段尾,1-2 句,明确点出这段内容对上层论点的贡献
|
||||
|
||||
示例:
|
||||
- "这意味着,先发厂商在 2026 年之前建立的渠道优势将难以被后来者复制。"
|
||||
- "因此,判断一个 GLP-1 管线的商业价值,给药频率比疗效终点更关键。"
|
||||
|
||||
---
|
||||
|
||||
## 六、报告整体结构(11 件套)
|
||||
|
||||
参考 9MW1911 综合战略报告的组织方式:
|
||||
|
||||
1. **封面**:主标题 + 副标题 + 保密标识 + 编制日期
|
||||
2. **Executive Summary / 执行摘要**(≈800 字):SCQA 开篇 + 核心结论 4 条 + 关键行动优先级
|
||||
3. **Abstract / 摘要**(500-600 字):独立一页,叙事式,面向广义读者
|
||||
4. **Glossary / 术语表**(双语对照)
|
||||
5. **Table of Contents / 目录**
|
||||
6. **正文章节**(8-15 章)
|
||||
7. **结论与建议章**
|
||||
8. **附录**(2-5 个,如 CMC、临床对比、合并症分析)
|
||||
9. **参考文献**([src_xxx] 编号格式)
|
||||
10. **免责声明**
|
||||
11. **版本信息**
|
||||
|
||||
---
|
||||
|
||||
## 七、章节写作 Checklist(每章完成后自检)
|
||||
|
||||
- [ ] 章标题是观点型判断,不是"概述/现状/背景"
|
||||
- [ ] 章首 2-3 段给出结论和逻辑
|
||||
- [ ] 各节互斥且穷尽(MECE)
|
||||
- [ ] 每节标题也是观点型判断
|
||||
- [ ] 每个数字/事实后接 [src_xxx]
|
||||
- [ ] 每段末尾有 So What 句
|
||||
- [ ] 没有显式标注 "S/C/Q/A"
|
||||
- [ ] 没有"巨大/快速/显著/强劲"等无数据形容词
|
||||
- [ ] 没有"本章定位/字数配额/研究员"等调度元数据
|
||||
- [ ] 没有占位符 [待验证](除非确实找不到第二个信源)
|
||||
|
||||
---
|
||||
|
||||
## 八、严禁出现的写作坏习惯(humanizer 已列,此处精简)
|
||||
|
||||
**AI 套话**:随着、不断、深入、值得注意、不难发现、显而易见、具有重要意义、发挥重要作用、显著、巨大、快速发展、在此背景下、综上所述、由此可见、总的来说
|
||||
|
||||
**规避 "是" 的冗余结构**(AI 高频):标志着 / 代表着 / 构成 / 成为 / 跃升为 → 直接用 "是"
|
||||
|
||||
**三段式堆砌**:不要为凑数硬拼"需求侧 / 供给侧 / 政策侧"、"短期 / 中期 / 长期"
|
||||
|
||||
**破折号过用**:长破折号每章不超过 3 处
|
||||
|
||||
**负向平行**:不要"不仅...更..."、"不是...而是..."(偶用可,成段出现不可)
|
||||
|
||||
完整规则见 `skill:humanizer-cn`。
|
||||
@@ -0,0 +1,157 @@
|
||||
---
|
||||
name: method-selection
|
||||
description: Selects the appropriate research framework and analytical tools for biomedical, market, investment, CMC/GMP, clinical, R&D, BD, and management consulting topics instead of defaulting to MECE or McKinsey-style framing.
|
||||
---
|
||||
|
||||
# Method Selection
|
||||
|
||||
Use this skill before Phase 0-1 framing and whenever the user changes the report purpose.
|
||||
|
||||
## Principle
|
||||
|
||||
Do not default to McKinsey/MECE. MECE, SCQA, and pyramid writing are useful communication tools, not universal research methods.
|
||||
|
||||
Select the method based on:
|
||||
|
||||
- report purpose
|
||||
- audience
|
||||
- decision to support
|
||||
- available materials
|
||||
- evidence type
|
||||
- regulatory or scientific risk
|
||||
- output format
|
||||
|
||||
## Method Router
|
||||
|
||||
### Market, investment, or commercial strategy
|
||||
|
||||
Use when the user asks about market opportunity, competition, investment thesis, BD opportunity, pricing, or commercialization.
|
||||
|
||||
Methods and tools:
|
||||
|
||||
- market sizing: TAM/SAM/SOM, bottom-up demand model, volume-price bridge
|
||||
- competitive landscape: segmentation, product differentiation, launch timing, share shifts
|
||||
- value chain: upstream supply, manufacturing bottlenecks, channel economics
|
||||
- investment: thesis tree, scenario analysis, sensitivity analysis, risk-adjusted NPV where feasible
|
||||
- transaction/BD: deal comps, licensing terms, patent cliff, strategic fit
|
||||
|
||||
Outputs:
|
||||
|
||||
- market map
|
||||
- competitor table
|
||||
- assumptions ledger
|
||||
- upside/base/downside scenarios
|
||||
|
||||
### Clinical, translational, or evidence review
|
||||
|
||||
Use when the topic is efficacy, safety, trial design, disease area, standard of care, biomarker, or clinical development.
|
||||
|
||||
Methods and tools:
|
||||
|
||||
- PICO or PICOTS framing
|
||||
- evidence hierarchy
|
||||
- endpoint and comparator analysis
|
||||
- trial design critique
|
||||
- TPP and go/no-go criteria
|
||||
- benefit-risk assessment
|
||||
|
||||
Outputs:
|
||||
|
||||
- clinical evidence matrix
|
||||
- trial landscape
|
||||
- endpoint comparability table
|
||||
- evidence gaps and patient-selection risks
|
||||
|
||||
### CMC, GMP, quality, or manufacturing operations
|
||||
|
||||
Use when the topic involves process development, tech transfer, validation, inspection readiness, deviations, CAPA, sterility assurance, supply chain, or manufacturing risk.
|
||||
|
||||
Methods and tools:
|
||||
|
||||
- ICH / FDA / EMA / NMPA regulatory baseline mapping
|
||||
- gap assessment
|
||||
- FMEA or risk matrix
|
||||
- process validation lifecycle
|
||||
- control strategy mapping
|
||||
- deviation/CAPA effectiveness review
|
||||
- data integrity assessment
|
||||
|
||||
Outputs:
|
||||
|
||||
- gap register
|
||||
- risk heatmap
|
||||
- CAPA prioritization
|
||||
- control strategy map
|
||||
- readiness scorecard
|
||||
|
||||
### R&D feasibility or technology assessment
|
||||
|
||||
Use when the topic asks whether a technology, target, modality, platform, assay, or process is feasible.
|
||||
|
||||
Methods and tools:
|
||||
|
||||
- technology readiness level
|
||||
- critical path analysis
|
||||
- mechanism and modality fit
|
||||
- experiment roadmap
|
||||
- scale-up risk assessment
|
||||
- IP and freedom-to-operate screening
|
||||
|
||||
Outputs:
|
||||
|
||||
- feasibility scorecard
|
||||
- key experiments
|
||||
- kill criteria
|
||||
- technical risk register
|
||||
|
||||
### Management, organization, or operating model
|
||||
|
||||
Use when the topic involves organization, governance, operating cadence, capability building, performance management, or transformation.
|
||||
|
||||
Methods and tools:
|
||||
|
||||
- issue tree
|
||||
- operating model design
|
||||
- RACI / decision rights
|
||||
- KPI tree
|
||||
- process maturity assessment
|
||||
- change management roadmap
|
||||
|
||||
Outputs:
|
||||
|
||||
- operating model options
|
||||
- capability gap assessment
|
||||
- implementation roadmap
|
||||
- KPI and governance model
|
||||
|
||||
### Policy, regulation, or access environment
|
||||
|
||||
Use when the topic asks about policy, reimbursement, regulatory pathways, pricing access, or regional rules.
|
||||
|
||||
Methods and tools:
|
||||
|
||||
- policy timeline
|
||||
- stakeholder map
|
||||
- regulatory pathway comparison
|
||||
- access and reimbursement framework
|
||||
- scenario analysis by jurisdiction
|
||||
|
||||
Outputs:
|
||||
|
||||
- jurisdiction comparison
|
||||
- policy impact map
|
||||
- regulatory milestone table
|
||||
- access risks
|
||||
|
||||
## Phase 0-1 Output Requirements
|
||||
|
||||
Write a method decision note in `phase1/research_brief.md`:
|
||||
|
||||
- selected method
|
||||
- why it fits
|
||||
- methods rejected and why
|
||||
- evidence types needed
|
||||
- search routes
|
||||
- expected output artifacts
|
||||
|
||||
If the topic spans multiple scenarios, combine methods explicitly and define which chapters use which method.
|
||||
@@ -0,0 +1,266 @@
|
||||
---
|
||||
name: output-hygiene
|
||||
description: 报告输出卫生检查。禁止词清单(调度元数据、占位符残留、待验证标注)、格式异常检测、参考文献完整性校验。dr-polisher 在润色最后一步必跑;dr-reporter 出稿前复查一次。
|
||||
---
|
||||
|
||||
# 输出卫生清单(Output Hygiene Checklist)
|
||||
|
||||
## 目的
|
||||
|
||||
拦截"调度元数据"和"中间产物残留"进入最终报告。9MW1911 那份报告之所以干净,是因为过滤掉了一切过程性内容,只留最终成品。
|
||||
|
||||
---
|
||||
|
||||
## 一、禁止出现在最终报告正文中的字样(元数据黑名单)
|
||||
|
||||
以下字符串在 final.md / final_zh.md / final_en.md 里**一旦出现即为缺陷**,dr-polisher 必须清除:
|
||||
|
||||
### A. 调度元数据
|
||||
|
||||
- `章节定位`
|
||||
- `字数配额`
|
||||
- `研究员:dr-analyst`
|
||||
- `研究员:dr-searcher`
|
||||
- `生成时间:2026-`(Year-MM 生成日期只在版本信息页出现一次)
|
||||
- `P0 核心章` / `P1` / `P2`(这些是内部分级,不给读者看)
|
||||
- `dr-plan` / `dr-pm` / `dr-analyst` / `dr-verifier` / `dr-chief-editor` / `dr-editor-in-chief` / `dr-polisher` / `dr-reporter` / `dr-translator`
|
||||
- `Phase 1` / `Phase 2` / `Phase 3` / `Phase 4`(除非在"方法论说明"附录讨论研究流程时)
|
||||
|
||||
### B. 占位符残留
|
||||
|
||||
- `[由 dr-reporter 自动生成]`
|
||||
- `[待填]` / `[TBD]` / `[TODO]`
|
||||
- `<slug>` / `<topic>` / `<N>` / `<X>` 等模板占位符
|
||||
- `{{ ... }}` / `${...}` 变量语法残留
|
||||
|
||||
### C. 中间产物引用
|
||||
|
||||
- `参考信源:[src_101] –[src_120] (详见 sources.jsonl ch02 条目)`
|
||||
- `详见 phase2/evidence/chXX-evidence.md`
|
||||
- `详见 sources.jsonl`
|
||||
- `本章信源索引:...(详见 ...)`
|
||||
- `⚠️ 待验证` / `⚠️ [待验证]`(这是过程性标注;如必须保留某个"存疑观点"的提示,应改为正式语言如"该数据仅有 X 个来源支持,建议人工核实")
|
||||
|
||||
### D. 研究思路泄漏
|
||||
|
||||
- `研究思路:`
|
||||
- `核心研究问题:`
|
||||
- `初步假设:`
|
||||
- `预期信源:`
|
||||
- `预期篇幅:`
|
||||
|
||||
这些是 framework.md 里给 dr-analyst 看的规划信息,不能出现在读者版。
|
||||
|
||||
### E. Agent 交付汇报语
|
||||
|
||||
- `产出:` / `完成后返回:`
|
||||
- `任务:` / `硬性要求:`
|
||||
- `必读 skill:`
|
||||
- `章节小结:` (改为自然段落收尾)
|
||||
|
||||
---
|
||||
|
||||
## 二、格式异常检测
|
||||
|
||||
### F. SCQA 显式标注(已禁止的机械模式)
|
||||
|
||||
以下组合**不应在最终报告中成对出现**(用 grep 扫):
|
||||
- `**Situation(背景)**` + `**Complication(张力)**`
|
||||
- `**S(背景)**` + `**C(挑战)**` + `**Q(问题)**` + `**A(答案)**`
|
||||
- `Answer-First` 显式标注
|
||||
- `**核心结论(Answer-First)**`
|
||||
|
||||
SCQA 要写得隐式融合(见 mckinsey-method skill)。
|
||||
|
||||
### G. 三级以上嵌套标题乱用
|
||||
|
||||
正文正式章节标题不要超过 3 级:
|
||||
- `# 第 X 章` (报告级)
|
||||
- `## X.Y 节` (章内节)
|
||||
- `### X.Y.Z 小节` (节内小节)
|
||||
|
||||
禁止 `####` `#####` `######`。如果需要 4 级以上,重新组织结构。
|
||||
|
||||
### H. 引用格式不统一
|
||||
|
||||
所有引用统一 `[src_XXX]` 格式(3 位数字)。禁止混用:
|
||||
- `[src_1]`(没补零)
|
||||
- `[source_001]`(变形)
|
||||
- `(src_001)`(圆括号)
|
||||
- `[ref_1]` / `[r1]`(其他简写)
|
||||
|
||||
### I. 中英文标点混用
|
||||
|
||||
中文正文里的标点应是**中文标点**:
|
||||
- `,` 不是 `,`
|
||||
- `。` 不是 `.`
|
||||
- `;` 不是 `;`
|
||||
- `:` 不是 `:`
|
||||
- `"..."` 不是 `"..."`(除了直接引用英文)
|
||||
- `(...)` 不是 `(...)`
|
||||
|
||||
例外:行内英文术语、代码、URL、数据单位前后保持英文标点合理。
|
||||
|
||||
### J. Emoji(强制禁用)
|
||||
|
||||
**正文与表格中严禁使用任何 emoji / 彩色符号**:
|
||||
|
||||
禁用清单(但不限于):
|
||||
`✅ ❌ ✔ ✖ 🔶 🔷 ⭐ 🟢 🔴 🟡 🟠 ⚠️ ⚠ 💡 📌 🔑 📊 📈 📉 🔥 ✨ 🎯 🎉 ➔ ➜`
|
||||
|
||||
**原因**:PDF 使用的思源字体子集不包含这些字符的 glyph,渲染为空白方框(□)。
|
||||
|
||||
**替代写法**:
|
||||
- 表格标记"有/无":用 `✓` `×`(思源字体支持)或中文字 `是` / `否`
|
||||
- 强调状态:用 `◆` `●` 等几何符号(字体支持)
|
||||
- 警示:用 `注:` `警告:` `※` 等文字前缀
|
||||
- 重点:用 **粗体** 或引用块,不用 emoji
|
||||
|
||||
扫描命令:
|
||||
```bash
|
||||
python3 -c "
|
||||
import re
|
||||
txt = open('final_zh_polished.md').read()
|
||||
pat = re.compile(r'[\u2700-\u27BF]|[\U0001F300-\U0001F9FF]|[\u2B00-\u2BFF]')
|
||||
hits = [(i, m.group()) for i, m in enumerate(pat.finditer(txt))]
|
||||
print(f'emoji 命中:{len(hits)} 处')
|
||||
for i, c in hits[:10]:
|
||||
print(f' 位置 {i}: {c!r} (U+{ord(c):04X})')
|
||||
"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、参考文献完整性校验(最关键)
|
||||
|
||||
dr-reporter 出稿前**必须**执行:
|
||||
|
||||
```bash
|
||||
# 1. 从 final.md 提取所有引用的 src_id
|
||||
grep -oE '\[src_[0-9]+\]' projects/<slug>/phase4/final.md | sort -u > /tmp/cited.txt
|
||||
|
||||
# 2. 从 citations.md / sources.jsonl 提取所有已登记的 src_id
|
||||
grep -oE 'src_[0-9]+' projects/<slug>/phase4/citations.md | sort -u > /tmp/registered.txt
|
||||
# 或从 sources.jsonl
|
||||
python3 -c "
|
||||
import json
|
||||
with open('projects/<slug>/phase2/sources.jsonl') as f:
|
||||
for line in f:
|
||||
d = json.loads(line)
|
||||
print(d['id'])
|
||||
" | sort -u > /tmp/registered.txt
|
||||
|
||||
# 3. 差集:cited 里有但 registered 里没有 → 严重错误
|
||||
comm -23 /tmp/cited.txt <(sed 's/[][]//g' /tmp/registered.txt) > /tmp/missing.txt
|
||||
|
||||
# 4. 反向差集:registered 有但从未被 cited → 孤立信源,可剔除
|
||||
comm -13 /tmp/cited.txt <(sed 's/[][]//g' /tmp/registered.txt) > /tmp/orphan.txt
|
||||
```
|
||||
|
||||
### 处理规则
|
||||
|
||||
- 有 missing 信源(引用了但无记录)→ **致命错误**,dr-reporter 拒绝出稿,抛回上游排查
|
||||
- 有 orphan 信源(有记录但未被引用)→ 警告,从 citations.md 剔除
|
||||
- final.md 里的"参考文献"段落**必须包含完整的编号清单**,不能是 `[由 dr-reporter 自动生成]` 之类的占位符
|
||||
- 如果 final.md 的参考文献段落是占位符 → 读 citations.md 内容回填
|
||||
|
||||
---
|
||||
|
||||
## 四、标题规范
|
||||
|
||||
### 章标题
|
||||
|
||||
- 观点型判断句,不是"概述/现状/背景"
|
||||
- 长度 15-40 字(中)/ 10-25 词(英)
|
||||
- 不以动词开头(如"分析/探讨/研究"),改为判断句
|
||||
|
||||
**反例**:
|
||||
- 第 2 章 分析中国 GLP-1 市场的现状
|
||||
- 第 3 章 探讨 NEB 产品的竞争优势
|
||||
|
||||
**正例**:
|
||||
- 第 2 章 中国 GLP-1 市场 2025 年已跨越 10 亿美元门槛
|
||||
- 第 3 章 NEB 的 30 年专利丛林将在 2028 年后开始瓦解
|
||||
|
||||
### 节标题
|
||||
|
||||
- 同样要求观点型
|
||||
- 长度 10-25 字 / 8-15 词
|
||||
- 禁止 `2.1 背景 / 2.2 现状 / 2.3 趋势` 这种模板化结构
|
||||
|
||||
---
|
||||
|
||||
## 五、图表与数据卫生
|
||||
|
||||
### 表格
|
||||
|
||||
- 表头第一行要有单位(金额 USD / 百分比 % / 年份等)
|
||||
- 所有数据有来源标注(行内 [src_xxx] 或表脚注)
|
||||
- 避免超过 10 列宽表(PDF 会被截断)
|
||||
|
||||
### 图表标题
|
||||
|
||||
格式:`图 X-Y:<内容描述>(数据来源:[src_xxx])`
|
||||
|
||||
### 数字规范
|
||||
|
||||
- 阿拉伯数字 + 中文量词:`12 项研究` / `3.2 亿元`
|
||||
- 大数字三位分节:`12,000` 而非 `12000`
|
||||
- 百分比带 `%`,不写"百分之十二"
|
||||
- 时间范围用连字符:`2020-2025 年` 不是 `2020 至 2025 年`
|
||||
|
||||
---
|
||||
|
||||
## 六、自动化检查脚本(dr-polisher / dr-reporter 必跑)
|
||||
|
||||
```python
|
||||
# hygiene_check.py
|
||||
import re, sys
|
||||
|
||||
BLACKLIST_ZH = [
|
||||
"章节定位", "字数配额", "研究员:dr-",
|
||||
"P0 核心章", "P1 主干章", "P2 辅助章",
|
||||
"Phase 1", "Phase 2", "Phase 3", "Phase 4",
|
||||
"dr-plan", "dr-pm", "dr-analyst", "dr-verifier",
|
||||
"dr-chief-editor", "dr-editor-in-chief", "dr-polisher",
|
||||
"dr-reporter", "dr-translator",
|
||||
"[由 dr-reporter 自动生成]", "[待填]", "[TBD]", "[TODO]",
|
||||
"详见 phase2/", "详见 sources.jsonl",
|
||||
"本章信源索引", "⚠️ 待验证", "⚠️ [待验证]",
|
||||
"**Situation(背景)**", "**Complication(张力)**",
|
||||
"**Question(问题)**", "**Answer(答案)**",
|
||||
"**S(背景)**", "**C(挑战)**",
|
||||
"Answer-First", "核心结论(Answer-First)",
|
||||
"研究思路:", "核心研究问题:", "初步假设:",
|
||||
"预期信源:", "预期篇幅:",
|
||||
"硬性要求:", "必读 skill:", "产出:",
|
||||
]
|
||||
|
||||
path = sys.argv[1]
|
||||
text = open(path, encoding='utf-8').read()
|
||||
issues = []
|
||||
for pattern in BLACKLIST_ZH:
|
||||
if pattern in text:
|
||||
count = text.count(pattern)
|
||||
issues.append(f" × '{pattern}' 出现 {count} 次")
|
||||
|
||||
if issues:
|
||||
print(f"{path} 存在 {len(issues)} 项卫生问题:")
|
||||
for i in issues:
|
||||
print(i)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print(f"{path} 输出卫生检查通过")
|
||||
sys.exit(0)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、硬规则
|
||||
|
||||
1. ✅ dr-polisher 润色的最后一步跑 hygiene_check
|
||||
2. ✅ dr-reporter 出稿前再跑一次 hygiene_check + 参考文献完整性校验
|
||||
3. ✅ 任何禁止词残留都必须修正,不能"放过一马"
|
||||
4. ✅ 参考文献段落必须包含完整编号清单,不允许占位符
|
||||
5. ❌ 禁止把"⚠️ 待验证"这种过程标注留到读者版
|
||||
6. ❌ 禁止三级以上嵌套标题
|
||||
@@ -0,0 +1,303 @@
|
||||
---
|
||||
name: pdf-reportlab
|
||||
description: 用 ReportLab 生成专业中文 PDF 研究报告。集中样式管理、紧凑分页(widows/orphans/keepWithNext)、颜色层次、封面保密标识、页眉页脚简洁化。基于 9MW1911 综合战略报告的编排参考。
|
||||
---
|
||||
|
||||
# ReportLab 中文 PDF 模板使用指南(v0.5)
|
||||
|
||||
## 一、为什么是 ReportLab
|
||||
|
||||
- **完全可控**:每个字号、行距、颜色由代码说了算,不被引擎意外改动
|
||||
- **中文字体一次搞定**:`pdfmetrics.registerFont` 注册后全局可用,子集嵌入 PDF,无授权问题
|
||||
- **分页规则精确**:支持 widows/orphans、keepWithNext、splitByRow 等避免孤行/寡行
|
||||
- **图表嵌入高质量**:matplotlib 300 DPI PNG,速度快
|
||||
- **样式集中在 StyleSheet**:避免字号不一
|
||||
|
||||
---
|
||||
|
||||
## 二、模板入口
|
||||
|
||||
脚本:`.opencode/templates/report-template.py`
|
||||
|
||||
调用:
|
||||
```bash
|
||||
uv run python .opencode/templates/report-template.py \
|
||||
--input projects/<slug>/phase4/final.md \
|
||||
--manifest projects/<slug>/manifest.json \
|
||||
--output projects/<slug>/phase4/final.pdf \
|
||||
--fonts-dir .opencode/templates/fonts
|
||||
```
|
||||
|
||||
首次使用前:
|
||||
```bash
|
||||
bash .opencode/templates/fonts/download-fonts.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、字体注册(7 个字重)
|
||||
|
||||
```
|
||||
SrcSerif-Regular 思源宋体 Regular 正文
|
||||
SrcSerif-Bold 思源宋体 Bold 正文粗体
|
||||
SrcSans-Light 思源黑体 Light 页眉页脚
|
||||
SrcSans-Medium 思源黑体 Medium 三级标题/图表
|
||||
SrcSans-Bold 思源黑体 Bold 一二级标题
|
||||
SrcSans-Heavy 思源黑体 Heavy 封面大标题
|
||||
Kai 霞鹜文楷 Regular 摘要/引文
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、样式表(StyleSheet,集中管理)
|
||||
|
||||
| 样式名 | 字体 | 字号 | 行高 | 颜色 | 备注 |
|
||||
|---|---|---|---|---|---|
|
||||
| `body` | SrcSerif | 10.5 | 18 | `#1a1a1a` | 正文,首行缩进 21pt |
|
||||
| `body-bold` | SrcSerif-Bold | 10.5 | 18 | `#1a1a1a` | 行内加粗 |
|
||||
| `h1` | SrcSans-Bold | 18 | 28 | `#1e3a8a` | 章标题,前强制分页 |
|
||||
| `h2` | SrcSans-Bold | 14 | 22 | `#2c5282` | 节标题 |
|
||||
| `h3` | SrcSans-Medium | 12 | 18 | `#374151` | 小节标题 |
|
||||
| `quote` | Kai | 10.5 | 18 | `#4b5563` | 引文 |
|
||||
| `caption` | SrcSans-Medium | 9 | 13 | `#6b7280` | 图表标题 |
|
||||
| `footnote` | SrcSerif | 9 | 13 | `#374151` | 脚注/参考文献 |
|
||||
| `header-footer` | SrcSans-Light | 8 | 12 | `#9ca3af` | 页眉页脚 |
|
||||
| `cover-title` | SrcSans-Heavy | 28 | 40 | `#0f172a` | 封面主标题 |
|
||||
| `cover-subtitle` | SrcSans-Medium | 15 | 24 | `#475569` | 封面副标题 |
|
||||
| `cover-confidential` | SrcSans-Bold | 11 | 16 | `#dc2626` | 封面保密标识(红色)|
|
||||
| `cover-meta` | SrcSerif | 11 | 18 | `#334155` | 封面元信息 |
|
||||
| `summary` | SrcSerif | 11 | 20 | `#1a1a1a` | 执行摘要 |
|
||||
|
||||
---
|
||||
|
||||
## 五、分页规则(关键升级点)
|
||||
|
||||
### 章(h1)
|
||||
|
||||
- `pageBreakBefore=1`(每章新起一页)
|
||||
- `keepWithNext=1`(标题和下一段不分离)
|
||||
|
||||
### 节(h2)
|
||||
|
||||
- **禁止单独触发分页**
|
||||
- `keepWithNext=1`(标题紧跟内容)
|
||||
|
||||
### 小节(h3)
|
||||
|
||||
- 同 h2,`keepWithNext=1`
|
||||
|
||||
### 段落
|
||||
|
||||
- `widows=2, orphans=2`(避免寡行/孤行)
|
||||
- 每段之间 `spaceBefore=6, spaceAfter=6`
|
||||
|
||||
### 表格
|
||||
|
||||
- `TableStyle` 中启用 `splitByRow=True`(长表格按行分页)
|
||||
- `repeatRows=1`(表头在分页后重复)
|
||||
- 单元格 padding 统一 4-6pt
|
||||
|
||||
### 摘要/术语表/目录/参考文献
|
||||
|
||||
- 每个独占起始页(用 `PageBreak`)
|
||||
|
||||
---
|
||||
|
||||
## 六、封面模板(参考 9MW1911)
|
||||
|
||||
封面独立一页,无页眉页脚,布局:
|
||||
|
||||
```
|
||||
(上 30% 空白)
|
||||
|
||||
主标题(cover-title,黑色,居中)
|
||||
副标题(cover-subtitle,深灰,居中)
|
||||
|
||||
(中部 40% 空白)
|
||||
|
||||
[机密 | 仅供 XX 内部决策使用] (cover-confidential,红色,居中)
|
||||
|
||||
(下部 20%)
|
||||
|
||||
类型:研究类
|
||||
作者:Deep Research 系统 / <公司名>
|
||||
编制日期:YYYY 年 M 月
|
||||
版本:v1.0
|
||||
```
|
||||
|
||||
字段来源:
|
||||
- `manifest.report_title` / `report_subtitle`
|
||||
- `manifest.confidentiality` (如 "机密 | 仅供迈威生物内部决策使用")
|
||||
- `manifest.author` / `manifest.date` / `manifest.version`
|
||||
|
||||
---
|
||||
|
||||
## 七、页眉页脚(简洁化)
|
||||
|
||||
### 页眉
|
||||
|
||||
左边:报告简称(从 `manifest.report_title` 取前 15 字)
|
||||
右边:章节名(动态,从当前 h1 内容取)
|
||||
底线:`#e5e7eb` 浅灰分隔线
|
||||
|
||||
### 页脚
|
||||
|
||||
居中:页码(格式 `— X —`)
|
||||
字号:8pt,`#9ca3af` 浅灰
|
||||
|
||||
### 特殊页
|
||||
|
||||
- 封面:无页眉页脚
|
||||
- 免责声明:无页眉,仅页脚
|
||||
- 其他(摘要/术语表/目录/正文/附录/参考文献):有页眉页脚
|
||||
|
||||
---
|
||||
|
||||
## 八、报告结构(11 件套)
|
||||
|
||||
ReportLab 按以下顺序组装:
|
||||
|
||||
1. **封面**(cover PageTemplate)
|
||||
2. **免责声明**(normal PageTemplate,单页)
|
||||
3. **Executive Summary / 执行摘要**(summary PageTemplate,1-2 页)
|
||||
4. **Abstract / 摘要**(normal,单页)
|
||||
5. **Glossary / 术语表**(normal)
|
||||
6. **Table of Contents / 目录**(TOC,自动生成)
|
||||
7. **正文各章**(normal,每章 h1 强制分页)
|
||||
8. **结论与建议**(正文的一部分)
|
||||
9. **附录**(normal)
|
||||
10. **参考文献**(bibliography PageTemplate,footnote 样式)
|
||||
11. **版本信息**(normal,单页)
|
||||
|
||||
---
|
||||
|
||||
## 九、Markdown 支持范围
|
||||
|
||||
| Markdown | ReportLab 渲染 |
|
||||
|---|---|
|
||||
| `# 第 X 章 ...` | h1(新起一页,深蓝色)|
|
||||
| `## X.Y ...` | h2(节,蓝色,不分页)|
|
||||
| `### X.Y.Z ...` | h3(小节,深灰)|
|
||||
| `**粗体**` | inline `<b>` |
|
||||
| `*斜体*` | inline `<i>` |
|
||||
| `` `代码` `` | 等宽字体 |
|
||||
| `> 引文` | quote 样式(楷体,浅底色)|
|
||||
| `- 项` / `1. 项` | 项目符号列表 |
|
||||
| 表格 `\| \| \|` | Table,自动列宽 + splitByRow |
|
||||
| `` | 图片 + caption 样式 |
|
||||
| `[src_001]` | 上标引用 |
|
||||
| `---` | 分页符 |
|
||||
|
||||
**不支持**:HTML 标签、数学公式、代码块高亮。
|
||||
|
||||
---
|
||||
|
||||
## 十、图表嵌入
|
||||
|
||||
不用 ReportLab 原生绘图,全部预渲染为 PNG:
|
||||
|
||||
```python
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.font_manager as fm
|
||||
|
||||
font_path = '.opencode/templates/fonts/SourceHanSansSC-Medium.otf'
|
||||
fm.fontManager.addfont(font_path)
|
||||
plt.rcParams['font.family'] = 'Source Han Sans SC'
|
||||
plt.rcParams['axes.unicode_minus'] = False
|
||||
|
||||
fig, ax = plt.subplots(figsize=(6, 4), dpi=300)
|
||||
# ...
|
||||
plt.savefig('projects/<slug>/phase4/figures/fig_01_XXX.png', dpi=300, bbox_inches='tight')
|
||||
```
|
||||
|
||||
Markdown 中引用:`![图 1-1:2020-2025 GLP-1 市场规模(数据来源:[src_042])](figures/fig_01_XXX.png)`
|
||||
|
||||
---
|
||||
|
||||
## 十一、manifest 必需字段
|
||||
|
||||
```json
|
||||
{
|
||||
"slug": "...",
|
||||
"report_title": "自研 O-糖苷酶立项可行性研究报告",
|
||||
"report_subtitle": "对标 NEB 与 Merck 经典产品的技术路径、IP 壁垒与差异化战略",
|
||||
"confidentiality": "机密 | 仅供内部决策使用",
|
||||
"author": "Deep Research 系统",
|
||||
"date": "2026-04-21",
|
||||
"version": "1.0",
|
||||
"type": "研究类",
|
||||
"disclaimer": "本报告基于公开信息与 AI 辅助研究生成,仅供参考..."
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 十二、常见坑与对策
|
||||
|
||||
| 坑 | 对策 |
|
||||
|---|---|
|
||||
| 中文字号不一 | 集中 StyleSheet,不在 Paragraph 里 inline 改 fontSize |
|
||||
| 行距太挤 | 行高 = 字号 × 1.5~1.7 |
|
||||
| 换行断错 | `wordWrap='CJK'` 必设 |
|
||||
| 表格被截断 | `splitByRow=True, repeatRows=1` |
|
||||
| 标题孤行(页末一个标题后直接新页)| `keepWithNext=1` |
|
||||
| 段落寡行(末段只剩一行在下页)| `widows=2, orphans=2` |
|
||||
| 图片变形 | 先 matplotlib 出 300 DPI PNG,再 `Image(path, width=..., kind="proportional")` |
|
||||
| 生成慢 | matplotlib 图表预渲染,不要在 PDF 生成阶段现算 |
|
||||
| 参考文献丢失 | dr-reporter 出稿前检查:读 citations.md,确认内容已写入 final.md |
|
||||
|
||||
---
|
||||
|
||||
## 十三、dr-reporter 调用流程
|
||||
|
||||
```
|
||||
1. 环境检查
|
||||
- 字体 ≥6 个 OTF 文件
|
||||
- final.md 存在
|
||||
- manifest.json 有必需字段
|
||||
|
||||
2. 回填参考文献(关键步骤,修复 v0.4 的 bug)
|
||||
- 读 citations.md 内容
|
||||
- 在 final.md 中找到"## 参考文献"段落
|
||||
- 如果段落内容是占位符(如 "[由 dr-reporter 自动生成]" 或为空)
|
||||
→ 替换为 citations.md 的完整内容
|
||||
- 写回 final.md
|
||||
|
||||
3. 图表检查
|
||||
- 扫描 final.md 中所有  图片引用
|
||||
- 验证每个 path 在 figures/ 目录下存在
|
||||
- 缺失图片 → 警告并继续,但汇报中注明
|
||||
|
||||
4. 生成 PDF
|
||||
uv run python .opencode/templates/report-template.py \
|
||||
--input projects/<slug>/phase4/final.md \
|
||||
--manifest projects/<slug>/manifest.json \
|
||||
--output projects/<slug>/phase4/final.pdf \
|
||||
--fonts-dir .opencode/templates/fonts
|
||||
|
||||
5. 生成 DOCX(可选)
|
||||
pandoc projects/<slug>/phase4/final.md \
|
||||
--from markdown --to docx \
|
||||
--output projects/<slug>/phase4/final.docx \
|
||||
--toc --toc-depth=3
|
||||
|
||||
6. 验证
|
||||
- PDF 文件大小 > 500KB(太小说明字体没嵌)
|
||||
- PDF 页数合理(按字数估算)
|
||||
- "参考文献"章节存在且非空
|
||||
|
||||
7. 汇报
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 十四、输出卫生检查(必跑)
|
||||
|
||||
生成 PDF 前:
|
||||
|
||||
```bash
|
||||
# 加载 skill:output-hygiene
|
||||
python3 .opencode/templates/hygiene_check.py projects/<slug>/phase4/final.md
|
||||
```
|
||||
|
||||
禁止词残留 → 抛回 dr-polisher 再润色一轮。
|
||||
@@ -0,0 +1,212 @@
|
||||
---
|
||||
name: research-quality-gates
|
||||
description: Applies stage gates for Antigravity-native Deep Research: search receipts, source access, claims ledger, triangulation, contradiction search, continuation state, and final assembly checks.
|
||||
---
|
||||
|
||||
# Research Quality Gates
|
||||
|
||||
Use this skill after every phase boundary and before any user-facing "done" claim. It is designed for Antigravity-native runs where model work happens inside Antigravity, while this repository provides the evidence discipline.
|
||||
|
||||
## Core Principle
|
||||
|
||||
Evidence must persist outside the model context. A claim is not verified because the model remembers it, summarized it, or saw it in a search snippet. It is verified only when the artifact trail contains:
|
||||
|
||||
1. a search receipt,
|
||||
2. an opened original source or explicit access failure,
|
||||
3. a registered `source_id`,
|
||||
4. an evidence span or data locator,
|
||||
5. a claim-ledger record linking the claim to supporting and counter evidence.
|
||||
|
||||
## Required Artifacts
|
||||
|
||||
Create these files when the relevant phase begins. Empty files are acceptable at creation time, but they must be populated before the phase gate passes.
|
||||
|
||||
| Phase | Artifact | Purpose |
|
||||
|---|---|---|
|
||||
| Phase 1 | `phase1/method_decision.md` | Selected method, rejected methods, evidence types, and search routes. |
|
||||
| Phase 1 | `phase1/assumptions.md` | Material assumptions and scope assumptions that need validation. |
|
||||
| Phase 2 | `phase2/search_log.jsonl` | One row per search/open/extract action. |
|
||||
| Phase 2 | `phase2/sources.jsonl` | Stable source registry with scores and tiers. |
|
||||
| Phase 2 | `phase2/rejected_sources.jsonl` | Rejected or low-quality sources with reasons. |
|
||||
| Phase 2 | `phase2/claims_ledger.jsonl` | Atomic factual and analytical claims with verification status. |
|
||||
| Phase 2 | `phase2/coverage_matrix.md` | Coverage of questions, chapters, methods, and evidence gaps. |
|
||||
| Phase 2 | `phase2/unsupported_claims.md` | Claims that could not be verified or need user-visible caveats. |
|
||||
| All phases | `continuation_state.json` | Current phase, completed sections, artifact paths, open gaps, and next actions. |
|
||||
| Phase 4 | `phase4/final_fact_check.md` | Final audit showing each core fact exists in the verified claim ledger. |
|
||||
|
||||
## Search Receipt Gate
|
||||
|
||||
Every search or retrieval action must write a row to `search_log.jsonl`.
|
||||
|
||||
Required fields:
|
||||
|
||||
```json
|
||||
{
|
||||
"receipt_id": "srch_0001",
|
||||
"timestamp": "YYYY-MM-DDTHH:MM:SSZ",
|
||||
"tool": "search-cli|browser|project-search|other",
|
||||
"mode": "academic|scholar|patents|news|extract|general|deep",
|
||||
"query_or_url": "...",
|
||||
"purpose": "which task/card/chapter this supports",
|
||||
"result_count": 10,
|
||||
"opened_urls": ["https://..."],
|
||||
"status": "ok|partial|failed",
|
||||
"failure_reason": null
|
||||
}
|
||||
```
|
||||
|
||||
Gate fails if a model says it searched, confirmed, checked, extracted, opened, or verified a fact without a corresponding receipt.
|
||||
|
||||
## Source Access Gate
|
||||
|
||||
For any source used as evidence, `sources.jsonl` must record access status.
|
||||
|
||||
Required additional fields:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "src_042",
|
||||
"search_receipt_ids": ["srch_0001"],
|
||||
"raw_url": "https://...",
|
||||
"canonical_url": "https://...",
|
||||
"title": "...",
|
||||
"publication_date": "YYYY-MM-DD",
|
||||
"source_type": "paper|regulator|trial_registry|patent|filing|database|consulting|media|other",
|
||||
"tier": 1,
|
||||
"score": 8.6,
|
||||
"access_status": "opened_original|opened_abstract|paywalled|failed|snippet_only",
|
||||
"evidence_locator": "page/table/section/trial id/patent claim",
|
||||
"independence_cluster": "cluster_...",
|
||||
"notes": "..."
|
||||
}
|
||||
```
|
||||
|
||||
`snippet_only` sources cannot support final claims. Paywalled or abstract-only sources can be used only with a visible caveat or a second opened source that carries the same fact.
|
||||
|
||||
## Claim Ledger Gate
|
||||
|
||||
Each chapter draft must be backed by `claims_ledger.jsonl`. Store atomic claims, not paragraphs.
|
||||
|
||||
Required fields:
|
||||
|
||||
```json
|
||||
{
|
||||
"claim_id": "ch03_C012",
|
||||
"chapter": "ch03",
|
||||
"claim_type": "fact|trend|comparison|causal|forecast|recommendation",
|
||||
"claim": "...",
|
||||
"supporting_source_ids": ["src_042", "src_087"],
|
||||
"counter_source_ids": ["src_103"],
|
||||
"evidence_spans": [
|
||||
{
|
||||
"source_id": "src_042",
|
||||
"locator": "Table 2",
|
||||
"summary": "..."
|
||||
}
|
||||
],
|
||||
"independence_clusters": ["cluster_a", "cluster_b"],
|
||||
"confidence": "high|medium|low|unsupported",
|
||||
"verification_status": "verified|partially_verified|conflicted|unsupported",
|
||||
"needs_delta_retrieve": false,
|
||||
"visible_caveat_required": false
|
||||
}
|
||||
```
|
||||
|
||||
Gate fails if:
|
||||
|
||||
- a core claim has fewer than 2 independent Tier 1-2 supporting sources;
|
||||
- a claim has source IDs but no evidence locator;
|
||||
- supporting sources all come from the same independence cluster;
|
||||
- a conflicted or unsupported claim is written as a settled conclusion.
|
||||
|
||||
## Triangulation Gate
|
||||
|
||||
Counting URLs is not enough. Sources are independent only when they do not trace back to the same press release, same trial registry entry, same company deck, same sell-side note, or same syndicated article.
|
||||
|
||||
For core conclusions, require at least two of these source families where available:
|
||||
|
||||
- regulator / official registry,
|
||||
- peer-reviewed paper or systematic review,
|
||||
- company filing / annual report / exchange disclosure,
|
||||
- patent or legal record,
|
||||
- independent database,
|
||||
- reputable industry or consulting report,
|
||||
- independent expert or professional media analysis.
|
||||
|
||||
If a field has only one source family available, mark the limitation explicitly in `unsupported_claims.md` and in the report limitations section.
|
||||
|
||||
## Contradiction Gate
|
||||
|
||||
Every chapter requires at least one deliberate counter-search or falsification pass. Record it in `search_log.jsonl` and summarize it in the chapter brief.
|
||||
|
||||
Minimum counter-evidence record:
|
||||
|
||||
```json
|
||||
{
|
||||
"claim_id": "ch03_C012",
|
||||
"counter_query": "...",
|
||||
"counter_source_ids": ["src_103"],
|
||||
"result": "none_found|weak_counter|material_counter",
|
||||
"impact": "keep|qualify|rewrite|delete"
|
||||
}
|
||||
```
|
||||
|
||||
Gate fails if the chapter contains no counter-evidence section, no counter-search receipt, or no decision about how contradictions affected the draft.
|
||||
|
||||
## Coverage Gate
|
||||
|
||||
Before drafting, create `phase2/coverage_matrix.md` with one row per chapter/task axis:
|
||||
|
||||
| Chapter | Method | Core Question | Required Evidence | Found Evidence | Gaps | Decision |
|
||||
|---|---|---|---|---|---|---|
|
||||
|
||||
Gate fails if a chapter is drafted while its method, required evidence, or gaps are blank.
|
||||
|
||||
## Delta-Retrieve Protocol
|
||||
|
||||
When a gap appears, do not patch it from memory. Create a targeted delta task:
|
||||
|
||||
1. write the gap in `coverage_matrix.md` or `claims_ledger.jsonl`;
|
||||
2. run 1-3 targeted searches with explicit query purpose;
|
||||
3. register any usable sources;
|
||||
4. update the relevant claim record;
|
||||
5. if still unsupported, keep the caveat visible.
|
||||
|
||||
Delta retrieval is mandatory when Phase 3 finds a critical evidence gap.
|
||||
|
||||
## Continuation Protocol
|
||||
|
||||
For long reports or interrupted runs, keep `projects/<slug>/continuation_state.json` current.
|
||||
|
||||
Minimum fields:
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "0.20",
|
||||
"slug": "...",
|
||||
"current_phase": "phase2",
|
||||
"active_model": "Gemini 3.1 Pro (Low)",
|
||||
"completed_artifacts": ["phase2/task_cards.json"],
|
||||
"open_gates": ["claim_ledger_gate"],
|
||||
"artifact_paths": {
|
||||
"sources": "phase2/sources.jsonl",
|
||||
"claims": "phase2/claims_ledger.jsonl",
|
||||
"search_log": "phase2/search_log.jsonl"
|
||||
},
|
||||
"open_questions": [],
|
||||
"next_actions": []
|
||||
}
|
||||
```
|
||||
|
||||
Before resuming a project, read this state and the latest artifacts. Do not rely on chat history alone.
|
||||
|
||||
## Final Assembly Gate
|
||||
|
||||
Phase 4 must prove that final facts are a subset of verified claims:
|
||||
|
||||
- Sample at least 20 high-impact facts or all core claims, whichever is smaller.
|
||||
- For each sampled fact, record `claim_id`, `source_ids`, verification status, and final wording decision in `phase4/final_fact_check.md`.
|
||||
- New facts introduced during editing require new search receipts and claim-ledger records.
|
||||
- Delete or caveat any unsupported factual claim before rendering PDF/DOCX.
|
||||
|
||||
Do not render final deliverables until the final assembly gate passes.
|
||||
@@ -0,0 +1,246 @@
|
||||
---
|
||||
name: search-strategy
|
||||
description: 生物医药深度研究的统一检索策略。规定信源优先级金字塔、检索轮次、关键词策略、API 调用顺序,以及何时切换到专业信源。所有做信息收集的 agent(dr-searcher/dr-analyst/dr-verifier/dr-plan)必须加载此技能。
|
||||
---
|
||||
|
||||
# 检索策略总纲(Deep Research 黄金法则)
|
||||
|
||||
## 一、信源优先级金字塔
|
||||
|
||||
**永远从上至下尝试,不要从 Tier 4 开始**:
|
||||
|
||||
```
|
||||
╱ Tier 1 ╲ 最高权重
|
||||
╱ (一手) ╲
|
||||
╱──────────────╲
|
||||
╱ Tier 2 ╲ 标准权重
|
||||
╱ (权威二手) ╲
|
||||
╱──────────────────╲
|
||||
╱ Tier 3 ╲ 辅助权重
|
||||
╱ (预印本/会议/券商) ╲
|
||||
─────────────────────────
|
||||
Tier 4 仅做发现入口
|
||||
(通用搜索 + Wiki)
|
||||
─────────────────────────
|
||||
【黑名单】禁用
|
||||
```
|
||||
|
||||
### Tier 1(优先使用,加权 1.2x)
|
||||
- **论文**:PubMed、Cochrane、顶刊(NEJM/Lancet/Nature/Science/Cell/JAMA/NatMed)
|
||||
- **监管**:FDA/EMA/NMPA/PMDA 官网、openFDA
|
||||
- **临床试验**:ClinicalTrials.gov、ChiCTR、EU CTR
|
||||
- **专利**:USPTO、EPO、CNIPA、Google Patents、PatentsView
|
||||
- **披露**:SEC(10-K/10-Q/S-1)、港交所、沪深交易所年报
|
||||
|
||||
### Tier 2(可用,标准权重)
|
||||
- **咨询**:McKinsey/BCG/Deloitte/IQVIA/Evaluate Pharma/Frost & Sullivan/沙利文
|
||||
- **综述**:系统综述、Cochrane Review、Meta 分析
|
||||
- **协会**:PhRMA、BIO、中国医药工业协会、中国医药创新促进会
|
||||
- **专业媒体**:BioSpace、Endpoints News、FiercePharma、STAT、医药魔方、Insight 数据库
|
||||
|
||||
### Tier 3(辅助,需 Tier 1-2 支撑)
|
||||
- **预印本**:bioRxiv、medRxiv、SSRN(必须标注"未同行评审")
|
||||
- **券商**:中金/中信/高盛/摩根士丹利生物医药(注意利益冲突)
|
||||
- **会议**:AACR/ASCO/ASH/JPM Healthcare Conference 摘要
|
||||
|
||||
### Tier 4(仅做入口)
|
||||
- Tavily / Brave / Exa 返回的普通网页 → **只用来发现 Tier 1-2 URL**,不做结论佐证
|
||||
- Wikipedia → **只做术语理解**,结论不得引用
|
||||
|
||||
### 黑名单(禁用为证据)
|
||||
- 百家号、头条号、大部分公众号自媒体
|
||||
- 未署名行业博客
|
||||
- Retraction Watch 标记的撤稿论文
|
||||
- "据业内人士透露"类无来源文章
|
||||
- >5 年的综述(机制研究可放宽)
|
||||
|
||||
---
|
||||
|
||||
## 二、检索 4 轮法则
|
||||
|
||||
对任何一个 section/chapter,**必须至少 4 轮检索**:
|
||||
|
||||
### 第 1 轮:Tier 1 直命中
|
||||
- 先用**精确查询**去 PubMed / ClinicalTrials / openFDA 打
|
||||
- 关键词用 MeSH Term(医学主题词)+ 布尔逻辑
|
||||
- 例:`(GLP-1[MeSH] OR "glucagon-like peptide-1") AND (obesity[MeSH]) AND ("2023"[PDAT]:"2026"[PDAT])`
|
||||
|
||||
### 第 2 轮:Tier 2 综述扫描
|
||||
- 去 McKinsey Insights / BCG / Deloitte 官网搜 industry-overview
|
||||
- Evaluate Pharma / IQVIA 白皮书(通常需注册)
|
||||
- 目标:获取市场规模、竞争格局、趋势判断
|
||||
|
||||
### 第 3 轮:反方/证伪检索
|
||||
- 主动搜索与初步结论相反的关键词
|
||||
- 例:研究"GLP-1 成为减重首选"→ 反方要搜 "GLP-1 limitations" "semaglutide side effects" "discontinuation rate"
|
||||
- 至少 3-5 条反方证据
|
||||
|
||||
### 第 4 轮:Tavily/Brave/Exa 补漏
|
||||
- 仅用于发现前 3 轮遗漏的 URL
|
||||
- 发现后**必须**回溯到原始 Tier 1-2 来源(论文 DOI、监管公告原文)
|
||||
- 不得直接引用搜索返回的二次报道
|
||||
|
||||
---
|
||||
|
||||
## 三、API 调用顺序(技术栈,v0.8 更新)
|
||||
|
||||
**按"查询类型"路由到最合适的 API**,而不是一律走通用搜索。
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ 查询类型 首选 备选 │
|
||||
├──────────────────────────────────────────────────────────────┤
|
||||
│ 专利 Serper Patents Google Patents 爬页 │
|
||||
│ (site:patents.google.com) │
|
||||
│ │
|
||||
│ 学术论文 Serper Scholar PubMed E-utils │
|
||||
│ (带引用数/年份/期刊) (原始数据库) │
|
||||
│ │
|
||||
│ 新闻 / 行业动态 Serper News Tavily │
|
||||
│ (时效性敏感) │
|
||||
│ │
|
||||
│ 临床试验 ClinicalTrials.gov ChiCTR │
|
||||
│ (原始 API) │
|
||||
│ │
|
||||
│ 监管公告 openFDA / FDA 搜索 EMA / NMPA 官网 │
|
||||
│ │
|
||||
│ 公司/机构识别 Exa Tavily │
|
||||
│ (LinkedIn/官网召回强) │
|
||||
│ │
|
||||
│ 通用网页 Exa Tavily / Brave │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### Serper(google.serper.dev)使用模板
|
||||
|
||||
**专利检索**:
|
||||
```python
|
||||
from scripts.lib.search_client import SearchClient
|
||||
with SearchClient() as c:
|
||||
hits = c.patents("dual-target siRNA GalNAc", num_results=10)
|
||||
```
|
||||
|
||||
**学术论文**:
|
||||
```python
|
||||
hits = c.scholar("dual-target RNAi 2024", num_results=10, year_low=2023)
|
||||
# hits[i].snippet 里包含引用数和期刊信息
|
||||
```
|
||||
|
||||
**新闻(时效性)**:
|
||||
```python
|
||||
hits = c.news("Arrowhead ARO-DIMER-PA clinical trial", time_range="w") # 最近一周
|
||||
```
|
||||
|
||||
### Tavily MCP 调用模板(通用网页 - Phase 1 初扫)
|
||||
```
|
||||
工具名:tavily_search
|
||||
参数:
|
||||
query: "<关键词>"
|
||||
search_depth: "advanced"
|
||||
max_results: 10
|
||||
include_domains: ["pubmed.ncbi.nlm.nih.gov", "nejm.org", "lancet.com"]
|
||||
exclude_domains: ["baijiahao.baidu.com", "toutiao.com"]
|
||||
time_range: "year"
|
||||
```
|
||||
|
||||
### 何时用哪个
|
||||
|
||||
- **专利相关问题**("谁拥有技术 X"、"FTO 自由度分析")→ `c.patents()`,**永远先走 Google Patents**
|
||||
- **需要引用数排序的论文**("找影响力最大的 N 篇")→ `c.scholar()`
|
||||
- **近期新闻**("2025 年 Q4 交易"、"上月 IND 批准")→ `c.news(..., time_range="m")`
|
||||
- **快速概念验证 / 术语理解** → `c.search()`(通用)
|
||||
|
||||
### PubMed E-utils(bash 调用示例)
|
||||
```bash
|
||||
# 1. esearch 拿 PMID 列表
|
||||
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=GLP-1+obesity&retmax=20&api_key=$NCBI_API_KEY&retmode=json"
|
||||
|
||||
# 2. efetch 拿摘要
|
||||
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=PMID1,PMID2&rettype=abstract&retmode=xml&api_key=$NCBI_API_KEY"
|
||||
```
|
||||
|
||||
### ClinicalTrials.gov v2 API
|
||||
```bash
|
||||
curl -s "https://clinicaltrials.gov/api/v2/studies?query.term=semaglutide&pageSize=20&format=json"
|
||||
```
|
||||
|
||||
### openFDA
|
||||
```bash
|
||||
curl -s "https://api.fda.gov/drug/event.json?search=patient.drug.medicinalproduct:semaglutide&count=patient.reaction.reactionmeddrapt.exact&limit=20"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、关键词策略
|
||||
|
||||
### 中英双语必备
|
||||
- 任何生物医药主题**必须同时用中英文检索**
|
||||
- 中文关键词去找:中国监管(NMPA)、A股研报、医药魔方、Insight
|
||||
- 英文关键词去找:PubMed、FDA、顶刊、欧美研报
|
||||
|
||||
### MeSH Term 优先于自由词
|
||||
- PubMed 查询必须用 MeSH Term(医学主题词表)
|
||||
- MeSH Term 能自动扩展同义词,召回更全
|
||||
- 例:`obesity[MeSH]` 会自动包含 `adiposity`, `body weight, excess` 等
|
||||
|
||||
### 布尔逻辑 + 时间过滤
|
||||
- 默认加 `("2023"[PDAT]:"2026"[PDAT])` 时间窗
|
||||
- 机制研究可放宽到 10 年,新药/市场/政策必须近 3 年
|
||||
|
||||
### 反方关键词清单(备忘)
|
||||
- `limitations` / `adverse events` / `side effects` / `discontinuation`
|
||||
- `failed trial` / `FDA rejection` / `withdrawn`
|
||||
- `conflict of interest` / `industry-funded`
|
||||
- `retraction` / `replication failure`
|
||||
|
||||
---
|
||||
|
||||
## 五、每条信源的提取字段(标准化)
|
||||
|
||||
任何信源进 `sources.jsonl` 必须有以下字段:
|
||||
|
||||
```jsonl
|
||||
{
|
||||
"id": "src_001",
|
||||
"tier": 1,
|
||||
"score": 9.2,
|
||||
"type": "journal" | "trial" | "regulatory" | "patent" | "report" | "news",
|
||||
"url": "https://...",
|
||||
"doi": "10.xxxx/...",
|
||||
"title": "...",
|
||||
"authors": ["...", "..."],
|
||||
"year": 2025,
|
||||
"venue": "NEJM",
|
||||
"impact_factor": 176.0,
|
||||
"accessed_at": "2026-04-20",
|
||||
"abstract": "...",
|
||||
"key_data": {
|
||||
"market_size_2025": "12.3B USD",
|
||||
"cagr": "23%"
|
||||
},
|
||||
"used_in": ["ch01", "ch03.sec2"],
|
||||
"notes": "关键图表见 Fig 2"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 六、失败兜底
|
||||
|
||||
- 某个 API 限流/超时:**等 5s 重试 3 次**,仍失败则跳过并在日志标注
|
||||
- 某个信源 404:在 sources.jsonl 标 `"dead_link": true`,不删除(审计用)
|
||||
- 关键数据查不到:**不要编造**,在正文写 "该数据暂未找到公开来源(截至 2026-04)"
|
||||
|
||||
---
|
||||
|
||||
## 七、硬规则总结
|
||||
|
||||
1. ✅ 每 section 至少 4 轮检索
|
||||
2. ✅ 中英双语必查
|
||||
3. ✅ PubMed 用 MeSH Term
|
||||
4. ✅ 反方关键词必查
|
||||
5. ✅ Tier 4 结果只做发现,不做佐证
|
||||
6. ✅ 所有信源写入 sources.jsonl 并评分
|
||||
7. ❌ 不得引用 Wikipedia 做结论
|
||||
8. ❌ 不得编造数据、URL、DOI
|
||||
9. ❌ 不得使用黑名单信源
|
||||
@@ -0,0 +1,237 @@
|
||||
---
|
||||
name: source-quality
|
||||
description: 信源质量评分系统(0-10 分制)与黑名单机制。规定每个信源入库前的评估维度、硬性淘汰规则、利益冲突检测。所有收集信源的 agent 都必须用此技能给每条信源打分后写入 sources.jsonl。
|
||||
---
|
||||
|
||||
# 信源质量评分(0-10 分制)
|
||||
|
||||
## 一、评分维度(满分 10 分)
|
||||
|
||||
| 维度 | 满分 | 判断标准 |
|
||||
|---|---|---|
|
||||
| 权威性 | 3 | 期刊 IF、机构排名 |
|
||||
| 时效性 | 2 | 发表时间 vs 主题 |
|
||||
| 一手性 | 2 | 一手数据 > 综述 > 二次解读 |
|
||||
| 可验证性 | 2 | 有 DOI/URL/原始数据 |
|
||||
| 无利益冲突 | 1 | 厂商自发降权 |
|
||||
|
||||
### 维度 1:权威性(0-3 分)
|
||||
|
||||
| 分值 | 情形 |
|
||||
|---|---|
|
||||
| 3.0 | IF ≥ 30(NEJM/Lancet/Nature/Science/Cell/JAMA)、FDA/EMA/NMPA 官方、SEC 披露 |
|
||||
| 2.5 | IF 10-30(NatMed/NatBiotech/BMJ/AnnOncol 等)、顶级咨询(MKS/BCG/Deloitte) |
|
||||
| 2.0 | IF 5-10(JCO/CircRes/AJRCCM)、IQVIA/EvaluatePharma、系统综述 |
|
||||
| 1.5 | IF 3-5、券商研报、行业协会白皮书 |
|
||||
| 1.0 | IF 1-3、专业媒体(BioSpace/Endpoints News) |
|
||||
| 0.5 | 预印本(bioRxiv/medRxiv)、会议摘要 |
|
||||
| 0 | 自媒体、百家号、未署名博客 |
|
||||
|
||||
### 维度 2:时效性(0-2 分)
|
||||
|
||||
| 主题类型 | 满分年限 | 每老 1 年扣分 |
|
||||
|---|---|---|
|
||||
| 市场 / 监管 / 临床 | 3 年内 | -0.5 |
|
||||
| 作用机制 / 基础研究 | 10 年内 | -0.2 |
|
||||
| 政策法规 | **以最新版本为准** | 过时版本 0 分 |
|
||||
| 历史追溯(有意为之) | 不限 | 不扣 |
|
||||
|
||||
### 维度 3:一手性(0-2 分)
|
||||
|
||||
| 分值 | 情形 |
|
||||
|---|---|
|
||||
| 2.0 | 一手数据(原始 RCT 论文、监管公告、年报原文、专利原文) |
|
||||
| 1.5 | 系统综述 / Meta 分析 |
|
||||
| 1.0 | 叙述性综述 / Review |
|
||||
| 0.5 | 二次解读(新闻报道、券商改写) |
|
||||
| 0 | 三次传播以上("据报道"/"业内人士") |
|
||||
|
||||
### 维度 4:可验证性(0-2 分)
|
||||
|
||||
| 分值 | 情形 |
|
||||
|---|---|
|
||||
| 2.0 | 有 DOI + 原始数据可下载(如 ClinicalTrials 的 CSR 附件) |
|
||||
| 1.5 | 有 DOI 或稳定 URL,全文可访问 |
|
||||
| 1.0 | URL 稳定但需付费墙 |
|
||||
| 0.5 | 仅有 URL,无唯一标识符 |
|
||||
| 0 | URL 失效 / 404 / 无法验证 |
|
||||
|
||||
### 维度 5:利益冲突(0-1 分)
|
||||
|
||||
| 分值 | 情形 |
|
||||
|---|---|
|
||||
| 1.0 | 独立研究(学术机构、政府)、无资助声明冲突 |
|
||||
| 0.5 | 有 industry funding 但已声明且方法独立 |
|
||||
| 0 | 厂商自发报告 / 直接商业软文 |
|
||||
| **-1**(惩罚) | 声明冲突但方法可疑、或对比实验明显偏向资助方 |
|
||||
|
||||
---
|
||||
|
||||
## 二、综合评分硬规则
|
||||
|
||||
| 评分 | 可用性 |
|
||||
|---|---|
|
||||
| 8.0+ | 可作为核心论据,单独支撑结论 |
|
||||
| 6.0-7.9 | 可用,但结论需 ≥2 个独立信源 |
|
||||
| 4.0-5.9 | 仅作为参考,**不得作为唯一支撑** |
|
||||
| < 4.0 | **禁止**用于结论佐证,只能入发现库 |
|
||||
|
||||
---
|
||||
|
||||
## 三、检索回执与原文访问
|
||||
|
||||
Gemini / Antigravity 模式下,信源质量评分必须和检索回执绑定。任何来源进入 `sources.jsonl` 前,必须能追溯到 `search_log.jsonl` 中的至少一条记录。
|
||||
|
||||
### search_log.jsonl 最低字段
|
||||
|
||||
```json
|
||||
{
|
||||
"receipt_id": "srch_0001",
|
||||
"timestamp": "YYYY-MM-DDTHH:MM:SSZ",
|
||||
"tool": "search-cli|browser|project-search|other",
|
||||
"mode": "academic|scholar|patents|news|extract|general|deep",
|
||||
"query_or_url": "...",
|
||||
"purpose": "which task/card/chapter this supports",
|
||||
"result_count": 10,
|
||||
"opened_urls": ["https://..."],
|
||||
"status": "ok|partial|failed",
|
||||
"failure_reason": null
|
||||
}
|
||||
```
|
||||
|
||||
### sources.jsonl 追加字段
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "src_042",
|
||||
"search_receipt_ids": ["srch_0001"],
|
||||
"raw_url": "https://...",
|
||||
"canonical_url": "https://...",
|
||||
"source_type": "paper|regulator|trial_registry|patent|filing|database|consulting|media|other",
|
||||
"access_status": "opened_original|opened_abstract|paywalled|failed|snippet_only",
|
||||
"evidence_locator": "page/table/section/trial id/patent claim",
|
||||
"independence_cluster": "cluster_..."
|
||||
}
|
||||
```
|
||||
|
||||
硬规则:
|
||||
|
||||
- `snippet_only` 只能作为发现线索,不能支撑正文事实。
|
||||
- `failed` 必须保留失败原因,不能根据标题或搜索摘要推断具体数据。
|
||||
- `paywalled` / `opened_abstract` 可以用于发现方向,但核心结论还需要至少一个可打开原文或官方记录支撑。
|
||||
- 同一公司新闻稿、同一试验登记、同一专利族、同一券商报告转载链,必须归入同一个 `independence_cluster`。
|
||||
|
||||
---
|
||||
|
||||
## 四、黑名单(直接拒绝入库)
|
||||
|
||||
以下信源**无论评分多少都禁用**:
|
||||
|
||||
### 1. 明确劣质信源
|
||||
- 百家号(baijiahao.baidu.com)
|
||||
- 头条号(toutiao.com 非原创栏目)
|
||||
- 知乎回答(除非作者本人为业内专家且有实名背书)
|
||||
- 小红书、抖音笔记
|
||||
- 未署名作者的 wordpress / medium 博客
|
||||
|
||||
### 2. 被撤稿论文
|
||||
- 查询 Retraction Watch 数据库(https://retractionwatch.com/)
|
||||
- Crossref API 检查论文状态:`https://api.crossref.org/works/<DOI>`
|
||||
|
||||
### 3. 明显软文/PR 稿
|
||||
识别特征(命中任意 2 条即拒):
|
||||
- 标题含 "重磅发布" "首创" "引领" 等夸张词
|
||||
- 通篇无具体数据,只有 CEO/专家口头引述
|
||||
- 发布渠道是企业官网的"新闻中心"且无交叉第三方验证
|
||||
- 仅讲优势不讲局限
|
||||
|
||||
### 4. 时效过期
|
||||
- 综述 > 5 年(机制研究可放宽)
|
||||
- 政策/监管 > 1 年(以最新版本为准)
|
||||
- 市场数据 > 2 年
|
||||
|
||||
### 5. 维基百科
|
||||
- **仅可作术语理解入口**
|
||||
- 结论永不引用
|
||||
- 如从 Wiki 发现了参考文献,**回溯到原始来源**再引用
|
||||
|
||||
---
|
||||
|
||||
## 五、利益冲突检测要点
|
||||
|
||||
### 常见利益冲突场景
|
||||
- 药企赞助的 RCT 对自家产品评价极高 → 查对比剂、盲法、样本量
|
||||
- 咨询公司报告引用自家客户数据 → 查 acknowledgment 段
|
||||
- 行业协会报告涉及会员企业 → 查资助方名单
|
||||
- 券商研报 + 该券商是相关公司的保荐人 → 查 IPO/承销记录
|
||||
|
||||
### 操作方法
|
||||
每条信源入库前检查:
|
||||
1. 作者/机构是否与被评估的公司/产品有商业关联?
|
||||
2. 资助声明(funding statement)里提到什么?
|
||||
3. 利益披露(disclosure)是否完整?
|
||||
|
||||
**发现强利益冲突**:评分 ≤ 3(等同废弃);写入 `sources.jsonl` 的 `"conflict_of_interest": "..."` 字段。
|
||||
|
||||
---
|
||||
|
||||
## 六、评分执行流程(伪代码)
|
||||
|
||||
```
|
||||
for each candidate_source in search_results:
|
||||
# 1. 黑名单快筛
|
||||
if is_blacklisted(candidate_source):
|
||||
log("BLACKLIST: " + source.url); continue
|
||||
|
||||
# 2. 撤稿检查
|
||||
if has_doi(source) and is_retracted(source.doi):
|
||||
log("RETRACTED: " + source.doi); continue
|
||||
|
||||
# 3. 评分
|
||||
score = 0
|
||||
score += authority_score(source) # 0-3
|
||||
score += recency_score(source, topic) # 0-2
|
||||
score += primacy_score(source) # 0-2
|
||||
score += verifiability_score(source) # 0-2
|
||||
score += coi_score(source) # 0-1 or -1
|
||||
|
||||
# 4. Tier 加权
|
||||
if source.tier == 1: score *= 1.2
|
||||
|
||||
# 5. 入库
|
||||
if score >= 4.0:
|
||||
append_to_sources_jsonl(source, score)
|
||||
else:
|
||||
log("LOW SCORE (" + score + "): " + source.url)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、输出字段(写入 sources.jsonl)
|
||||
|
||||
```jsonl
|
||||
{
|
||||
"id": "src_042",
|
||||
"score": 8.6,
|
||||
"tier": 1,
|
||||
"authority": 3.0,
|
||||
"recency": 2.0,
|
||||
"primacy": 2.0,
|
||||
"verifiability": 2.0,
|
||||
"coi": 1.0,
|
||||
"conflict_of_interest": null,
|
||||
"blacklist_checked": true,
|
||||
"retraction_checked": true,
|
||||
"search_receipt_ids": ["srch_0001"],
|
||||
"access_status": "opened_original",
|
||||
"evidence_locator": "Table 2",
|
||||
"independence_cluster": "cluster_trial_001",
|
||||
"notes": "NEJM 2025 原文,RCT 独立研究"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 八、审计留痕
|
||||
|
||||
所有被**拒绝**的信源,也要写入 `projects/<slug>/phase2/rejected_sources.jsonl`(注明原因、对应 `receipt_id`、拒绝规则)。这是事后复盘的关键,不要静默丢弃。
|
||||
@@ -0,0 +1,154 @@
|
||||
---
|
||||
description: Run native biomedical Deep Research in Antigravity using roles, rules, skills, workflows, source receipts, and explicit approval gates.
|
||||
---
|
||||
|
||||
# Deep Research Native Workflow
|
||||
|
||||
Invoke as `/deep-research-native <topic or slug>`.
|
||||
|
||||
## Step 0: Load Operating Context
|
||||
|
||||
- Load `AGENTS.md`.
|
||||
- Load `GEMINI.md`.
|
||||
- Load `.agents/agents.md`.
|
||||
- Load `.agents/rules/deep-research-antigravity.md`.
|
||||
- Load `.agents/skills/antigravity-surface-adapter/SKILL.md`.
|
||||
- Load `.agents/skills/method-selection/SKILL.md`.
|
||||
- Load relevant quality skills: `search-strategy`, `source-quality`, `evidence-table`, `research-quality-gates`, `citation-manager`, `length-budget`, `output-hygiene`.
|
||||
|
||||
Gate: if the active model has not loaded the above files, stop and ask the user to restart or explicitly mention them.
|
||||
|
||||
## Step 1: Define The Research Problem
|
||||
|
||||
Act as Research Manager with Gemini 3 Flash.
|
||||
|
||||
Confirm:
|
||||
|
||||
- topic and slug
|
||||
- report purpose
|
||||
- target reader
|
||||
- decision the report supports
|
||||
- report type and expected length
|
||||
- available input materials
|
||||
- allowed search tools
|
||||
- whether Python model-worker commands are forbidden or allowed
|
||||
|
||||
Create or confirm `projects/<slug>/` and phase folders. Create or update `projects/<slug>/continuation_state.json`. Use Python only for scaffolding if helpful.
|
||||
|
||||
Gate: do not continue if purpose, audience, and decision use are unclear.
|
||||
|
||||
## Step 2: Select Method
|
||||
|
||||
Ask the user to switch to Claude Opus 4.6 (Thinking).
|
||||
|
||||
Act as Phase 0-1 Strategist. Use `method-selection`.
|
||||
|
||||
Write a method decision note covering:
|
||||
|
||||
- selected method or method mix
|
||||
- why it fits the scenario
|
||||
- rejected methods and why
|
||||
- evidence types required
|
||||
- search routes by chapter or task axis
|
||||
- expected artifacts
|
||||
|
||||
Save it as `phase1/method_decision.md` or embed the same content in `phase1/research_brief.md` with a clear heading.
|
||||
|
||||
Gate: do not default to McKinsey, MECE, or SCQA. Use them only when they fit the decision problem.
|
||||
|
||||
## Step 3: Phase 0-1 Framing
|
||||
|
||||
Still using Claude Opus 4.6 (Thinking), produce:
|
||||
|
||||
- `phase1/material_brief.md`
|
||||
- `phase1/search_log.md`
|
||||
- `phase1/method_decision.md`
|
||||
- `phase1/assumptions.md`
|
||||
- `phase1/framework.md`
|
||||
- `phase1/research_brief.md`
|
||||
- `phase1/research_brief.json`
|
||||
- `phase1/unsupported_claims.md`
|
||||
|
||||
Rules:
|
||||
|
||||
- Hypotheses without evidence must be labeled as hypotheses.
|
||||
- Every searched claim must have a search receipt.
|
||||
- Each chapter must state method, core question, likely evidence, and falsification route.
|
||||
|
||||
Gate: pause for user approval before Phase 2.
|
||||
|
||||
## Step 4: Phase 2 Evidence And Drafting
|
||||
|
||||
Ask the user to switch to Gemini 3.1 Pro (Low).
|
||||
|
||||
Act as Evidence Analyst.
|
||||
|
||||
Produce:
|
||||
|
||||
- `phase2/task_cards.json`
|
||||
- `phase2/search_log.jsonl`
|
||||
- `phase2/sources.jsonl`
|
||||
- `phase2/rejected_sources.jsonl`
|
||||
- `phase2/claims_ledger.jsonl`
|
||||
- `phase2/coverage_matrix.md`
|
||||
- `phase2/packets/*.json`
|
||||
- `phase2/chapter_briefs/*.json`
|
||||
- `phase2/compressed_findings/*.json`
|
||||
- `phase2/drafts/chXX.md`
|
||||
- `phase2/unsupported_claims.md`
|
||||
|
||||
Rules:
|
||||
|
||||
- No tool receipt, no search claim.
|
||||
- No source ID, no factual claim.
|
||||
- Search snippets and AI summaries are leads only.
|
||||
- Every packet must include `search_receipts`, `sources`, `evidence_spans`, `counter_evidence`, and `unsupported_claims`.
|
||||
- Every core claim must be represented in `claims_ledger.jsonl`.
|
||||
- Every chapter must pass a counter-search or falsification pass.
|
||||
- Evidence gaps trigger delta retrieval before drafting or visible caveats if still unresolved.
|
||||
- Draft chapters only from approved chapter briefs and compressed findings.
|
||||
|
||||
Gate: run `research-quality-gates`. Do not move to Phase 3 if packet evidence is missing, claim-ledger records are incomplete, unsupported claims are hidden, source independence is not tracked, or counter-evidence is absent.
|
||||
|
||||
## Step 5: Phase 3 Review
|
||||
|
||||
Ask the user to switch to Gemini 3.1 Pro (High).
|
||||
|
||||
Act as Chief Reviewer.
|
||||
|
||||
Produce `phase3/critique.md` with:
|
||||
|
||||
- go / rework / fail decision
|
||||
- structural critique
|
||||
- method fit critique
|
||||
- evidence gap list
|
||||
- counter-evidence critique
|
||||
- claim-ledger audit
|
||||
- coverage matrix audit
|
||||
- source-audit table for at least 10 core facts
|
||||
- rework task list if needed
|
||||
|
||||
If the critique finds a critical evidence gap, create delta-retrieve tasks instead of asking Phase 4 to paper over the gap.
|
||||
|
||||
Gate: pause for user decision after critique.
|
||||
|
||||
## Step 6: Phase 4 Finalization
|
||||
|
||||
Ask the user to switch to Claude Opus 4.6 (Thinking).
|
||||
|
||||
Act as Final Editor.
|
||||
|
||||
Produce:
|
||||
|
||||
- `phase4/final_zh.md`
|
||||
- `phase4/editorial_notes.md`
|
||||
- `phase4/final_fact_check.md`
|
||||
|
||||
Rules:
|
||||
|
||||
- Do not introduce new facts unless new sources and search logs are added first.
|
||||
- Final facts must be a subset of verified or explicitly caveated `claims_ledger.jsonl` rows.
|
||||
- Downgrade or mark claims that remain unsupported.
|
||||
- Use deterministic rendering tools afterward for PDF/DOCX.
|
||||
|
||||
Gate: final output must pass citation and unsupported-claim review before rendering.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Claude Code Environment
|
||||
|
||||
Open this directory in Claude Code.
|
||||
|
||||
Claude Code is best used for interview-style framing, long-form Chinese editorial review, final wording quality, and careful reasoning around report structure. Shared research rules and skills still come from the generated workspace files, not from platform-specific rewrites.
|
||||
|
||||
Rebuild from the parent repository with:
|
||||
|
||||
```bash
|
||||
./setup.sh init claude-code
|
||||
./setup.sh update claude-code
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: dr-finalize
|
||||
description: Surface adapter command for Chinese-native Phase 4 finalization.
|
||||
---
|
||||
|
||||
Run the project-owned Python core finalization. Do not hand-translate the report in Claude Code.
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize $ARGUMENTS
|
||||
```
|
||||
|
||||
For old projects only, use:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --legacy-translate
|
||||
```
|
||||
|
||||
Report PDF/DOCX paths and any citation/rendering warnings.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: dr-frame
|
||||
description: Surface adapter command for generating Phase 1 framework.md through the Python core.
|
||||
---
|
||||
|
||||
Run the project-owned Python core framework generator. Do not perform Phase 1 orchestration in Claude Code.
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py frame $ARGUMENTS
|
||||
```
|
||||
|
||||
Report the framework path and remind the user to approve it before Phase 2.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: dr-init
|
||||
description: Surface adapter command for initializing a Deep Research v0.20 project.
|
||||
---
|
||||
|
||||
Run the project-owned Python core initialization. Do not create manifest files manually.
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py init $ARGUMENTS
|
||||
```
|
||||
|
||||
Report the project slug, manifest path, and next command.
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
name: dr-research
|
||||
description: Surface adapter command for Deep Research v0.20 Phase 2 task-card research.
|
||||
---
|
||||
|
||||
Run the project-owned Python core Phase 2 command. Do not spawn Claude Code subagents for chapter research.
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS
|
||||
```
|
||||
|
||||
Useful follow-ups:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --execute-packets
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --build-briefs
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --assemble-chapters
|
||||
```
|
||||
|
||||
Report packet/chapter error files if present.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: dr-review
|
||||
description: Surface adapter command for deterministic Phase 3 review.
|
||||
---
|
||||
|
||||
Run the project-owned Python core review. Claude Code may explain the critique afterwards, but should not overwrite it unless asked.
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py review $ARGUMENTS
|
||||
```
|
||||
|
||||
Report the critique path and pause for user decision.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: dr-run
|
||||
description: Surface adapter command for Deep Research v0.20. Use when the user asks Claude Code to run or continue a Deep Research project.
|
||||
---
|
||||
|
||||
Run the project-owned Python core. Do not perform core orchestration in Claude Code.
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py run $ARGUMENTS
|
||||
```
|
||||
|
||||
Report only the project path, generated files, failures, and next command.
|
||||
@@ -0,0 +1,14 @@
|
||||
# Codex Environment
|
||||
|
||||
Open this directory in Codex.
|
||||
|
||||
Codex is best used for repository work: scripts, schemas, tests, deployment logic, and code review. Deep Research model routing should normally use the Python core unless the user explicitly asks for manual Codex reasoning.
|
||||
|
||||
This environment contains a local `.codex/` adapter generated from `src/platform_adapters/codex` plus shared skills copied into `.codex/skills`.
|
||||
|
||||
Rebuild from the parent repository with:
|
||||
|
||||
```bash
|
||||
./setup.sh init codex
|
||||
./setup.sh update codex
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
name = "dr-analyst"
|
||||
description = "Compatibility role only. v0.20 analyst work is done by Python evidence_packet/chapter_assembly workers."
|
||||
model = "zenmux-anthropic/claude-sonnet-4-6"
|
||||
model_reasoning_effort = "high"
|
||||
sandbox_mode = "workspace-write"
|
||||
developer_instructions = """
|
||||
You are a compatibility role only.
|
||||
Do not write chapter drafts in Codex by default.
|
||||
Use Python core for analyst work:
|
||||
- uv run python scripts/dr.py research <slug> --execute-packets
|
||||
- uv run python scripts/dr.py research <slug> --build-briefs
|
||||
- uv run python scripts/dr.py research <slug> --assemble-chapters
|
||||
Formal outputs are Chinese-first; English is allowed only for search/source notes.
|
||||
"""
|
||||
nickname_candidates = ["Analyst A", "Analyst B", "Analyst C", "Analyst D"]
|
||||
@@ -0,0 +1,13 @@
|
||||
name = "dr-chief-editor"
|
||||
description = "Surface adapter role for optional Phase 3 deep review. Deterministic review lives in Python."
|
||||
model = "zenmux/google/gemini-3.1-pro-preview"
|
||||
model_reasoning_effort = "xhigh"
|
||||
sandbox_mode = "read-only"
|
||||
developer_instructions = """
|
||||
You are a surface adapter for optional deep review.
|
||||
Default review command:
|
||||
- uv run python scripts/dr.py review <slug>
|
||||
You may explain or supplement phase3/critique.md when asked, but do not overwrite deterministic review output by default.
|
||||
Do not enter Phase 4.
|
||||
"""
|
||||
nickname_candidates = ["Chief Editor"]
|
||||
@@ -0,0 +1,13 @@
|
||||
name = "dr-editor-in-chief"
|
||||
description = "Surface adapter role for Phase 4. Chinese-native finalization lives in Python."
|
||||
model = "zenmux-anthropic/claude-opus-4-7"
|
||||
model_reasoning_effort = "xhigh"
|
||||
sandbox_mode = "workspace-write"
|
||||
developer_instructions = """
|
||||
You are a surface adapter for Phase 4.
|
||||
Default finalization command:
|
||||
- uv run python scripts/dr.py finalize <slug>
|
||||
Do not merge final_en.md or use English-to-Chinese translation unless the user explicitly asks for --legacy-translate.
|
||||
Do not translate or polish the full report manually in Codex.
|
||||
"""
|
||||
nickname_candidates = ["Editor in Chief"]
|
||||
@@ -0,0 +1,15 @@
|
||||
name = "dr-plan"
|
||||
description = "Surface adapter role for Phase 1. Core init/frame orchestration lives in Python."
|
||||
model = "zenmux-anthropic/claude-opus-4-7"
|
||||
model_reasoning_effort = "high"
|
||||
sandbox_mode = "workspace-write"
|
||||
developer_instructions = """
|
||||
You are a surface adapter for Deep Research v0.20.
|
||||
Do not perform Phase 1 core orchestration in Codex.
|
||||
Run the Python core:
|
||||
- uv run python scripts/dr.py init <topic>
|
||||
- uv run python scripts/dr.py frame <slug>
|
||||
You may help interview the user in Chinese before calling init/frame, but generated project files must come from Python core.
|
||||
Do not spawn subagents for initial scan by default.
|
||||
"""
|
||||
nickname_candidates = ["Planner Alpha", "Planner Beta", "Planner Gamma"]
|
||||
@@ -0,0 +1,16 @@
|
||||
name = "dr-pm"
|
||||
description = "Surface adapter role for Phase 2/status. Core batching and concurrency live in Python."
|
||||
model = "zenmux-anthropic/claude-sonnet-4-6"
|
||||
model_reasoning_effort = "high"
|
||||
sandbox_mode = "workspace-write"
|
||||
developer_instructions = """
|
||||
You are a surface adapter for Deep Research v0.20.
|
||||
Do not batch chapters or spawn Codex subagents for research.
|
||||
Run the Python core:
|
||||
- uv run python scripts/dr.py research <slug> --workers 6
|
||||
- uv run python scripts/dr.py research <slug> --workers 6 --execute-packets
|
||||
- uv run python scripts/dr.py research <slug> --workers 6 --build-briefs
|
||||
- uv run python scripts/dr.py research <slug> --workers 6 --assemble-chapters
|
||||
Report produced files and error files only.
|
||||
"""
|
||||
nickname_candidates = ["PM Alpha", "PM Beta", "PM Gamma"]
|
||||
@@ -0,0 +1,14 @@
|
||||
name = "dr-reporter"
|
||||
description = "Report production agent for PDF/DOCX rendering and final output checks."
|
||||
model = "zenmux-anthropic/claude-sonnet-4-6"
|
||||
model_reasoning_effort = "medium"
|
||||
sandbox_mode = "workspace-write"
|
||||
developer_instructions = """
|
||||
You are dr-reporter.
|
||||
You are an execution-focused report producer.
|
||||
Use scripts/build_report.py and .opencode/templates/report-template.py to render PDF/DOCX from final_zh_polished.md or the specified Markdown.
|
||||
Run output hygiene checks and citation checks where available.
|
||||
Do not change research conclusions.
|
||||
Do not invent missing references.
|
||||
"""
|
||||
nickname_candidates = ["Reporter"]
|
||||
@@ -0,0 +1,19 @@
|
||||
name = "dr-searcher"
|
||||
description = "Lightweight source discovery agent for initial scans and targeted source finding."
|
||||
model = "zenmux-anthropic/claude-haiku-4-5"
|
||||
model_reasoning_effort = "medium"
|
||||
sandbox_mode = "read-only"
|
||||
developer_instructions = """
|
||||
You are dr-searcher.
|
||||
Your job is source discovery only. Do not write project files unless explicitly instructed by the parent.
|
||||
Load skills: search-strategy and source-quality.
|
||||
Use the project search gateway before MCP or generic web search:
|
||||
- literature: uv run python scripts/search.py "<query>" --route scholar --num-results 10 --year-low 2023
|
||||
- patents: uv run python scripts/search.py "<query>" --route patents --num-results 10
|
||||
- news: uv run python scripts/search.py "<query>" --route news --num-results 10 --time-range m
|
||||
- general gap-fill: uv run python scripts/search.py "<query>" --route general --num-results 10
|
||||
Search English and Chinese keywords, prioritize Tier 1-2 sources, include counter-evidence search terms, report the routes used, and return concise Markdown with URLs/DOIs and source-quality scores.
|
||||
Do not use Wikipedia as evidence.
|
||||
Do not fabricate URLs, DOIs, trial IDs, patents, or source ids.
|
||||
"""
|
||||
nickname_candidates = ["Searcher A", "Searcher B", "Searcher C", "Searcher D"]
|
||||
@@ -0,0 +1,19 @@
|
||||
name = "dr-verifier"
|
||||
description = "Independent counter-evidence and fact-checking agent for completed chapters."
|
||||
model = "zenmux/openai/gpt-5.4"
|
||||
model_reasoning_effort = "high"
|
||||
sandbox_mode = "workspace-write"
|
||||
developer_instructions = """
|
||||
You are dr-verifier.
|
||||
Act as an independent devil's advocate. Do not protect the analyst's conclusion.
|
||||
Read the assigned draft and evidence file, verify numbers, search for counter-evidence, and append a verification section to the evidence file.
|
||||
Use the project search gateway before generic web search:
|
||||
- literature counter-evidence: uv run python scripts/search.py "<query> limitations failed controversy" --route scholar --num-results 10 --year-low 2023
|
||||
- patent/IP counter-evidence: uv run python scripts/search.py "<query>" --route patents --num-results 10
|
||||
- news/transaction checks: uv run python scripts/search.py "<query>" --route news --num-results 10 --time-range y
|
||||
Use read-then-rewrite for evidence files. Do not edit chapter drafts.
|
||||
Flag CRITICAL issues when counter-evidence could overturn a chapter's core claim.
|
||||
Use Chinese and English searches for China-market claims.
|
||||
Do not fabricate counter-evidence or sources.
|
||||
"""
|
||||
nickname_candidates = ["Verifier A", "Verifier B", "Verifier C"]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Codex Command: dr-finalize
|
||||
|
||||
Codex is a surface adapter for v0.20. Chinese-native finalization is the default.
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize $ARGUMENTS
|
||||
```
|
||||
|
||||
Legacy English-to-Chinese pipeline is opt-in only:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize $ARGUMENTS --legacy-translate
|
||||
```
|
||||
|
||||
Do not translate or polish the full report manually in one LLM response.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Codex Command: dr-frame
|
||||
|
||||
Thin wrapper around the platform-neutral Python core.
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py frame $ARGUMENTS
|
||||
```
|
||||
|
||||
Stop after writing `phase1/framework.md`; wait for user approval before Phase 2.
|
||||
@@ -0,0 +1,26 @@
|
||||
# Codex Command: dr-glossary
|
||||
|
||||
You are dr-pm. The user requested `/dr-glossary $ARGUMENTS`.
|
||||
|
||||
Goal: run terminology verification in Codex native mode.
|
||||
|
||||
Default command:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py glossary <slug> --workers 4
|
||||
```
|
||||
|
||||
If network or SSL errors occur, rerun with:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py glossary <slug> --workers 3
|
||||
```
|
||||
|
||||
After completion, summarize:
|
||||
- terms checked
|
||||
- high/medium/low confidence counts
|
||||
- spelling errors
|
||||
- wrong Chinese names
|
||||
- recommended manual review items
|
||||
|
||||
Do not auto-apply glossary corrections unless the user asks or the pipeline is in Phase 4 finalize.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Codex Command: dr-init
|
||||
|
||||
Thin wrapper around the platform-neutral Python core.
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py init $ARGUMENTS
|
||||
```
|
||||
|
||||
Stop after initialization. Next step is `dr-frame`.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Codex Command: dr-research
|
||||
|
||||
Codex is a surface adapter for v0.20. Core Phase 2 orchestration lives in Python.
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6
|
||||
```
|
||||
|
||||
Fill packets with model workers:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --execute-packets
|
||||
```
|
||||
|
||||
For low-cost smoke tests where generic fallback is acceptable:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --execute-packets --allow-search-fallback
|
||||
```
|
||||
|
||||
Aggregate packets into chapter briefs:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --build-briefs
|
||||
```
|
||||
|
||||
Assemble Chinese chapter drafts:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --assemble-chapters
|
||||
```
|
||||
|
||||
Preview:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --dry-run
|
||||
```
|
||||
|
||||
Do not perform chapter research in the Codex thread. Report the task-card and packet paths created by the CLI.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Codex Command: dr-review
|
||||
|
||||
Thin wrapper around the platform-neutral Python core.
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py review $ARGUMENTS
|
||||
```
|
||||
|
||||
Stop after writing `phase3/critique.md`; wait for user decision before Phase 4.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Codex Command: dr-run
|
||||
|
||||
Codex is a surface adapter for v0.20. Do not spawn Codex subagents for the core workflow.
|
||||
|
||||
Run the project-owned Python core:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py run $ARGUMENTS --workers 6
|
||||
```
|
||||
|
||||
For a preview:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py run $ARGUMENTS --workers 6 --dry-run
|
||||
```
|
||||
|
||||
Report only the CLI phase decision, produced files, and next step.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Codex Command: dr-status
|
||||
|
||||
Run the platform-neutral status command:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py status $ARGUMENTS
|
||||
```
|
||||
|
||||
Then summarize the result for the user and suggest the next appropriate phase.
|
||||
@@ -0,0 +1,67 @@
|
||||
model = "gpt-5.4"
|
||||
model_reasoning_effort = "high"
|
||||
sandbox_mode = "workspace-write"
|
||||
approval_policy = "never"
|
||||
project_doc_max_bytes = 65536
|
||||
web_search = "live"
|
||||
|
||||
[features]
|
||||
multi_agent = true
|
||||
|
||||
[agents]
|
||||
max_threads = 6
|
||||
max_depth = 1
|
||||
|
||||
[profiles.deep-research]
|
||||
model = "gpt-5.4"
|
||||
model_reasoning_effort = "high"
|
||||
sandbox_mode = "workspace-write"
|
||||
approval_policy = "never"
|
||||
project_doc_max_bytes = 65536
|
||||
web_search = "live"
|
||||
|
||||
[profiles.deep-research-fast]
|
||||
model = "gpt-5.4-mini"
|
||||
model_reasoning_effort = "medium"
|
||||
sandbox_mode = "workspace-write"
|
||||
approval_policy = "never"
|
||||
project_doc_max_bytes = 65536
|
||||
web_search = "live"
|
||||
|
||||
[profiles.deep-research-review]
|
||||
model = "gpt-5.4"
|
||||
model_reasoning_effort = "xhigh"
|
||||
sandbox_mode = "workspace-write"
|
||||
approval_policy = "never"
|
||||
project_doc_max_bytes = 65536
|
||||
web_search = "live"
|
||||
|
||||
[mcp_servers.openaiDeveloperDocs]
|
||||
url = "https://developers.openai.com/mcp"
|
||||
|
||||
[mcp_servers.openaiDeveloperDocs.tools.fetch_openai_doc]
|
||||
approval_mode = "approve"
|
||||
|
||||
[mcp_servers.tavily]
|
||||
command = "npx"
|
||||
args = ["-y", "tavily-mcp@latest"]
|
||||
env_vars = ["TAVILY_API_KEY"]
|
||||
enabled = true
|
||||
required = false
|
||||
|
||||
[mcp_servers.brave_search]
|
||||
command = "npx"
|
||||
args = ["-y", "@modelcontextprotocol/server-brave-search"]
|
||||
env_vars = ["BRAVE_API_KEY"]
|
||||
enabled = true
|
||||
required = false
|
||||
|
||||
[mcp_servers.exa]
|
||||
command = "npx"
|
||||
args = ["-y", "exa-mcp-server"]
|
||||
env_vars = ["EXA_API_KEY"]
|
||||
enabled = true
|
||||
required = false
|
||||
|
||||
[sandbox_workspace_write]
|
||||
network_access = true
|
||||
@@ -0,0 +1,12 @@
|
||||
# Gemini CLI Environment
|
||||
|
||||
Open this directory for Gemini CLI workflows.
|
||||
|
||||
Gemini CLI is suitable for long-context review, multimodal material checks, and alternative framework evaluation. Treat Gemini-family factual claims as high risk unless search receipts, source IDs, and claim-ledger rows exist.
|
||||
|
||||
Rebuild from the parent repository with:
|
||||
|
||||
```bash
|
||||
./setup.sh init gemini-cli
|
||||
./setup.sh update gemini-cli
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
description = "Run Chinese-native Phase 4 finalization through Python core."
|
||||
prompt = """
|
||||
Run the Deep Research Python core finalize command. Do not hand-translate the report in Gemini CLI.
|
||||
|
||||
Command:
|
||||
!{uv run python scripts/dr.py finalize {{args}}}
|
||||
|
||||
Report PDF/DOCX paths and any citation/rendering warnings.
|
||||
"""
|
||||
@@ -0,0 +1,9 @@
|
||||
description = "Generate Phase 1 framework.md through Python core."
|
||||
prompt = """
|
||||
Run the Deep Research Python core frame command.
|
||||
|
||||
Command:
|
||||
!{uv run python scripts/dr.py frame {{args}}}
|
||||
|
||||
Report the framework path and pause for user approval before Phase 2.
|
||||
"""
|
||||
@@ -0,0 +1,9 @@
|
||||
description = "Initialize a Deep Research v0.20 project through Python core."
|
||||
prompt = """
|
||||
Run the Deep Research Python core init command. Do not create project files manually.
|
||||
|
||||
Command:
|
||||
!{uv run python scripts/dr.py init {{args}}}
|
||||
|
||||
Report the project slug, manifest path, and next command.
|
||||
"""
|
||||
@@ -0,0 +1,9 @@
|
||||
description = "Run Phase 2 task-card research through Python core."
|
||||
prompt = """
|
||||
Run the Deep Research Python core research command. Do not spawn Gemini CLI agents for chapter research.
|
||||
|
||||
Command:
|
||||
!{uv run python scripts/dr.py research {{args}}}
|
||||
|
||||
Report task cards, packets, briefs, drafts, and any error files.
|
||||
"""
|
||||
@@ -0,0 +1,9 @@
|
||||
description = "Run deterministic Phase 3 review through Python core."
|
||||
prompt = """
|
||||
Run the Deep Research Python core review command.
|
||||
|
||||
Command:
|
||||
!{uv run python scripts/dr.py review {{args}}}
|
||||
|
||||
Report the critique path and pause for user decision.
|
||||
"""
|
||||
@@ -0,0 +1,9 @@
|
||||
description = "Run or initialize a Deep Research v0.20 project through Python core."
|
||||
prompt = """
|
||||
Run the Deep Research Python core. Do not orchestrate the workflow in Gemini CLI.
|
||||
|
||||
Command:
|
||||
!{uv run python scripts/dr.py run {{args}}}
|
||||
|
||||
Summarize only the project path, generated artifacts, failures, and next command.
|
||||
"""
|
||||
@@ -0,0 +1,12 @@
|
||||
# OpenCode Environment
|
||||
|
||||
Open this directory in OpenCode.
|
||||
|
||||
OpenCode is a thin surface adapter around the Python core. Use the `.opencode/commands` wrappers to call `scripts/dr.py`; do not let platform agents reimplement Phase 2 worker orchestration.
|
||||
|
||||
Rebuild from the parent repository with:
|
||||
|
||||
```bash
|
||||
./setup.sh init opencode
|
||||
./setup.sh update opencode
|
||||
```
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
description: "[COMPAT v0.20] analyst 兼容层。默认证据包与章节组装由 Python core 执行。"
|
||||
mode: subagent
|
||||
hidden: true
|
||||
model: zenmux-anthropic/claude-sonnet-4-6
|
||||
temperature: 0.3
|
||||
tools:
|
||||
read: true
|
||||
bash: true
|
||||
skill: true
|
||||
permission:
|
||||
bash:
|
||||
"*": deny
|
||||
"uv run python scripts/dr.py research *": allow
|
||||
edit: deny
|
||||
task:
|
||||
"*": deny
|
||||
---
|
||||
|
||||
# dr-analyst Compatibility Role
|
||||
|
||||
v0.20 不再使用平台 analyst 做整章英文深研。默认 analyst 工作由 Python task workers 完成:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research <slug> --execute-packets
|
||||
uv run python scripts/dr.py research <slug> --build-briefs
|
||||
uv run python scripts/dr.py research <slug> --assemble-chapters
|
||||
```
|
||||
|
||||
本 agent 只可解释失败包或辅助人工诊断,不得直接写 `phase2/drafts/chXX.md`。
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
description: "[COMPAT v0.20] Phase 3 审校兼容层。默认审校由 Python core deterministic review 执行。"
|
||||
mode: primary
|
||||
model: zenmux/google/gemini-3.1-pro-preview
|
||||
temperature: 0.3
|
||||
tools:
|
||||
read: true
|
||||
bash: true
|
||||
skill: true
|
||||
permission:
|
||||
bash:
|
||||
"*": deny
|
||||
"uv run python scripts/dr.py review *": allow
|
||||
edit: deny
|
||||
task:
|
||||
"*": deny
|
||||
color: "#10b981"
|
||||
---
|
||||
|
||||
# dr-chief-editor Compatibility Role
|
||||
|
||||
v0.20 的默认 Phase 3 审校入口是:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py review <slug>
|
||||
```
|
||||
|
||||
Gemini 长上下文能力可用于解释或补充 `phase3/critique.md`,但不得默认覆盖 deterministic review,不得进入 Phase 4 写作。
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
description: "[COMPAT v0.20] Phase 4 兼容层。默认中文原生成稿由 Python core finalize 执行。"
|
||||
mode: primary
|
||||
model: zenmux-anthropic/claude-opus-4-7
|
||||
temperature: 0.4
|
||||
tools:
|
||||
read: true
|
||||
bash: true
|
||||
skill: true
|
||||
permission:
|
||||
bash:
|
||||
"*": deny
|
||||
"uv run python scripts/dr.py finalize *": allow
|
||||
edit: deny
|
||||
task:
|
||||
"*": deny
|
||||
color: "#9333ea"
|
||||
---
|
||||
|
||||
# dr-editor-in-chief Compatibility Role
|
||||
|
||||
v0.20 的默认 Phase 4 入口是中文原生成稿:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug>
|
||||
```
|
||||
|
||||
旧 `final_en.md -> translate -> polish` 链路仅在用户显式要求 `--legacy-translate` 时启用。不得在 OpenCode 会话中手工翻译或润色整篇报告。
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
description: "[COMPAT v0.20] Phase 1 表层访谈兼容层。默认 init/frame 由 Python core 执行。"
|
||||
mode: primary
|
||||
model: zenmux-anthropic/claude-opus-4-7
|
||||
temperature: 0.7
|
||||
tools:
|
||||
bash: true
|
||||
read: true
|
||||
skill: true
|
||||
permission:
|
||||
bash:
|
||||
"*": deny
|
||||
"uv run python scripts/dr.py init *": allow
|
||||
"uv run python scripts/dr.py frame *": allow
|
||||
"uv run python scripts/dr.py methods *": allow
|
||||
task:
|
||||
"*": deny
|
||||
color: "#a855f7"
|
||||
---
|
||||
|
||||
# dr-plan Compatibility Role
|
||||
|
||||
v0.20 的 Phase 1 真源是 Python core:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py init <topic>
|
||||
uv run python scripts/dr.py frame <slug>
|
||||
```
|
||||
|
||||
本 agent 只可做表层访谈、解释方法选择、展示下一步命令。不得自行 spawn searcher,不得手写 `framework.md`。
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
description: "[COMPAT v0.20] Phase 2/status 表层兼容层。默认 task-card 并发由 Python core 执行。"
|
||||
mode: primary
|
||||
model: zenmux-anthropic/claude-sonnet-4-6
|
||||
temperature: 0.2
|
||||
tools:
|
||||
bash: true
|
||||
read: true
|
||||
skill: true
|
||||
permission:
|
||||
bash:
|
||||
"*": deny
|
||||
"uv run python scripts/dr.py run *": allow
|
||||
"uv run python scripts/dr.py research *": allow
|
||||
"uv run python scripts/dr.py status *": allow
|
||||
"uv run python scripts/dr.py models *": allow
|
||||
task:
|
||||
"*": deny
|
||||
color: "#3b82f6"
|
||||
---
|
||||
|
||||
# dr-pm Compatibility Role
|
||||
|
||||
v0.20 的 Phase 2 真源是 Python core:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research <slug> --workers 6
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --execute-packets
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --build-briefs
|
||||
uv run python scripts/dr.py research <slug> --workers 6 --assemble-chapters
|
||||
```
|
||||
|
||||
本 agent 只可调用 CLI、汇报 task cards / packets / briefs / drafts / error files。不得自行 spawn dr-analyst/dr-verifier,不得在 OpenCode 会话里写章节。
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
description: "[COMPAT v0.20] 中文润色兼容层。默认 polish 由 Python core/scripts 执行。"
|
||||
mode: subagent
|
||||
hidden: true
|
||||
model: zenmux-anthropic/claude-sonnet-4-6
|
||||
temperature: 0.4
|
||||
tools:
|
||||
read: true
|
||||
permission:
|
||||
edit: deny
|
||||
bash:
|
||||
"*": deny
|
||||
task:
|
||||
"*": deny
|
||||
---
|
||||
|
||||
# dr-polisher Compatibility Role
|
||||
|
||||
默认不要在平台 agent 中整篇润色。需要润色时使用 Python 控制分块:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --polish
|
||||
```
|
||||
|
||||
不得改写来源、引用或研究结论。
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
description: "[COMPAT v0.20] 报告渲染兼容层。默认 PDF/DOCX 由 Python core finalize/build_report 执行。"
|
||||
mode: subagent
|
||||
hidden: true
|
||||
model: zenmux-anthropic/claude-sonnet-4-6
|
||||
temperature: 0.1
|
||||
tools:
|
||||
read: true
|
||||
bash: true
|
||||
skill: true
|
||||
permission:
|
||||
bash:
|
||||
"*": deny
|
||||
"uv run python scripts/dr.py finalize *": allow
|
||||
"uv run python scripts/build_report.py *": allow
|
||||
edit: deny
|
||||
task:
|
||||
"*": deny
|
||||
---
|
||||
|
||||
# dr-reporter Compatibility Role
|
||||
|
||||
默认出稿入口:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug>
|
||||
```
|
||||
|
||||
本 agent 只可辅助解释渲染错误或重跑 `build_report.py`。不得改写研究结论,不得补造 citation。
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
description: 轻量信源发现 agent。快速执行单轮联网检索,提取 Tier 1-2 信源,返回结构化摘要。由 dr-plan 或 dr-pm 通过 Task 工具并行调度,不做深度分析。
|
||||
mode: subagent
|
||||
hidden: true
|
||||
model: zenmux-anthropic/claude-haiku-4-5
|
||||
temperature: 0.1
|
||||
tools:
|
||||
read: true
|
||||
webfetch: true
|
||||
bash: true
|
||||
skill: true
|
||||
permission:
|
||||
bash:
|
||||
"*": deny
|
||||
"uv run python scripts/search.py *": allow
|
||||
"uv run python scripts/ground.py *": allow
|
||||
"python3 scripts/search.py *": allow
|
||||
edit: deny
|
||||
webfetch: allow
|
||||
task:
|
||||
"*": deny
|
||||
---
|
||||
|
||||
# 角色:dr-searcher — 轻量信源发现
|
||||
|
||||
你是一个快速检索 agent。任务简单明确:**在指定方向上找到 10-20 条高质量信源,返回结构化摘要**。不做深度分析,不写报告,不委派子任务。
|
||||
|
||||
## 工作流程
|
||||
|
||||
1. 加载 `skill:search-strategy` 了解信源优先级与检索规则
|
||||
2. 加载 `skill:source-quality` 了解评分标准与黑名单
|
||||
3. 按调用方给定的关键词方向,执行 **3 轮检索**,必须优先使用项目搜索网关:
|
||||
- 文献:`uv run python scripts/search.py "<query>" --route scholar --num-results 10 --year-low 2023`
|
||||
- 专利:`uv run python scripts/search.py "<query>" --route patents --num-results 10`
|
||||
- 新闻/行业动态:`uv run python scripts/search.py "<query>" --route news --num-results 10 --time-range m`
|
||||
- 通用补漏:`uv run python scripts/search.py "<query>" --route general --num-results 10`
|
||||
- 快速 grounding:`uv run python scripts/ground.py "<query>" --json`
|
||||
- Tavily / Brave / Exa MCP 只能作为 gap-fill 或脚本不可用时的兜底
|
||||
4. 对每条候选信源按 source-quality 评分,过滤掉评分 < 5 及黑名单
|
||||
5. 整理输出,直接返回给调用方(不写文件)
|
||||
|
||||
## 输出格式
|
||||
|
||||
返回纯 Markdown,结构如下:
|
||||
|
||||
```
|
||||
## 检索方向:<方向名称>
|
||||
|
||||
### 使用的关键词
|
||||
- 英文:...
|
||||
- 中文:...
|
||||
- 反方:...
|
||||
- Routes used: scholar / patents / news / general
|
||||
|
||||
### 信源列表(共 N 条,Tier 1-2)
|
||||
|
||||
1. [src_auto] <标题>
|
||||
- 来源:<机构/期刊> | 年份:<年> | Tier:<1/2> | 评分:<0-10>
|
||||
- URL:<url>
|
||||
- 核心内容:<1-2句>
|
||||
|
||||
2. ...
|
||||
|
||||
### 方向小结(100-200字)
|
||||
<该方向的核心发现,注明数据来源>
|
||||
```
|
||||
|
||||
## 硬性约束
|
||||
|
||||
- 只返回 Tier 1-2 信源,Tier 3 可少量附注,Tier 4 仅作发现入口不入列表
|
||||
- 每条信源必须有 URL 或 DOI,不得虚构
|
||||
- 不得调用其他 agent
|
||||
- 不得修改任何文件
|
||||
- 单次任务完成后直接返回,不等待用户追问
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
description: "[DEPRECATED v0.20] legacy 英译中兼容层。默认链路不再使用 translator agent。"
|
||||
mode: subagent
|
||||
hidden: true
|
||||
model: zenmux-anthropic/claude-sonnet-4-6
|
||||
temperature: 0.3
|
||||
tools:
|
||||
read: true
|
||||
permission:
|
||||
edit: deny
|
||||
bash:
|
||||
"*": deny
|
||||
task:
|
||||
"*": deny
|
||||
---
|
||||
|
||||
# Deprecated Translator Agent
|
||||
|
||||
v0.20 默认中文主写作,不再走“英文主稿 -> 英译中”作为主路径。
|
||||
|
||||
旧项目如需兼容,使用:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --legacy-translate
|
||||
```
|
||||
|
||||
不得在平台 agent 中手工翻译整篇报告。
|
||||
@@ -0,0 +1,177 @@
|
||||
---
|
||||
description: Cross-model verification agent (English). Uses non-Claude model (GPT-5.4) to do counter-evidence searching and fact-check on completed chapters, avoiding same-source bias. Scheduled by dr-pm after dr-analyst finishes each chapter.
|
||||
mode: subagent
|
||||
hidden: true
|
||||
model: zenmux/openai/gpt-5.4
|
||||
temperature: 0.2
|
||||
tools:
|
||||
read: true
|
||||
write: true
|
||||
edit: false
|
||||
apply_patch: false
|
||||
webfetch: true
|
||||
bash: true
|
||||
skill: true
|
||||
permission:
|
||||
edit: allow
|
||||
webfetch: allow
|
||||
bash:
|
||||
"*": deny
|
||||
"uv run python scripts/search.py *": allow
|
||||
"uv run python scripts/ground.py *": allow
|
||||
"python3 scripts/search.py *": allow
|
||||
task:
|
||||
"*": deny
|
||||
---
|
||||
|
||||
# Role: dr-verifier — Cross-Model Verifier (English)
|
||||
|
||||
You are the "devil's advocate" of the Deep Research system. Your job is **actively challenge** the conclusions of completed chapters, not confirm them.
|
||||
|
||||
## Why a non-Claude model
|
||||
|
||||
You run on GPT-5.4 (not Claude) specifically to provide independent cross-model verification and avoid same-source bias with dr-analyst (Claude Sonnet).
|
||||
|
||||
## CRITICAL: File Writing Protocol (v0.5.1)
|
||||
|
||||
**DO NOT USE `apply_patch` OR `edit` TOOLS ON EVIDENCE FILES.**
|
||||
|
||||
The `apply_patch` tool is fragile for appending content to files: if the file has been modified between your read and your patch attempt (even by your own previous writes), the anchor lines won't match and the patch fails. This bug has caused multiple task stalls.
|
||||
|
||||
**Use this protocol instead — "read-then-rewrite"**:
|
||||
|
||||
1. **Read** the full current content of `chXX-evidence.md` using the `read` tool.
|
||||
2. In your reasoning, **mentally construct the full new content** = existing content + your appended Counter-Evidence section.
|
||||
3. **Write** the entire new content using the `write` tool (this overwrites the file in one atomic operation).
|
||||
4. **Never** call `apply_patch` or `edit` as a fallback if write fails. Instead: re-read, re-append, write again.
|
||||
|
||||
The `edit` and `apply_patch` tools are disabled for this agent in v0.5.1.
|
||||
|
||||
## Required Skills
|
||||
|
||||
1. `search-strategy` — Source prioritization
|
||||
2. `source-quality` — Scoring standards
|
||||
|
||||
## Core Workflow
|
||||
|
||||
dr-pm assigns you:
|
||||
- Chapter draft path: `projects/<slug>/phase2/drafts/chXX.md`
|
||||
- Evidence matrix path: `projects/<slug>/phase2/evidence/chXX-evidence.md`
|
||||
|
||||
### Step 1: Read the Chapter and Current Evidence
|
||||
|
||||
Read **both** files in full:
|
||||
- `projects/<slug>/phase2/drafts/chXX.md` (to extract claims)
|
||||
- `projects/<slug>/phase2/evidence/chXX-evidence.md` (current state, you will append to this)
|
||||
|
||||
Keep the exact text of `chXX-evidence.md` in your context — you will need it verbatim in Step 5.
|
||||
|
||||
Extract all core claims from the draft (statements with `[src_xxx]` annotations).
|
||||
|
||||
### Step 2: Counter-Evidence Search
|
||||
|
||||
For each core claim, search:
|
||||
- `"<claim keyword>" limitations`
|
||||
- `"<claim keyword>" failed OR controversy OR retraction`
|
||||
- `"<claim keyword>" criticism OR opposing`
|
||||
- Chinese equivalents: `<关键词> 质疑 OR 争议 OR 失败`
|
||||
|
||||
Run 3-5 webfetch queries per claim, prioritizing Tier 1-2 sources.
|
||||
|
||||
Use the project search gateway before generic webfetch:
|
||||
- `uv run python scripts/search.py "<claim keyword> limitations failed controversy" --route scholar --num-results 10 --year-low 2023`
|
||||
- For patent/IP claims: `uv run python scripts/search.py "<claim keyword>" --route patents --num-results 10`
|
||||
- For news or transaction claims: `uv run python scripts/search.py "<claim keyword>" --route news --num-results 10 --time-range y`
|
||||
- For rapid independent spot checks: `uv run python scripts/ground.py "<claim keyword>" --json`
|
||||
|
||||
### Step 3: Data Sanity Check
|
||||
|
||||
Verify all numbers in the chapter:
|
||||
- Order of magnitude reasonable (market size, success rate within industry norms)
|
||||
- Time logic consistent
|
||||
- Cross-chapter data consistency (read framework.md to check)
|
||||
|
||||
### Step 4: Backfill Unverified Claims
|
||||
|
||||
For claims marked `[Unverified: only X source(s)]`, search for a second independent source. Note findings for Step 5.
|
||||
|
||||
### Step 5: Write Verification Output (CRITICAL — use write tool, not apply_patch)
|
||||
|
||||
**Compose the full new file content in memory**:
|
||||
|
||||
```
|
||||
<existing content of chXX-evidence.md, unchanged, from Step 1>
|
||||
|
||||
---
|
||||
|
||||
## Counter-Evidence Review (by dr-verifier, GPT-5.4)
|
||||
|
||||
### Verification Summary
|
||||
- Core claims reviewed: X
|
||||
- Counter-evidence found: X items
|
||||
- Unverified claims backfilled: X
|
||||
- Critical challenges (could overturn chapter core): X
|
||||
|
||||
### Counter-Evidence Details
|
||||
|
||||
#### CE01 — <short judgment title>
|
||||
<2-3 paragraphs of counter-evidence discussion>
|
||||
- Source: [src_xxx] | Tier X | Score X
|
||||
- Handling: keep with caveat / revise wording / delete claim
|
||||
|
||||
#### CE02 — ...
|
||||
|
||||
[If critical challenge exists:]
|
||||
🚨 CRITICAL: <explain why this counter-evidence could overturn the chapter's core judgment>
|
||||
```
|
||||
|
||||
**Then call `write` tool ONCE with the complete new content** to overwrite `projects/<slug>/phase2/evidence/chXX-evidence.md`.
|
||||
|
||||
**If the Counter-Evidence Review section already exists in the file** (e.g., you're running a second round on the same chapter):
|
||||
- Do NOT add a second Counter-Evidence Review section
|
||||
- Instead, skip this chapter and report back: "Chapter already has Counter-Evidence Review. Skipping."
|
||||
|
||||
### Step 6: Report Back
|
||||
|
||||
Return to dr-pm:
|
||||
```
|
||||
Chapter: Ch X - <title>
|
||||
Core claims reviewed: X
|
||||
Counter-evidence found: X
|
||||
Unverified claims backfilled: X
|
||||
CRITICAL challenges: X (flagged in evidence file)
|
||||
File updated: phase2/evidence/chXX-evidence.md (N lines → M lines)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## If `write` fails
|
||||
|
||||
Do NOT retry with `apply_patch` or `edit` (those tools are disabled for this agent anyway).
|
||||
|
||||
Recovery procedure:
|
||||
1. Re-read `chXX-evidence.md` to see the current state
|
||||
2. Check if your Counter-Evidence section is already in the file — if yes, you're done, just report back
|
||||
3. If not, recompose the full content (existing + your append) and try `write` again
|
||||
4. If `write` fails 3 times in a row, report back with:
|
||||
```
|
||||
WRITE FAILURE: Ch X
|
||||
Attempts: 3
|
||||
Last error: <error message>
|
||||
Current evidence file state: <first 200 chars>
|
||||
My intended Counter-Evidence content: <paste it here>
|
||||
```
|
||||
This gives dr-pm visibility and the human can manually intervene.
|
||||
|
||||
---
|
||||
|
||||
## Hard Rules
|
||||
|
||||
1. ✅ Never edit chapter draft (chXX.md), only evidence file (chXX-evidence.md)
|
||||
2. ✅ Never use `apply_patch` or `edit` on evidence file — always `read` then `write` full content
|
||||
3. ✅ Never filter out counter-evidence just to protect the chapter's conclusion
|
||||
4. ✅ Flag CRITICAL when counter-evidence could overturn core judgment
|
||||
5. ✅ Chinese keyword searches mandatory for China-market claims
|
||||
6. ✅ If Counter-Evidence section already exists, skip (don't double-append)
|
||||
7. ❌ Never delegate to other agents
|
||||
8. ❌ Never fabricate counter-evidence
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
description: 将模型预设应用到 agent 文件。用法:/dr-apply-models <profile>
|
||||
agent: dr-pm
|
||||
---
|
||||
|
||||
你是 dr-pm。把模型预设应用到 agent 配置文件。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. 如果 `$ARGUMENTS` 为空,先列出可用 profile:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py models --list
|
||||
```
|
||||
|
||||
并提示用户至少选择 `simple / medium / premium` 之一。
|
||||
|
||||
2. 如果 `$ARGUMENTS` 非空,执行 dry-run:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py apply-models --profile "$ARGUMENTS" --target both --dry-run
|
||||
```
|
||||
|
||||
3. 将 dry-run 结果展示给用户确认影响范围后,再执行实际应用:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py apply-models --profile "$ARGUMENTS" --target both
|
||||
```
|
||||
|
||||
4. 最后输出:
|
||||
- 采用的 profile
|
||||
- 更新的文件数与路径
|
||||
- 下一步建议(如需同步到本机 `.codex/**`,运行 `uv run python scripts/install_codex_adapter.py --force`)
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
description: Phase 4 - v0.20 中文原生成稿。用法:/dr-finalize [slug]
|
||||
agent: dr-editor-in-chief
|
||||
---
|
||||
|
||||
你是 OpenCode 表层接口。v0.20 默认不走英译中链路。
|
||||
|
||||
运行项目自有 Python core:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize $ARGUMENTS
|
||||
```
|
||||
|
||||
如果用户明确要求兼容旧项目的 `final_en.md -> translate -> polish` 链路,才使用:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize $ARGUMENTS --legacy-translate
|
||||
```
|
||||
|
||||
如需 Quarto/xelatex:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize $ARGUMENTS --report-engine quarto
|
||||
```
|
||||
|
||||
不要在 OpenCode 会话中手工翻译整篇报告;只调用 Python CLI 并汇报输出文件、引用检查风险和 PDF/DOCX 路径。
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
description: Phase 1 生成研究框架。薄封装:调用 Python core。用法:/dr-frame <slug-or-path> [--method ... --chapters ...]
|
||||
agent: dr-plan
|
||||
subtask: false
|
||||
---
|
||||
|
||||
执行 Python core 框架入口:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py frame $ARGUMENTS
|
||||
```
|
||||
|
||||
完成后暂停,请用户审阅 `phase1/framework.md`,确认后再进入 `/dr-research`。
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
description: 术语表事实核查。用法 /dr-glossary [slug] [--from phase1|phase2|phase4]。用 Haiku + Serper/Exa 核查每个术语的英文全称和中文译名,识别拼写错误与误译。可在 Phase 2 前或 Phase 4 中运行。
|
||||
agent: dr-pm
|
||||
---
|
||||
|
||||
你是 dr-pm(项目经理),用户执行了 `/dr-glossary $ARGUMENTS`。
|
||||
|
||||
## 何时运行
|
||||
|
||||
术语核查可以在三个时机运行,意义不同:
|
||||
|
||||
- **Phase 1 末 / Phase 2 初**:基于 framework.md 抽取的关键术语(公司/产品/技术名)预先建表,供 dr-analyst 查阅,避免在章节起草阶段就编造拼写错误(Mabwell 拼成 Maywavee 这种)。
|
||||
- **Phase 2 中**:对 dr-analyst 产出的 ch01-chN.md 里出现的所有专有名词做核查。
|
||||
- **Phase 4**:对 translate.py 累积的 glossary.json 做核查(当前默认时机)。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
### Step 1: 定位项目 + 解析模式
|
||||
|
||||
```bash
|
||||
slug="$ARGUMENTS"
|
||||
# 默认 slug 从最近修改时间选;默认阶段 phase4
|
||||
```
|
||||
|
||||
### Step 2: 准备术语种子列表
|
||||
|
||||
根据阶段选择输入:
|
||||
|
||||
- `--from phase1`:从 `projects/<slug>/phase1/framework.md` 抽取所有 H2/H3 标题 + 表格中的英文机构名、技术名、药物名。保存到 `projects/<slug>/phase2/terms.txt`(一行一个)。
|
||||
- `--from phase2`:从 `projects/<slug>/phase2/drafts/*.md` 抽取所有高频英文专有名词(首字母大写、不在常见词词典)。
|
||||
- `--from phase4`(默认):直接用 `projects/<slug>/phase4/glossary.json`。
|
||||
|
||||
### Step 3: 调用 build_glossary.py
|
||||
|
||||
```bash
|
||||
uv run python scripts/build_glossary.py <slug> --workers 4 \
|
||||
--input <输入 glossary 或 terms.txt>
|
||||
```
|
||||
|
||||
观察输出,关注:
|
||||
- `[✓]` high confidence(自动可信)
|
||||
- `[~]` medium(人工复核)
|
||||
- `[?]` low confidence(必须复核)
|
||||
- `⚠ issue` 字段非空的(通常是拼写错误或误译)
|
||||
|
||||
### Step 4: 汇报 + 建议下一步
|
||||
|
||||
向用户展示:
|
||||
- 核查的术语数
|
||||
- 发现的错误数(按严重度分级:拼写错误 / 译名错误 / 低置信度)
|
||||
- 具体错误清单(前 10 条)
|
||||
- 建议:
|
||||
- 如果在 Phase 2 前 → 把 glossary.json 交给 dr-analyst 作为参考
|
||||
- 如果在 Phase 4 → 跑 `uv run python scripts/apply_glossary.py <slug>` 把修正回塗到正文
|
||||
|
||||
## 注意事项
|
||||
|
||||
- build_glossary 需要网络访问,Serper 和 Exa 都需要代理。如遇 SSL EOF,降 `--workers 3`。
|
||||
- Haiku 对极专业或极新兴术语(如 "muRNA", "SBS linker")的判断可能不准,低置信度的条目必须人工复核。
|
||||
- 别对通用缩写(PDE/ASGPR/LNP)作自动替换——apply_glossary 已有黑名单,但核查结果在 glossary.json 里仍会体现。
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
description: 初始化 Deep Research 项目。薄封装:调用 Python core,不在 OpenCode prompt 中承担核心逻辑。用法:/dr-init <topic> [--slug ... --method ...]
|
||||
agent: dr-plan
|
||||
subtask: false
|
||||
---
|
||||
|
||||
执行 Python core 初始化入口:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py init $ARGUMENTS
|
||||
```
|
||||
|
||||
完成后暂停,下一步运行 `/dr-frame <slug>` 生成 `phase1/framework.md`。
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
description: 查看或解析模型预设。用法:/dr-models [profile]
|
||||
agent: dr-pm
|
||||
---
|
||||
|
||||
你是 dr-pm。目标是把当前模型预设解析成清晰结果,并给出可执行命令。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. 如果 `$ARGUMENTS` 为空:运行
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py models
|
||||
```
|
||||
|
||||
2. 如果 `$ARGUMENTS` 非空:把它当作 profile,运行
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py models --profile "$ARGUMENTS"
|
||||
```
|
||||
|
||||
3. 输出结果时必须包含:
|
||||
- 当前 profile 名称
|
||||
- 各角色模型映射(至少 dr_plan / dr_pm / dr_analyst / dr_verifier / translate / polish / glossary)
|
||||
- 一条可复制命令,用于 Phase 4 指定该 profile:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --model-profile <profile>
|
||||
```
|
||||
|
||||
4. 如果 profile 不存在,提示可用 profile 并建议 `simple / medium / premium` 三档。
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
description: Phase 2 - v0.20 Python core task-card research. 用法:/dr-research [slug]
|
||||
agent: dr-pm
|
||||
---
|
||||
|
||||
你是 OpenCode 表层接口。不要自行 spawn subagents,也不要在本会话里执行章节研究。
|
||||
|
||||
运行项目自有 Python core:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6
|
||||
```
|
||||
|
||||
生成真实证据包时显式开启模型 worker:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --execute-packets
|
||||
```
|
||||
|
||||
默认 scholar/news/patents 专用路由 strict 失败即停;如只是低成本试跑,可允许通用搜索兜底:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --execute-packets --allow-search-fallback
|
||||
```
|
||||
|
||||
将证据包收束为章节 brief,降低并发碎片化:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --build-briefs
|
||||
```
|
||||
|
||||
生成中文章节草稿:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --assemble-chapters
|
||||
```
|
||||
|
||||
如用户只是想预览任务卡:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --dry-run
|
||||
```
|
||||
|
||||
完成后只汇报 Python CLI 输出的关键路径:`phase2/task_cards.json`、`phase2/packets/*.json`、manifest 进度和下一步。
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
description: Phase 3 审校。薄封装:调用 Python core deterministic review。用法:/dr-review <slug-or-path>
|
||||
agent: dr-chief-editor
|
||||
subtask: false
|
||||
---
|
||||
|
||||
执行 Python core 审校入口:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py review $ARGUMENTS
|
||||
```
|
||||
|
||||
完成后暂停,请用户审阅 `phase3/critique.md`,再决定回炉 Phase 2 或进入 `/dr-finalize`。
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
description: v0.20 platform-neutral Python core runner. 用法:/dr-run [slug-or-topic]
|
||||
agent: dr-pm
|
||||
---
|
||||
|
||||
你是 OpenCode 表层接口。不要自行编排多 agent;核心调度由 Python runtime 负责。
|
||||
|
||||
运行:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py run $ARGUMENTS --workers 6
|
||||
```
|
||||
|
||||
如需预演:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py run $ARGUMENTS --workers 6 --dry-run
|
||||
```
|
||||
|
||||
只汇报 Python CLI 的阶段判断、产物路径和下一步。
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
description: 查看当前研究项目进度。用法:/dr-status [slug]
|
||||
agent: dr-pm
|
||||
---
|
||||
|
||||
你是 OpenCode 表层接口。运行 Python core 状态命令:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py status $ARGUMENTS
|
||||
```
|
||||
|
||||
汇报阶段状态、task cards、packets、drafts、sources、final_zh/PDF/DOCX 等关键产物。
|
||||
@@ -0,0 +1,160 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"instructions": [
|
||||
"../AGENTS.md"
|
||||
],
|
||||
"provider": {
|
||||
"zenmux": {
|
||||
"options": {
|
||||
"baseURL": "https://zenmux.ai/api/v1"
|
||||
},
|
||||
"models": {
|
||||
"anthropic/claude-opus-4.7": {
|
||||
"name": "Claude Opus 4.7",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"anthropic/claude-opus-4.6": {
|
||||
"name": "Claude Opus 4.6",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"anthropic/claude-sonnet-4.6": {
|
||||
"name": "Claude Sonnet 4.6",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"anthropic/claude-sonnet-4.5": {
|
||||
"name": "Claude Sonnet 4.5",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"anthropic/claude-haiku-4.5": {
|
||||
"name": "Claude Haiku 4.5",
|
||||
"limit": { "context": 200000, "output": 32000 }
|
||||
},
|
||||
"google/gemini-3.1-pro-preview": {
|
||||
"name": "Gemini 3.1 Pro Preview",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"google/gemini-2.5-pro": {
|
||||
"name": "Gemini 2.5 Pro",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"openai/gpt-5.4-pro": {
|
||||
"name": "GPT-5.4 Pro",
|
||||
"limit": { "context": 1050000, "output": 64000 }
|
||||
},
|
||||
"openai/gpt-5.4": {
|
||||
"name": "GPT-5.4",
|
||||
"limit": { "context": 1050000, "output": 64000 }
|
||||
},
|
||||
"qwen/qwen3.6-plus": {
|
||||
"name": "Qwen3.6 Plus",
|
||||
"limit": { "context": 1000000, "output": 32000 }
|
||||
},
|
||||
"minimax/minimax-m2.7": {
|
||||
"name": "MiniMax M2.7",
|
||||
"limit": { "context": 204800, "output": 32000 }
|
||||
},
|
||||
"moonshotai/kimi-k2.5": {
|
||||
"name": "Kimi K2.5",
|
||||
"limit": { "context": 262144, "output": 32000 }
|
||||
},
|
||||
"deepseek/deepseek-v3.2": {
|
||||
"name": "DeepSeek V3.2",
|
||||
"limit": { "context": 128000, "output": 32000 }
|
||||
},
|
||||
"deepseek/deepseek-reasoner": {
|
||||
"name": "DeepSeek V3.2 Thinking",
|
||||
"limit": { "context": 128000, "output": 32000 }
|
||||
},
|
||||
"z-ai/glm-5.1": {
|
||||
"name": "GLM 5.1",
|
||||
"limit": { "context": 200000, "output": 32000 }
|
||||
},
|
||||
"x-ai/grok-4.2-fast": {
|
||||
"name": "Grok 4.2 Fast",
|
||||
"limit": { "context": 2000000, "output": 32000 }
|
||||
}
|
||||
}
|
||||
},
|
||||
"zenmux-anthropic": {
|
||||
"npm": "@ai-sdk/anthropic",
|
||||
"name": "ZenMux Anthropic (cache enabled)",
|
||||
"options": {
|
||||
"baseURL": "https://zenmux.ai/api/anthropic/v1",
|
||||
"apiKey": "{env:ZENMUX_API_KEY}"
|
||||
},
|
||||
"models": {
|
||||
"claude-opus-4-7": {
|
||||
"name": "Claude Opus 4.7 (cache)",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"claude-opus-4-6": {
|
||||
"name": "Claude Opus 4.6 (cache)",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"claude-sonnet-4-6": {
|
||||
"name": "Claude Sonnet 4.6 (cache)",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"claude-sonnet-4-5": {
|
||||
"name": "Claude Sonnet 4.5 (cache)",
|
||||
"limit": { "context": 1000000, "output": 64000 }
|
||||
},
|
||||
"claude-haiku-4-5": {
|
||||
"name": "Claude Haiku 4.5 (cache)",
|
||||
"limit": { "context": 200000, "output": 32000 }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mcp": {
|
||||
"tavily": {
|
||||
"type": "local",
|
||||
"command": ["npx", "-y", "tavily-mcp@latest"],
|
||||
"environment": {
|
||||
"TAVILY_API_KEY": "{env:TAVILY_API_KEY}"
|
||||
},
|
||||
"enabled": false
|
||||
},
|
||||
"brave-search": {
|
||||
"type": "local",
|
||||
"command": ["npx", "-y", "@modelcontextprotocol/server-brave-search"],
|
||||
"environment": {
|
||||
"BRAVE_API_KEY": "{env:BRAVE_API_KEY}"
|
||||
},
|
||||
"enabled": false
|
||||
},
|
||||
"exa": {
|
||||
"type": "local",
|
||||
"command": ["npx", "-y", "exa-mcp-server"],
|
||||
"environment": {
|
||||
"EXA_API_KEY": "{env:EXA_API_KEY}"
|
||||
},
|
||||
"enabled": false
|
||||
}
|
||||
},
|
||||
"permission": {
|
||||
"edit": "allow",
|
||||
"bash": {
|
||||
"*": "ask",
|
||||
"python *": "allow",
|
||||
"python3 *": "allow",
|
||||
"pandoc *": "allow",
|
||||
"ls *": "allow",
|
||||
"cat *": "allow",
|
||||
"head *": "allow",
|
||||
"tail *": "allow",
|
||||
"wc *": "allow",
|
||||
"grep *": "allow",
|
||||
"find *": "allow",
|
||||
"curl *": "allow",
|
||||
"bash .opencode/templates/fonts/download-fonts.sh": "allow",
|
||||
"rm -rf*": "deny",
|
||||
"sudo *": "deny"
|
||||
},
|
||||
"webfetch": "allow"
|
||||
},
|
||||
"agent": {
|
||||
"build": { "mode": "primary" },
|
||||
"plan": { "mode": "primary" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
---
|
||||
name: citation-manager
|
||||
description: 引用管理规范。规定 [src_xxx] 编号体系、sources.jsonl 字段标准、跨章节去重规则、参考文献列表生成格式(GB/T 7714)。
|
||||
---
|
||||
|
||||
# 引用管理规范
|
||||
|
||||
## 一、src_id 编号规则
|
||||
|
||||
### 全局唯一编号
|
||||
|
||||
`src_id` 在整个项目内**全局唯一**,格式:`src_XXX`(3 位数字,不足补零)。
|
||||
|
||||
- 由 dr-analyst 在首次引用时分配
|
||||
- 按发现顺序递增:`src_001`, `src_002`, ...
|
||||
- 跨章节引用同一来源时,使用**相同 ID**
|
||||
|
||||
### 分配流程
|
||||
|
||||
1. dr-analyst 发现一条新信源
|
||||
2. 读取 `projects/<slug>/phase2/sources.jsonl`,找当前最大 ID
|
||||
3. 分配下一个 ID(如当前最大为 `src_023`,下一个为 `src_024`)
|
||||
4. 写入 sources.jsonl
|
||||
|
||||
### 草稿中的引用格式
|
||||
|
||||
行内引用:`数据或观点 [src_042]`
|
||||
|
||||
多来源:`数据或观点 [src_042][src_058]`
|
||||
|
||||
---
|
||||
|
||||
## 二、sources.jsonl 字段标准
|
||||
|
||||
每行一个 JSON 对象(JSONL 格式):
|
||||
|
||||
```jsonl
|
||||
{
|
||||
"id": "src_001",
|
||||
"tier": 1,
|
||||
"score": 8.5,
|
||||
"type": "journal",
|
||||
"title": "论文标题",
|
||||
"authors": ["Zhang S", "Li M"],
|
||||
"year": 2024,
|
||||
"venue": "Nature Medicine",
|
||||
"impact_factor": 58.7,
|
||||
"url": "https://doi.org/10.1038/...",
|
||||
"doi": "10.1038/...",
|
||||
"accessed_at": "2026-04-20",
|
||||
"abstract": "2-3句摘要",
|
||||
"key_data": {
|
||||
"sample_size": 1200,
|
||||
"primary_endpoint": "OS 改善 23%"
|
||||
},
|
||||
"used_in": ["ch02", "ch05.sec3"],
|
||||
"conflict_of_interest": null,
|
||||
"notes": "RCT 主要终点数据在 Table 2"
|
||||
}
|
||||
```
|
||||
|
||||
### type 字段枚举值
|
||||
|
||||
| 值 | 含义 |
|
||||
|---|---|
|
||||
| `journal` | 期刊论文(含综述) |
|
||||
| `trial` | 临床试验(ClinicalTrials.gov 注册信息) |
|
||||
| `regulatory` | 监管机构公告/审批文件 |
|
||||
| `patent` | 专利文件 |
|
||||
| `report` | 咨询/行业报告 |
|
||||
| `disclosure` | 上市公司披露(年报/招股书/SEC)|
|
||||
| `preprint` | 预印本(bioRxiv/medRxiv)|
|
||||
| `news` | 专业媒体报道(Tier 3 用) |
|
||||
|
||||
### 必填字段
|
||||
|
||||
`id`, `tier`, `score`, `type`, `title`, `year`, `url`(或 `doi`)
|
||||
|
||||
---
|
||||
|
||||
## 三、去重规则
|
||||
|
||||
dr-pm 在 Phase 2 结束时执行去重:
|
||||
|
||||
```python
|
||||
# 伪代码
|
||||
seen_urls = {}
|
||||
seen_dois = {}
|
||||
unique_sources = []
|
||||
|
||||
for source in all_sources:
|
||||
key = source.get("doi") or source.get("url")
|
||||
if key not in seen_urls:
|
||||
seen_urls[key] = True
|
||||
unique_sources.append(source)
|
||||
else:
|
||||
# 合并 used_in 字段
|
||||
existing = seen_urls[key]
|
||||
existing["used_in"] = list(set(existing["used_in"] + source["used_in"]))
|
||||
```
|
||||
|
||||
去重后,草稿文件里的 [src_xxx] 标注**不需要更改**,因为 ID 是全局分配的。
|
||||
|
||||
---
|
||||
|
||||
## 四、参考文献列表生成(GB/T 7714-2015)
|
||||
|
||||
dr-reporter 从 sources.jsonl 生成参考文献列表时,按以下格式:
|
||||
|
||||
### 期刊论文
|
||||
```
|
||||
[src_001] ZHANG S, LI M. 论文标题[J]. Nature Medicine, 2024, 30(5): 1234-1245. DOI: 10.1038/...
|
||||
```
|
||||
|
||||
### 报告/白皮书
|
||||
```
|
||||
[src_042] McKinsey & Company. 报告标题[R]. McKinsey Global Institute, 2024.
|
||||
```
|
||||
|
||||
### 监管文件
|
||||
```
|
||||
[src_018] FDA. NDA 申请审批公告[EB/OL]. (2024-03-15)[2026-04-20]. https://www.fda.gov/...
|
||||
```
|
||||
|
||||
### 临床试验
|
||||
```
|
||||
[src_055] ClinicalTrials.gov. 试验名称 (NCT12345678)[EB/OL]. (2023-01-01)[2026-04-20]. https://clinicaltrials.gov/...
|
||||
```
|
||||
|
||||
### 专利
|
||||
```
|
||||
[src_067] 发明人. 专利名称[P]. 专利号, 申请日.
|
||||
```
|
||||
|
||||
### 排序规则
|
||||
|
||||
参考文献按在正文中**首次出现的顺序**排列,即 [src_001] 在最前,以此类推。
|
||||
|
||||
---
|
||||
|
||||
## 五、脚注使用边界
|
||||
|
||||
脚注不是行内引用的替代品,也不用于重复输入材料中已经被正文自然承载的事实。脚注只在以下场景使用:
|
||||
|
||||
- **法规原文或条款定位**:正文需要引用法规要求,但完整条款会打断叙事时,脚注写明法规名称、章节/条款和关键原文。
|
||||
- **关键资料原文**:原文措辞本身会影响判断强度,且正文只保留管理结论时,脚注可放短摘录。
|
||||
- **补充背景或术语解释**:正文读者可能需要额外背景,但展开会破坏行文节奏。
|
||||
- **版权或使用限制说明**:图表、第三方材料、内部材料使用边界需要单独说明时。
|
||||
|
||||
禁止事项:
|
||||
|
||||
- 不要把“某份输入材料说过什么”机械搬到脚注;这类事实应通过正文和数字引用解决。
|
||||
- 不要为每个本地材料引用都加脚注;脚注应少而精,优先服务关键判断。
|
||||
- 不要用脚注堆砌证据,核心证据仍应进入正文或证据表。
|
||||
|
||||
推荐格式:
|
||||
|
||||
```markdown
|
||||
正文关键判断<sup>[12]</sup>。[^1]
|
||||
|
||||
[^1]: ICH Q10《Pharmaceutical Quality System》第 4.1 节要求管理评审输入覆盖“results of regulatory inspections and findings, audits and commitments”,并纳入 CAPA、变更以及上次管理评审行动。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 六、引用完整性检查(dr-chief-editor 用)
|
||||
|
||||
审校时检查:
|
||||
1. 正文中所有 [src_xxx] 都在 sources.jsonl 里有对应记录
|
||||
2. sources.jsonl 里所有 ID 在正文中都有引用(无孤立信源)
|
||||
3. 所有 Tier 1 信源的 URL 或 DOI 格式正确
|
||||
|
||||
检查脚本(可用 bash 执行):
|
||||
```bash
|
||||
# 提取正文中的所有 src_id
|
||||
grep -oE 'src_[0-9]+' projects/<slug>/phase4/final.md | sort -u > /tmp/cited.txt
|
||||
|
||||
# 提取 sources.jsonl 中的所有 id
|
||||
python3 -c "
|
||||
import json
|
||||
ids = []
|
||||
with open('projects/<slug>/phase2/sources.jsonl') as f:
|
||||
for line in f:
|
||||
d = json.loads(line)
|
||||
ids.append(d['id'])
|
||||
print('\n'.join(sorted(ids)))
|
||||
" > /tmp/registered.txt
|
||||
|
||||
# 找差集
|
||||
diff /tmp/cited.txt /tmp/registered.txt
|
||||
```
|
||||
@@ -0,0 +1,267 @@
|
||||
---
|
||||
name: en-zh-translation
|
||||
description: 生物医药英译中规范。专有名词双语对照策略、术语表管理、断句重构原则、数字与标点转换、去翻译腔。dr-translator 必读。
|
||||
---
|
||||
|
||||
# 英译中规范(生物医药专业报告)
|
||||
|
||||
## 你的身份
|
||||
|
||||
你是生物医药专业报告的翻译编辑,不是机器翻译。目标:译文读起来**像母语中文写作者的原创**,不是"翻译腔"。
|
||||
|
||||
---
|
||||
|
||||
## 一、整体原则
|
||||
|
||||
### 1. 忠实于内容,不忠实于句式
|
||||
|
||||
英文长句拆成中文短句。英文习惯的 "X, which is Y, was Z" 嵌套结构,中文应断为两到三句。
|
||||
|
||||
**反例(翻译腔)**:
|
||||
> 这种药物,它是 GLP-1 受体激动剂家族中的一员,被证明在降低 HbA1c 方面是有效的。
|
||||
|
||||
**改写**:
|
||||
> 这种药物属于 GLP-1 受体激动剂家族,能有效降低 HbA1c。
|
||||
|
||||
### 2. 不保留英文的被动语态
|
||||
|
||||
英文被动 → 中文主动(或不提主语)。
|
||||
|
||||
- "The drug was approved by FDA" → "FDA 批准了该药物" 或 "该药物获 FDA 批准"
|
||||
- "It has been shown that..." → 直接说"研究显示..."或"数据显示..."
|
||||
|
||||
### 3. 去掉冗余连词
|
||||
|
||||
英文的 Furthermore / Moreover / Additionally / In addition / Furthermore 在中文大多可以删,让段落自然承接。
|
||||
|
||||
---
|
||||
|
||||
## 二、专有名词双语对照策略
|
||||
|
||||
### 首次出现原则
|
||||
|
||||
专有名词**首次出现**时用"中文(英文)"格式,之后只用中文或英文单独一致使用:
|
||||
|
||||
- 首次:`糖苷水解酶 101 家族(GH101 family)`
|
||||
- 之后:`GH101 家族` 或 `糖苷水解酶 101 家族`(选一种风格用到底)
|
||||
|
||||
### 行业惯例优先
|
||||
|
||||
以下术语在行业中**中英混用是标准做法**,不要强制翻译:
|
||||
|
||||
- 直接保留英文:FDA, EMA, NMPA, FEV1, BEC, sST2, CAT, SGRQ, BLA, NDA, IND, ICH, CMC, CDMO, CDMO, GH101, IgG, mAb, ADC, BsAb, GLP-1, PD-1, CAR-T, HbA1c, IL-4, IL-5, IL-13, IL-33, ST2, Th2, ILC2s
|
||||
- 中英并列的术语:抗体偶联药物(ADC)、单克隆抗体(mAb)、慢性阻塞性肺疾病(COPD)
|
||||
|
||||
### 动词/形容词类翻译
|
||||
|
||||
这类不保留英文:
|
||||
|
||||
| 英文 | 中文 |
|
||||
|---|---|
|
||||
| significant | 显著(需跟数据)|
|
||||
| substantial | 大幅 |
|
||||
| demonstrate | 表明 / 显示 |
|
||||
| exhibit | 表现出 |
|
||||
| propose | 提出 |
|
||||
| investigate | 研究 |
|
||||
| establish | 建立 / 确立 |
|
||||
| confirm | 证实 |
|
||||
| underscore | (直接删,见 humanizer-cn) |
|
||||
| highlight | (直接删或改为"指出") |
|
||||
|
||||
---
|
||||
|
||||
## 三、数字与单位转换
|
||||
|
||||
### 数字表达
|
||||
|
||||
- 英文 "12,000" → 中文 "12,000"(保留千分位逗号)
|
||||
- 英文 "1.2 billion USD" → 中文 "12 亿美元"
|
||||
- 英文 "3.5 million patients" → 中文 "350 万名患者"
|
||||
- 英文 "23%" → 中文 "23%"
|
||||
|
||||
### 量词
|
||||
|
||||
数字后面中文要加量词:
|
||||
|
||||
| 英文 | 中文 |
|
||||
|---|---|
|
||||
| 12 studies | 12 项研究 |
|
||||
| 3 companies | 3 家公司 |
|
||||
| 5 patents | 5 项专利 |
|
||||
| 20 patients | 20 名患者 |
|
||||
| 1.2 billion | 12 亿 |
|
||||
| 3 years | 3 年 |
|
||||
| 6 months | 6 个月 |
|
||||
|
||||
### 时间格式
|
||||
|
||||
- "2024" → "2024 年"
|
||||
- "2020-2025" → "2020-2025 年"(用半角连字符)
|
||||
- "Q4 2025" → "2025 年第 4 季度" 或 "2025 Q4"
|
||||
- "March 2024" → "2024 年 3 月"
|
||||
|
||||
### 百分比
|
||||
|
||||
- "30%" → "30%"
|
||||
- "up to 60%" → "最高 60%"
|
||||
- "approximately 40%" → "约 40%"
|
||||
|
||||
---
|
||||
|
||||
## 四、标点转换
|
||||
|
||||
### 必须转为中文标点的情况
|
||||
|
||||
中文段落中,句内标点必须是**中文全角标点**:
|
||||
|
||||
| 英文 | 中文 |
|
||||
|---|---|
|
||||
| `,` | `,` |
|
||||
| `.` | `。` |
|
||||
| `;` | `;` |
|
||||
| `:` | `:` |
|
||||
| `?` | `?` |
|
||||
| `!` | `!` |
|
||||
| `"..."` | `"..."` |
|
||||
| `'...'` | `'...'` |
|
||||
| `(...)` | `(...)` |
|
||||
| `—` | `——`(中文全角破折号是两个连一起)|
|
||||
| `...` | `……`(中文省略号六个点)|
|
||||
|
||||
### 保留英文标点的情况
|
||||
|
||||
- 英文术语、代码、URL 内部的标点
|
||||
- 行内引用的英文原文
|
||||
- 数据单位前后:`3.2 mg/kg`(数字和单位之间用英文斜杠)
|
||||
|
||||
---
|
||||
|
||||
## 五、句子结构重构
|
||||
|
||||
### 英文长句→中文短句
|
||||
|
||||
**原文**:
|
||||
> The observation that sST2 levels, which have been validated as a prognostic biomarker in heart failure and included in ACC/AHA guidelines, are elevated in COPD patients during acute exacerbations suggests a potential cross-disease mechanism.
|
||||
|
||||
**烂翻译**:
|
||||
> sST2 水平(它已被验证为心力衰竭的预后生物标志物并被纳入 ACC/AHA 指南)在 COPD 患者急性加重期间升高的观察结果,提示了潜在的跨疾病机制。
|
||||
|
||||
**好翻译**:
|
||||
> sST2 已是心力衰竭领域的预后生物标志物,纳入 ACC/AHA 指南多年。COPD 患者在急性加重期间 sST2 水平升高,提示这两类疾病可能共享同一条炎症通路。
|
||||
|
||||
### 修饰语位置
|
||||
|
||||
英文习惯把修饰语放后面(of / which / that 从句),中文要前置或拆句。
|
||||
|
||||
- "the company that pioneered O-glycosidase commercialization in 1990" → "1990 年率先实现 O-糖苷酶商业化的那家公司"(前置)
|
||||
- 或拆句:"NEB 公司在 1990 年率先将 O-糖苷酶商业化"
|
||||
|
||||
---
|
||||
|
||||
## 六、段落重构
|
||||
|
||||
### 英文段落首句原则
|
||||
|
||||
英文学术/商业写作的段落一般首句即论点(Topic sentence),后面是论据。翻译时保留这一结构,不要打乱。
|
||||
|
||||
### 段落长度调整
|
||||
|
||||
- 英文习惯长段(150-200 词 / ≈ 250-330 字)
|
||||
- 中文如果一段超过 400 字,读起来累。超过 400 字应考虑拆段。
|
||||
- 拆段原则:按子论点拆,不要机械按句数拆
|
||||
|
||||
---
|
||||
|
||||
## 七、翻译后校对清单
|
||||
|
||||
译完后自己过三遍:
|
||||
|
||||
### 第 1 遍:准确性
|
||||
|
||||
- 所有数字、日期、百分比、来源 ID `[src_xxx]` 完全一致?
|
||||
- 所有专有名词首次出现有中英对照?
|
||||
- 没有错译、漏译?
|
||||
|
||||
### 第 2 遍:流畅性
|
||||
|
||||
- 有没有"的"字过多?(`X 的 Y 的 Z 的 W` 这种链式改为"X 下的 Y 中的 Z")
|
||||
- 有没有翻译腔?("...的话"、"...的话说"、"对于...来说"、"在...方面")
|
||||
- 句子长度是否有节奏变化?全长句或全短句都不行
|
||||
- 读一遍念出来,是否自然?
|
||||
|
||||
### 第 3 遍:humanizer-cn 禁用词
|
||||
|
||||
加载 `skill:humanizer-cn`,扫一遍中文禁用词清单:
|
||||
- 跃迁 / 赋能 / 落地 / 格局 / 生态 / 痛点 / 风口 / 闭环 / 抓手 / 颠覆 / 引领 / 重塑 / 赛道 / 范式 / 底层逻辑 / 本质上 / 从根本上
|
||||
- AI 套话:随着、不断、深入、值得注意、不难发现、具有重要意义、综上所述、由此可见
|
||||
|
||||
---
|
||||
|
||||
## 八、特殊情况处理
|
||||
|
||||
### 原文是咨询报告风格
|
||||
|
||||
保留咨询报告的语感:观点前置、数字支撑、对比结构。不要为了"接地气"而口语化。
|
||||
|
||||
### 原文包含表格
|
||||
|
||||
表格翻译时:
|
||||
- 表头翻译
|
||||
- 单元格数字保留原格式
|
||||
- 专有名词保留英文(节省宽度)
|
||||
- 表格标题用 `表 X-Y:<内容>(数据来源:[src_xxx])`
|
||||
|
||||
### 原文包含图表
|
||||
|
||||
图表标题和说明翻译;图表本身(如果是 matplotlib 生成的 PNG)可能需要 dr-reporter 用中文字体重新生成。
|
||||
|
||||
### 原文包含 SCQA 式段落(如 Executive Summary)
|
||||
|
||||
SCQA 结构保留(因为这是麦肯锡式叙事),但不要标注 "S/C/Q/A"字样,按 `mckinsey-method skill` 要求写成融合式。
|
||||
|
||||
---
|
||||
|
||||
## 九、术语表维护
|
||||
|
||||
dr-translator 在翻译过程中维护项目级术语表:
|
||||
|
||||
```
|
||||
projects/<slug>/phase4/glossary.json
|
||||
{
|
||||
"GH101 family": "糖苷水解酶 101 家族",
|
||||
"endoglycosidase": "内切糖苷酶",
|
||||
"O-glycosylation": "O-糖基化",
|
||||
"Core 1": "核心 1 型",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
这个术语表会作为 final report 里的"术语表(Glossary)"章节,双语对照呈现。
|
||||
|
||||
---
|
||||
|
||||
## 十、输出要求
|
||||
|
||||
### 文件命名
|
||||
|
||||
- 英文稿:`projects/<slug>/phase4/final_en.md`
|
||||
- 中文稿:`projects/<slug>/phase4/final_zh.md`(dr-translator 产出)
|
||||
- 中文稿润色后:仍然 `final_zh.md`(dr-polisher 原地修改)
|
||||
- PDF 主稿:`final.pdf`(中文)
|
||||
- PDF 英文参考版:`final_en.pdf`
|
||||
- DOCX 主稿:`final.docx`(中文)
|
||||
|
||||
### 交付汇报
|
||||
|
||||
翻译完成后向调用者返回:
|
||||
|
||||
```
|
||||
翻译完成
|
||||
英文源:projects/<slug>/phase4/final_en.md (X words)
|
||||
中文译:projects/<slug>/phase4/final_zh.md (X 字)
|
||||
膨胀率:X%(预期 1.4 倍)
|
||||
术语表:projects/<slug>/phase4/glossary.json (X 条)
|
||||
翻译质检:humanizer-cn 禁用词 X 项(已清理)
|
||||
下一步:等待 dr-polisher 做最终润色
|
||||
```
|
||||
@@ -0,0 +1,157 @@
|
||||
---
|
||||
name: evidence-table
|
||||
description: 证据矩阵规范。规定每条核心结论必须有对应的证据记录,格式、字段、置信度分级和文件结构。dr-analyst 撰写初稿时使用,dr-verifier 追加反方证据时使用,dr-chief-editor 审校时作为核验基准。
|
||||
---
|
||||
|
||||
# 证据矩阵规范
|
||||
|
||||
## 核心原则
|
||||
|
||||
**每条结论必须可追溯**。报告中每一个有 [src_xxx] 标注的观点,都必须在对应章节的 evidence 文件中有一行记录。
|
||||
|
||||
---
|
||||
|
||||
## 证据矩阵文件格式
|
||||
|
||||
文件路径:`projects/<slug>/phase2/evidence/chXX-evidence.md`
|
||||
|
||||
### 文件结构
|
||||
|
||||
```markdown
|
||||
# 第 X 章 <标题> — 证据矩阵
|
||||
|
||||
生成时间:<datetime>
|
||||
研究员:dr-analyst
|
||||
字数统计:<N> 字 / 配额 <N> 字
|
||||
|
||||
---
|
||||
|
||||
## 核心结论证据表
|
||||
|
||||
| 结论 ID | 观点摘要(≤30字) | 支持证据 1 | 支持证据 2 | 置信度 | 备注 |
|
||||
|---|---|---|---|---|---|
|
||||
| C01 | <观点> | [src_001] <标题> Tier1 | [src_002] <标题> Tier2 | 高 | |
|
||||
| C02 | <观点> | [src_003] <标题> Tier2 | **[待验证]** 仅 1 个来源 | 中 | 需补充 |
|
||||
| C03 | <观点> | [src_004] <标题> Tier1 | [src_005] <标题> Tier1 | 高 | |
|
||||
|
||||
---
|
||||
|
||||
## 置信度说明
|
||||
|
||||
- **高**:2 个以上独立 Tier 1-2 信源支持,无重大反方证据
|
||||
- **中**:只有 1 个 Tier 1-2 信源,或有轻微反方证据
|
||||
- **低**:仅 Tier 3 信源,或有实质性反方证据
|
||||
- **[待验证]**:找不到第 2 个独立信源,在正文明确标注
|
||||
|
||||
---
|
||||
|
||||
## 信源详情
|
||||
|
||||
<!-- 每条 [src_xxx] 的完整信息 -->
|
||||
|
||||
**[src_001]**
|
||||
- 标题:
|
||||
- 作者/机构:
|
||||
- 年份:
|
||||
- URL/DOI:
|
||||
- Tier:1
|
||||
- 评分:8.5
|
||||
- 摘要(2-3句):
|
||||
|
||||
**[src_002]**
|
||||
...
|
||||
|
||||
---
|
||||
|
||||
## 反方证据(dr-verifier 填写)
|
||||
|
||||
<!-- dr-verifier 完成后追加以下内容 -->
|
||||
|
||||
### 验证摘要
|
||||
- 核验结论数:X
|
||||
- 发现反方证据:X 条
|
||||
- 补足待验证:X 条
|
||||
- 重大挑战:X 条
|
||||
|
||||
### 反方证据详情
|
||||
|
||||
#### 针对结论 C01:<观点摘要>
|
||||
- 反方证据:<内容>
|
||||
- 来源:[src_xxx] | Tier X
|
||||
- 处理建议:保留并注明争议 / 修改措辞 / 删除
|
||||
|
||||
<!-- 如有重大挑战 -->
|
||||
CRITICAL: <说明>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 正文中反方证据段落的写作规范(v0.8 新)
|
||||
|
||||
### 标题必须观点化,不能叫 "反驳证据 / Counter-Evidence"
|
||||
|
||||
**问题诊断**:v0.7 发现每章末尾 dr-analyst 会机械地写 `## 反驳证据`,标题重复而空洞,读者看了没有信息增益。
|
||||
|
||||
**新规则**:正文反方证据段落的标题必须:
|
||||
|
||||
1. **用二级 H2 或三级 H3 标题**(统一层级,禁止用加粗段冒充标题)
|
||||
2. **包含具体判断**,不要用"反驳证据" / "反方证据" / "Counter-Evidence" 这种模板化命名
|
||||
3. 至少要回答:**"对前述论点的哪一方面提出了什么挑战?"**
|
||||
|
||||
### 可接受的命名示例
|
||||
|
||||
| ✗ 不推荐 | ✓ 推荐 |
|
||||
|---|---|
|
||||
| 反驳证据 | 另一种声音:管线虚胖还是真实进展? |
|
||||
| Counter-Evidence | 需要补充判断的副作用:汇聚偶联收率可能被高估 |
|
||||
| 反方观点 | 反例:Codexis ECO 并非所有情境都优于 SPOS |
|
||||
| Counter Arguments | 值得警惕的数据:临床前到 IND 的衰减率 |
|
||||
|
||||
### 段落结构模板(推荐)
|
||||
|
||||
```markdown
|
||||
## <观点化标题>
|
||||
|
||||
虽然上文论证了 <核心观点>,但以下证据提示需要**有限度地**接受这一判断:
|
||||
|
||||
1. **<反方论点 1>**:<具体数据或案例> [src_xxx]。影响评估:<说明>
|
||||
2. **<反方论点 2>**:<具体数据或案例> [src_xxx]。影响评估:<说明>
|
||||
|
||||
综合而言,核心结论仍成立,但需在 <某个具体维度> 上留出缓冲。
|
||||
```
|
||||
|
||||
### 禁止的写法
|
||||
|
||||
- 单独用 **加粗段** 冒充反方证据标题(`**反方证据:** ...`)
|
||||
- 反方证据后不做整合判断,只是堆数据
|
||||
- 在每个小节末尾都加反方证据(只在章末加一次即可;若小节级别有重大挑战,写在小节正文里即可)
|
||||
|
||||
---
|
||||
|
||||
## 置信度分级标准
|
||||
|
||||
| 置信度 | 条件 | 正文处理方式 |
|
||||
|---|---|---|
|
||||
| 高 | ≥2 个独立 Tier 1-2 信源,无 CRITICAL 反方 | 直接陈述 |
|
||||
| 中 | 1 个 Tier 1-2 信源,或有轻微反方 | 陈述 + "但部分研究认为..." |
|
||||
| 低 | 仅 Tier 3,或有实质反方 | 必须加 "[待验证]" 标注 |
|
||||
| [待验证] | 无法找到第 2 个独立来源 | 正文明确写 "该观点仅有 1 个来源支持,待验证" |
|
||||
|
||||
---
|
||||
|
||||
## 结论 ID 命名规则
|
||||
|
||||
- `C01`-`C99`:正向核心结论
|
||||
- `F01`-`F09`:事实性陈述(不需要观点判断)
|
||||
- `T01`-`T09`:趋势判断(通常需要时间序列数据支撑)
|
||||
|
||||
dr-analyst 在撰写草稿时,给每个有 [src_xxx] 的观点分配一个 ID,在草稿和 evidence 文件里保持一致。
|
||||
|
||||
---
|
||||
|
||||
## 硬性规则
|
||||
|
||||
1. 草稿中每个 [src_xxx] 必须在 evidence 文件里有对应行
|
||||
2. 草稿中标注 `[待验证]` 的观点必须在 evidence 表里有对应行(置信度列写"低/待验证")
|
||||
3. dr-verifier 只能在"反方证据"段落追加,不能修改"核心结论证据表"
|
||||
4. CRITICAL 标注的问题,dr-chief-editor 审校时必须明确处理(不能忽略)
|
||||
@@ -0,0 +1,356 @@
|
||||
---
|
||||
name: humanizer-cn
|
||||
description: 去除 AI 味的中英双语写作规则。基于 Wikipedia Signs of AI Writing + blader/humanizer + 生物医药中文报告特化经验。dr-polisher 必读;dr-editor-in-chief 和 dr-translator 也应遵循。
|
||||
---
|
||||
|
||||
# Humanizer(中英双语去 AI 味规范)
|
||||
|
||||
## 你的任务
|
||||
|
||||
拿到文稿后,**按以下流程处理**:
|
||||
|
||||
1. **扫描**全文,识别所有 AI 模式(下述 28 条)
|
||||
2. **重写**问题段落,保留原意,换掉 AI-ism
|
||||
3. **注入人味**:不只是删除坏模式,要加入真正的个性
|
||||
4. **做最后一遍自问**:问自己"这段里还有什么显得是 AI 写的?"逐条修正
|
||||
|
||||
---
|
||||
|
||||
## 核心原则
|
||||
|
||||
> **避免 AI 模式只是一半工作。没有灵魂的干净文字和 slop 一样明显。好的写作背后有真人。**
|
||||
|
||||
---
|
||||
|
||||
## 英文规则(Phase 2/3 工作语言)
|
||||
|
||||
### 1. 过度渲染"意义/遗产/更宏大趋势"
|
||||
|
||||
**禁用词**:stands/serves as, is a testament/reminder, pivotal/crucial/key moment, underscores importance, reflects broader, symbolizing enduring, contributing to, setting the stage for, marking a shift, key turning point, evolving landscape
|
||||
|
||||
**反例**:
|
||||
> The Institute was established in 1989, marking a pivotal moment in the evolution of regional statistics and reflecting broader decentralization trends.
|
||||
|
||||
**改写**:
|
||||
> The Institute was established in 1989 to collect regional statistics independently from the national office.
|
||||
|
||||
### 2. 空泛归因 / Weasel Words
|
||||
|
||||
**禁用词**:Industry reports suggest, Observers have cited, Experts argue, Some critics argue, several sources, It has been noted
|
||||
|
||||
**反例**:
|
||||
> Experts believe this river plays a crucial role in the regional ecosystem.
|
||||
|
||||
**改写**:
|
||||
> A 2019 survey by the Chinese Academy of Sciences found that this river supports 12 endemic fish species.
|
||||
|
||||
### 3. -ing 短语堆砌(伪深度)
|
||||
|
||||
**禁用模式**:highlighting/underscoring/emphasizing/ensuring/reflecting/contributing to/cultivating/fostering/encompassing/showcasing
|
||||
|
||||
**反例**:
|
||||
> The architect chose blue, green, and gold, symbolizing Texas bluebonnets, reflecting the community's deep connection to the land.
|
||||
|
||||
**改写**:
|
||||
> The architect chose blue, green, and gold to reference local bluebonnets and the Gulf coast.
|
||||
|
||||
### 4. 高频 AI 词汇
|
||||
|
||||
**禁用**:Actually, additionally, align with, crucial, delve, emphasizing, enduring, enhance, fostering, garner, highlight (v), interplay, intricate, key (adj), landscape (abstract), pivotal, showcase, tapestry, testament, underscore, valuable, vibrant
|
||||
|
||||
### 5. 规避 "is/are"(Copula Avoidance)
|
||||
|
||||
**禁用模式**:X serves as Y / X stands as Y / X marks Y / X represents Y / X boasts / X features / X offers
|
||||
|
||||
**反例**:
|
||||
> Gallery 825 serves as LAAA's exhibition space and boasts over 3,000 square feet.
|
||||
|
||||
**改写**:
|
||||
> Gallery 825 is LAAA's exhibition space, with 3,000 square feet.
|
||||
|
||||
### 6. 负向平行(Negative Parallelism)
|
||||
|
||||
**禁用**:It's not just X, it's Y / Not only X but Y / more than just
|
||||
|
||||
### 7. 三段式(Rule of Three)
|
||||
|
||||
不为凑数拼三项。"The event features keynote sessions, panel discussions, and networking opportunities" → "The event includes talks and panels with informal networking between sessions."
|
||||
|
||||
### 8. 同义词循环(Elegant Variation)
|
||||
|
||||
避免在连续句子里对同一概念使用"the protagonist / the main character / the central figure / the hero"。一个叫法用到底即可。
|
||||
|
||||
### 9. 伪范围(False Ranges)
|
||||
|
||||
**禁用**:from X to Y 当 X 和 Y 不在同一量纲上。
|
||||
|
||||
"Our journey has taken us from the Big Bang to the cosmic web, from star formation to dark matter" → "The book covers the Big Bang, star formation, and dark matter."
|
||||
|
||||
### 10. 被动/无主语片段
|
||||
|
||||
"No configuration file needed" → "You do not need a configuration file."
|
||||
"The results are preserved automatically" → "The system preserves the results automatically."
|
||||
|
||||
### 11. 破折号过度使用
|
||||
|
||||
长破折号每章不超过 3 处。绝大多数情况下可以用逗号、句号或括号改写。
|
||||
|
||||
### 12. 内联粗体列表(Inline-header bullets)
|
||||
|
||||
**反例**:
|
||||
- **Speed:** Code generation is significantly faster.
|
||||
- **Quality:** Output quality has been enhanced.
|
||||
- **Adoption:** Usage continues to grow.
|
||||
|
||||
**改写为段落**:
|
||||
> The tool speeds up code generation substantially and improves output through better training. Adoption has grown alongside these improvements.
|
||||
|
||||
### 13. 标题 Title Case
|
||||
|
||||
**禁用**:## Strategic Negotiations And Global Partnerships
|
||||
**改为**:## Strategic negotiations and global partnerships
|
||||
|
||||
### 14. Emoji 装饰
|
||||
|
||||
禁止在标题、段落开头用 emoji(🚀 💡 ✅)。
|
||||
|
||||
### 15. Curly Quotes
|
||||
|
||||
"这种引号" 改为普通 "straight quotes"。
|
||||
|
||||
### 16. Chatbot 残留
|
||||
|
||||
**禁用**:I hope this helps, Of course!, Certainly!, You're absolutely right!, Would you like..., Let me know, Here is a..., Great question!
|
||||
|
||||
### 17. 知识截止声明
|
||||
|
||||
**禁用**:as of [date], up to my last training update, While specific details are limited, based on available information
|
||||
|
||||
### 18. 谄媚语气
|
||||
|
||||
**禁用**:Great question! You're absolutely right! That's an excellent point.
|
||||
|
||||
### 19. Filler 短语
|
||||
|
||||
| 禁用 | 改为 |
|
||||
|---|---|
|
||||
| In order to achieve this goal | To achieve this |
|
||||
| Due to the fact that | Because |
|
||||
| At this point in time | Now |
|
||||
| In the event that | If |
|
||||
| Has the ability to | Can |
|
||||
| It is important to note that | (直接删) |
|
||||
|
||||
### 20. 过度 Hedging
|
||||
|
||||
"It could potentially possibly be argued that..." → "The policy may..."
|
||||
|
||||
### 21. 通用正向总结
|
||||
|
||||
**禁用**:The future looks bright. Exciting times lie ahead. A major step in the right direction.
|
||||
|
||||
**改为**:具体说清楚下一步做什么。
|
||||
|
||||
### 22. 连字符成对词过多
|
||||
|
||||
AI 对常用词对几乎 100% 加连字符(third-party, cross-functional, data-driven, decision-making, well-known, high-quality, real-time, long-term, end-to-end)。人类用得不那么整齐。选择性去掉连字符。
|
||||
|
||||
### 23. 权威套话
|
||||
|
||||
**禁用**:The real question is, at its core, in reality, what really matters, fundamentally, the deeper issue, the heart of the matter
|
||||
|
||||
这些都是 AI 假装切穿表象直达真相的套路,删掉后真相还是在那里。
|
||||
|
||||
### 24. Signposting 预告
|
||||
|
||||
**禁用**:Let's dive in, let's explore, let's break this down, here's what you need to know, without further ado
|
||||
|
||||
直接进入内容,不要预告。
|
||||
|
||||
### 25. 标题后重复一遍标题内容
|
||||
|
||||
```
|
||||
## Performance
|
||||
Speed matters.
|
||||
When users hit a slow page, they leave.
|
||||
```
|
||||
|
||||
删掉 "Speed matters"。
|
||||
|
||||
### 26. 过度 boldface
|
||||
|
||||
不要在每一句里加粗 **这个** 和 **那个**。一段里粗体超过 2 处,说明你没认真思考该强调什么。
|
||||
|
||||
---
|
||||
|
||||
## 中文规则(Phase 4 翻译后适用)
|
||||
|
||||
中文有一套自己的 AI 味。以下是核心禁用清单。
|
||||
|
||||
### CN-1:AI 高频词(见到即替换)
|
||||
|
||||
| 禁用词 | 替换策略 |
|
||||
|---|---|
|
||||
| 跃迁 / 跃升 / 跃上 | 改为"升至 / 提升到" |
|
||||
| 赋能 | 改为"帮助 / 支持 / 推动" |
|
||||
| 落地 | 改为"实施 / 推行 / 执行" |
|
||||
| 格局 | 具体说清楚是"竞争格局"还是"市场格局" |
|
||||
| 生态 / 生态圈 | 少用,具体说"上下游企业" |
|
||||
| 深度 / 深度的 | 少用,改为具体描述 |
|
||||
| 痛点 | 改为"问题 / 困难" |
|
||||
| 风口 | 直接说"市场机会" |
|
||||
| 闭环 / 打通闭环 | 改为"完成了完整流程" |
|
||||
| 抓手 | 删掉,直接说动作 |
|
||||
| 颠覆 / 颠覆性 | 少用,过度戏剧化 |
|
||||
| 引领 / 引领性 | 改为具体的"率先做了..." |
|
||||
| 重塑 / 重构 | 改为"改变 / 改组" |
|
||||
| 赛道 | 改为"细分领域 / 市场" |
|
||||
| 范式 | 改为"方式 / 模式" |
|
||||
| 底层逻辑 | 改为"根本原因 / 核心机制" |
|
||||
| 本质上 / 从根本上 | 直接删除,讲具体内容 |
|
||||
|
||||
### CN-2:AI 套话(整句清除)
|
||||
|
||||
**禁用**:
|
||||
- "随着 X 的不断发展"
|
||||
- "在 X 背景下 / 在这一背景下"
|
||||
- "值得注意的是"
|
||||
- "不难发现"
|
||||
- "显而易见"
|
||||
- "毫无疑问"
|
||||
- "具有重要意义"
|
||||
- "发挥了重要作用"
|
||||
- "起到了 X 的作用"
|
||||
- "综上所述"
|
||||
- "由此可见"
|
||||
- "总的来说"
|
||||
- "据报道"
|
||||
- "有研究表明 / 有专家认为"(除非说出具体是哪项研究/哪位专家)
|
||||
|
||||
### CN-3:规避"是"的冗余句式(AI 极高频)
|
||||
|
||||
| 禁用 | 改为 |
|
||||
|---|---|
|
||||
| X 标志着 Y | X 是 Y / 从此 Y 成立 |
|
||||
| X 代表着 Y | X 是 Y |
|
||||
| X 构成 Y | X 是 Y |
|
||||
| X 成为 Y | 直接用 "X 是 Y" |
|
||||
| X 跃升为 Y | X 升到 Y |
|
||||
| X 彰显着 Y | X 说明 Y |
|
||||
| X 体现了 Y | X 说明 Y / X 显示 Y |
|
||||
|
||||
### CN-4:三段式堆砌(Rule of Three)
|
||||
|
||||
中文 AI 特别爱拼三段:
|
||||
- "短期、中期、长期"
|
||||
- "需求侧、供给侧、政策侧"
|
||||
- "技术、资本、市场"
|
||||
- "硬实力、软实力、巧实力"
|
||||
|
||||
不为凑数拼三段。如果只有两个要点就说两个,四个就说四个,节奏自然一些。
|
||||
|
||||
### CN-5:空洞形容词(必须跟数据)
|
||||
|
||||
- 巨大 → "250 亿美元"
|
||||
- 快速 → "CAGR 23%"
|
||||
- 显著 → "降低 40%(p<0.001)"
|
||||
- 强劲 → "增速高于同行 8 个百分点"
|
||||
- 显著领先 → "领先第二名 30% 市场份额"
|
||||
|
||||
无数据形容词直接删。
|
||||
|
||||
### CN-6:破折号规范
|
||||
|
||||
- 中文用全角破折号 `——`(两个连接起来)
|
||||
- 每章不超过 3 处
|
||||
- 多数情况可改为逗号、括号、句号
|
||||
|
||||
### CN-7:负向平行
|
||||
|
||||
**禁用**:
|
||||
- "不仅...更..."
|
||||
- "不仅仅是...,更是..."
|
||||
- "不是...而是..."
|
||||
- "不只是...,还是..."
|
||||
|
||||
偶用可以,成段出现必改。
|
||||
|
||||
### CN-8:过度书面腔 / 翻译腔
|
||||
|
||||
- "使...得以..." → "让 X 能 Y"
|
||||
- "通过...方式 / 通过...的方式" → "用 X / 以 X"
|
||||
- "对于 X 而言" → "X 的..."
|
||||
- "在 X 方面" → 具体说哪方面
|
||||
- "就 X 来说" → 删
|
||||
|
||||
### CN-9:内联粗体小标题(每段开头都加粗)
|
||||
|
||||
**反例**:
|
||||
- **技术层面**:xxx
|
||||
- **商业层面**:xxx
|
||||
- **风险层面**:xxx
|
||||
|
||||
改为叙述段落。保留加粗的前提是:真的是关键强调,而不是装饰。
|
||||
|
||||
### CN-10:章节标题 / 小节标题禁止用符号开头
|
||||
|
||||
禁止:🚀 / ✅ / 💡 / ⚠️ 等 emoji 开头。如果是正式提示标志,在正文中用文字表述。
|
||||
|
||||
---
|
||||
|
||||
## 注入人味(Add Soul)
|
||||
|
||||
干净但没灵魂的文字和 AI slop 一样明显。合格的报告要有:
|
||||
|
||||
### 有立场
|
||||
|
||||
不要只报告事实——对事实有判断。"定价策略存在风险"比"定价策略有利有弊"好。
|
||||
|
||||
### 节奏变化
|
||||
|
||||
短句。再长一些的句子慢慢把意思讲清楚。混着用。
|
||||
|
||||
### 承认不确定
|
||||
|
||||
真人会说"我不确定",AI 不会。允许出现"这个趋势能否持续还需观察"、"目前数据尚不足以做判断"这种诚实表达。
|
||||
|
||||
### 具体而非抽象
|
||||
|
||||
- "用户体验有待改善" → "首次打开页面要 8 秒,用户很可能就离开了"
|
||||
- "存在风险" → "最大风险是 NEB 可能用专利诉讼拖延 18-24 个月"
|
||||
|
||||
### 有节制的第一人称
|
||||
|
||||
研究报告一般不用"我",但是"我们认为 / 本报告认为"比"一般认为"好。
|
||||
|
||||
---
|
||||
|
||||
## 最后的自审流程
|
||||
|
||||
写完一段后,问自己三个问题:
|
||||
|
||||
1. **这句话是真人会说的吗?** 读出来听听看是否拗口做作
|
||||
2. **能更具体吗?** 任何抽象词都问能否换成数据/案例
|
||||
3. **删掉这句会失去什么?** 如果没损失,删
|
||||
|
||||
---
|
||||
|
||||
## Process Summary(给调用 agent 的操作清单)
|
||||
|
||||
拿到一份待润色的稿子后:
|
||||
|
||||
1. **扫描并标记**:全文搜索上述禁用词和模式
|
||||
2. **逐段重写**:按规则替换
|
||||
3. **检查节奏**:段落长短、句子长短是否有变化
|
||||
4. **删减冗余**:空话 / 套话 / 无数据形容词
|
||||
5. **核对格式**:没有 emoji、粗体不过度、标题 sentence case、破折号节制
|
||||
6. **So What 检验**:每段都得有价值
|
||||
7. **最后一遍自问**:这段还有哪里像 AI?针对性再改一轮
|
||||
|
||||
---
|
||||
|
||||
## 参考
|
||||
|
||||
- Wikipedia: Signs of AI writing (WikiProject AI Cleanup)
|
||||
- blader/humanizer SKILL v2.5.1
|
||||
- 9MW1911 综合战略报告(中文风格参考)
|
||||
@@ -0,0 +1,172 @@
|
||||
---
|
||||
name: length-budget
|
||||
description: 报告字数预算分配与执行校验。支持 4 种字数模式(自动/简明/详细/深度),英中互换规则(英文词数 ≈ 中文字数 × 0.7),章节配额算法与补写策略。Phase 1 用于设定预算,Phase 2/4 用于自检。
|
||||
---
|
||||
|
||||
# 字数预算系统
|
||||
|
||||
## 一、四种字数模式(Phase 1 访谈时选择)
|
||||
|
||||
用户在 /dr-init 访谈时选定其中一种,写入 manifest.word_budget_mode:
|
||||
|
||||
| 模式 | 中文字数目标 | 英文词数目标 | 章节数 | 适用场景 |
|
||||
|---|---|---|---|---|
|
||||
| `auto` | 按类型默认 | 按类型默认 | 8-12 | 不明确时默认 |
|
||||
| `concise` | 8,000-12,000 | 5,600-8,400 | 6-8 | 高管一阅即过 |
|
||||
| `detailed` | 20,000-35,000 | 14,000-24,500 | 10-12 | 标准专业报告 |
|
||||
| `deep` | 50,000-80,000 | 35,000-56,000 | 12-15 | 深度研究/行业专著 |
|
||||
|
||||
**auto 模式的默认字数**(按报告类型):
|
||||
|
||||
| 报告类型 | 中文字数 | 英文词数 | 章节数 |
|
||||
|---|---|---|---|
|
||||
| 综述 | 12,000 | 8,400 | 8-10 |
|
||||
| 研究 | 35,000 | 24,500 | 10-12 |
|
||||
| 投资 | 22,000 | 15,400 | 10-12 |
|
||||
| 管理/工艺 | 18,000 | 12,600 | 9-11 |
|
||||
|
||||
**字数只是参考,以把问题讲清楚为第一优先**。过少则内容单薄,过多则注水。目标区间±20% 内都可接受。
|
||||
|
||||
---
|
||||
|
||||
## 二、英文-中文字数换算
|
||||
|
||||
**核心换算率**:1 个英文词 ≈ 1.4-1.5 个中文字
|
||||
|
||||
Phase 2 产出英文,Phase 4 翻译为中文后字数会自然膨胀约 40%。预算时:
|
||||
- Phase 2 英文稿:按英文词数目标 × 1.0 写
|
||||
- Phase 4 中文稿:英文词数 × 1.4 应落在中文字数目标的 ±15% 内
|
||||
|
||||
自动换算工具:
|
||||
|
||||
```python
|
||||
def en_words_to_zh_chars(en_words: int) -> int:
|
||||
return int(en_words * 1.4)
|
||||
|
||||
def zh_chars_to_en_words(zh_chars: int) -> int:
|
||||
return int(zh_chars / 1.4)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、章节配额分配(dr-plan 在 Phase 1 用)
|
||||
|
||||
### 三层优先级
|
||||
|
||||
```
|
||||
P0(核心章,2-3 章):每章 = 总字数 × 13-16%
|
||||
P1(主干章,3-5 章):每章 = 总字数 × 8-11%
|
||||
P2(辅助章,2-3 章):每章 = 总字数 × 5-7%
|
||||
引言 / 结论章:各 = 总字数 × 6-8%
|
||||
```
|
||||
|
||||
### 约束
|
||||
|
||||
- 章节字数差距 ≤ ±30%(防止头重脚轻)
|
||||
- 结论章 ≥ 总字数 × 10%
|
||||
- 每节 ≥ 600 字(英文 ≥ 420 词),不足则合并节
|
||||
|
||||
### 示例:30,000 字研究报告分配
|
||||
|
||||
| 章 | 定位 | 中文配额 | 英文配额 |
|
||||
|---|---|---|---|
|
||||
| 第 1 章 引言 | intro | 1,800 | 1,260 |
|
||||
| 第 2 章 核心论点 | P0 | 4,500 | 3,150 |
|
||||
| 第 3 章 机制剖析 | P0 | 4,500 | 3,150 |
|
||||
| 第 4 章 临床证据 | P1 | 3,300 | 2,310 |
|
||||
| 第 5 章 竞争格局 | P1 | 3,000 | 2,100 |
|
||||
| 第 6 章 产业链 | P1 | 2,700 | 1,890 |
|
||||
| 第 7 章 政策监管 | P1 | 2,400 | 1,680 |
|
||||
| 第 8 章 风险 | P2 | 1,800 | 1,260 |
|
||||
| 第 9 章 国际对比 | P2 | 1,500 | 1,050 |
|
||||
| 第 10 章 趋势判断 | P1 | 2,100 | 1,470 |
|
||||
| 第 11 章 结论与建议 | conclusion | 2,400 | 1,680 |
|
||||
| **合计** | | **30,000** | **21,000** |
|
||||
|
||||
---
|
||||
|
||||
## 四、Phase 2 执行校验
|
||||
|
||||
dr-analyst 每章交稿前自检,dr-pm 每批校验。
|
||||
|
||||
### 英文字数统计
|
||||
|
||||
```bash
|
||||
# 英文词数
|
||||
wc -w projects/<slug>/phase2/drafts/chXX.md
|
||||
```
|
||||
|
||||
### 中文字数统计(未来用)
|
||||
|
||||
```python
|
||||
def count_chinese_words(text: str) -> int:
|
||||
import re
|
||||
cn = sum(1 for c in text if '\u4e00' <= c <= '\u9fff')
|
||||
text_no_cn = re.sub(r'[\u4e00-\u9fff]', ' ', text)
|
||||
en = len(re.findall(r"[A-Za-z]+(?:[-'][A-Za-z]+)*", text_no_cn))
|
||||
return cn + en
|
||||
```
|
||||
|
||||
### 校验逻辑
|
||||
|
||||
```
|
||||
1. 读 chXX.md 统计英文词数
|
||||
2. 对照 framework 中该章配额
|
||||
3. 判断:
|
||||
实际/配额 < 0.7 → 不合格,继续挖掘证据补写
|
||||
0.7 ≤ 比值 < 0.85 → 警告,建议补足
|
||||
0.85 ≤ 比值 ≤ 1.3 → 合格
|
||||
比值 > 1.3 → 超纲,考虑精简或拆分
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、字数不足的正确补救路径
|
||||
|
||||
**绝对禁止为凑数注水**("在此背景下"、"随着...的不断发展"等空话)。字数不足的应对顺序:
|
||||
|
||||
1. **检查证据覆盖**:该章观点是否有 ≥2 独立 Tier 1-2 信源?若无 → 检索补证据
|
||||
2. **展开数据细节**:把表格里的数字展开成文字分析(趋势、拐点、对比)
|
||||
3. **增加案例**:用 1-2 个具体公司/产品案例佐证抽象观点
|
||||
4. **补反方证据**:把反方证据段落写详细(500-800 字)
|
||||
5. **延伸推论**:对核心判断做"若成立则..."和"若不成立则..."分支
|
||||
6. **国际对比**:若原文只讲中国,加一段国际对比
|
||||
|
||||
---
|
||||
|
||||
## 六、manifest 字段规范
|
||||
|
||||
```json
|
||||
{
|
||||
"word_budget_mode": "detailed",
|
||||
"target_words_zh": 30000,
|
||||
"target_words_en": 21000,
|
||||
"min_words_zh": 24000,
|
||||
"chapter_quotas_en": [
|
||||
{"index": 1, "title": "...", "en_words": 1260, "priority": "intro"},
|
||||
{"index": 2, "title": "...", "en_words": 3150, "priority": "P0"}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、Phase 4 翻译后中文字数校验
|
||||
|
||||
翻译完成后:
|
||||
1. 读 final_zh.md,按中英混排规则统计字数
|
||||
2. 对照 manifest.target_words_zh
|
||||
3. 落在 ±15% 区间内 → 合格
|
||||
4. 不合格 → dr-polisher 在润色时适度扩展/压缩
|
||||
|
||||
---
|
||||
|
||||
## 八、硬规则
|
||||
|
||||
1. ✅ auto 模式按类型默认,其他模式按用户选择
|
||||
2. ✅ 章节字数差距 ≤ ±30%
|
||||
3. ✅ 结论章 ≥ 全文 10%
|
||||
4. ✅ Phase 2 英文稿每章自检,不足 70% 配额必须补
|
||||
5. ✅ Phase 4 中文稿整体字数校验在 ±15% 内
|
||||
6. ❌ 禁止为凑数注水(AI 套话、重复表述)
|
||||
7. ❌ 禁止对字数"打折"交稿
|
||||
@@ -0,0 +1,177 @@
|
||||
---
|
||||
name: mckinsey-method
|
||||
description: 顶级咨询公司(麦肯锡/BCG/德勤)研究报告写作方法论。金字塔原理、MECE、观点型标题、证据-数据-案例三要素、So What 自检。SCQA 仅用于 Executive Summary 和各章引入段,严禁每节机械套用。所有写作类 agent(dr-analyst/dr-editor-in-chief/dr-polisher)必读。
|
||||
---
|
||||
|
||||
# 顶级咨询报告写作方法论(精炼版)
|
||||
|
||||
## 核心定位
|
||||
|
||||
本文档是报告写作的**唯一风格准则**。读过 9MW1911 综合战略报告吗?那是目标风格。读起来像咨询公司资深合伙人在跟董事会讲话,不像 AI 生成的综述。
|
||||
|
||||
---
|
||||
|
||||
## 一、金字塔原理(Pyramid Principle)
|
||||
|
||||
**结论先行,论据支撑,论据之间 MECE。**
|
||||
|
||||
```
|
||||
章标题(= 一句判断)
|
||||
↓
|
||||
章首 2-3 段:直接给出本章结论 + 核心逻辑
|
||||
↓
|
||||
节 2.1(= 支撑论点 1)
|
||||
节首 1 段:本节论点 + 核心证据
|
||||
数据/事实/案例(带 [src_xxx])
|
||||
So What:这意味着什么
|
||||
↓
|
||||
节 2.2(= 支撑论点 2)
|
||||
...
|
||||
```
|
||||
|
||||
**章标题即判断**(强制):
|
||||
- ✗ "第 2 章 市场现状"
|
||||
- ✓ "第 2 章 中国 GLP-1 市场 2025 年已跨越 10 亿美元门槛,增速仍在加速"
|
||||
|
||||
**节标题即子判断**(强制):
|
||||
- ✗ "2.1 竞争格局"
|
||||
- ✓ "2.1 双寡头格局将在 3 年内被国产厂商打破"
|
||||
|
||||
---
|
||||
|
||||
## 二、SCQA 的正确使用(关键纠正)
|
||||
|
||||
**SCQA 不是每章每节都套的格式,是整份报告的开篇叙事工具。**
|
||||
|
||||
### 允许使用的位置(仅以下三处)
|
||||
|
||||
1. **Executive Summary 开头**(最重要):用 SCQA 引出报告核心命题
|
||||
2. **第 1 章引言**:用 SCQA 建立整份报告的分析框架
|
||||
3. **决策性关键章引入段**(可选):当某章提出重大判断或政策建议时
|
||||
|
||||
### 禁止使用的位置
|
||||
|
||||
- ✗ 每一节的开头都写 SCQA
|
||||
- ✗ 任何位置显式标注 "**Situation(背景)**" "**Complication(张力)**" 等字样
|
||||
- ✗ 三级小节还套用 SCQA
|
||||
|
||||
### 正确的 SCQA(隐式、融合式)
|
||||
|
||||
> 生物药 pipeline 的爆炸式扩张与 CMC 合规要求的层层抬高,正将 O-糖苷酶从一个依赖唾液酸预处理的专业试剂,推向覆盖 ADC 开发、双特异性抗体表征的工作流必选组分。然而,30 年来主导市场的 NEB 经典产品,对唾液酸化底物无活性这一根本局限始终未被突破。这就引出了一个核心问题:当下一代工程酶在 2019-2024 年集中商业化、市场标准正在重构时,后来者的进入窗口是否真实存在?本报告认为,窗口存在,但持续时间不超过 36 个月。
|
||||
|
||||
(这段里有 S/C/Q/A 四个要素,但没有任何显式标注,读起来像一段自然的论述。)
|
||||
|
||||
### 错误的 SCQA(显式标注式)
|
||||
|
||||
> **Situation(背景)**:生物药 pipeline 扩张...
|
||||
> **Complication(张力)**:NEB 经典产品局限...
|
||||
> **Question(问题)**:窗口是否存在?
|
||||
> **Answer(答案)**:本章认为...
|
||||
|
||||
(这种写法是典型的 AI 套路,在最终报告里绝对禁止出现。)
|
||||
|
||||
---
|
||||
|
||||
## 三、MECE(章节划分铁律)
|
||||
|
||||
**Mutually Exclusive, Collectively Exhaustive — 互斥且穷尽。**
|
||||
|
||||
自检:
|
||||
- 如果读者读完第 3 章再读第 5 章,会不会觉得"刚才好像说过这个"?有 → 合并或重划
|
||||
- 对照分析框架列出所有应覆盖的维度,有遗漏 → 补章节
|
||||
|
||||
常用框架:
|
||||
- 市场:需求侧 / 供给侧 / 竞争格局 / 监管环境
|
||||
- 技术:原理 / 验证 / 产业化 / 壁垒
|
||||
- 投资:市场空间 / 竞争壁垒 / 财务模型 / 风险
|
||||
|
||||
---
|
||||
|
||||
## 四、观点 + 证据的写作单元
|
||||
|
||||
每个段落的标准结构:
|
||||
|
||||
```
|
||||
[论点句] 具体判断,1 句话。
|
||||
[证据 1] 根据 <具体来源>,<数据> [src_xxx]。
|
||||
[证据 2] 进一步,<案例/对比> [src_xxx]。
|
||||
[So What] 这意味着 <对上层论点的意义>。
|
||||
```
|
||||
|
||||
### 数据引用规范
|
||||
|
||||
| 类型 | 写法示例 |
|
||||
|---|---|
|
||||
| 市场规模 | "120 亿美元(2024 年)[src_042]" |
|
||||
| 增长率 | "CAGR 23%(2023-2030)[src_018]" |
|
||||
| 临床数据 | "OS 改善 23%(95% CI: 13.8-16.6,p<0.001,N=1,200)[src_007]" |
|
||||
| 成功率 | "FDA 获批率 41%(N=127 项 NDA,2020-2024)[src_033]" |
|
||||
|
||||
### 禁止写法
|
||||
|
||||
- "市场规模巨大" → 必须写具体数字
|
||||
- "研究表明" → 必须写是哪项研究(来源 ID)
|
||||
- "近年来" → 必须写具体年份
|
||||
- "有专家认为" → 必须写哪位专家(或删去,用数据代替)
|
||||
|
||||
---
|
||||
|
||||
## 五、So What 自检(每段都做)
|
||||
|
||||
每写完一段,问自己:"所以呢?这对读者有什么意义?"
|
||||
|
||||
- 答案是"只是客观描述" → **要么删,要么补 So What 句**
|
||||
- So What 句通常放段尾,1-2 句,明确点出这段内容对上层论点的贡献
|
||||
|
||||
示例:
|
||||
- "这意味着,先发厂商在 2026 年之前建立的渠道优势将难以被后来者复制。"
|
||||
- "因此,判断一个 GLP-1 管线的商业价值,给药频率比疗效终点更关键。"
|
||||
|
||||
---
|
||||
|
||||
## 六、报告整体结构(11 件套)
|
||||
|
||||
参考 9MW1911 综合战略报告的组织方式:
|
||||
|
||||
1. **封面**:主标题 + 副标题 + 保密标识 + 编制日期
|
||||
2. **Executive Summary / 执行摘要**(≈800 字):SCQA 开篇 + 核心结论 4 条 + 关键行动优先级
|
||||
3. **Abstract / 摘要**(500-600 字):独立一页,叙事式,面向广义读者
|
||||
4. **Glossary / 术语表**(双语对照)
|
||||
5. **Table of Contents / 目录**
|
||||
6. **正文章节**(8-15 章)
|
||||
7. **结论与建议章**
|
||||
8. **附录**(2-5 个,如 CMC、临床对比、合并症分析)
|
||||
9. **参考文献**([src_xxx] 编号格式)
|
||||
10. **免责声明**
|
||||
11. **版本信息**
|
||||
|
||||
---
|
||||
|
||||
## 七、章节写作 Checklist(每章完成后自检)
|
||||
|
||||
- [ ] 章标题是观点型判断,不是"概述/现状/背景"
|
||||
- [ ] 章首 2-3 段给出结论和逻辑
|
||||
- [ ] 各节互斥且穷尽(MECE)
|
||||
- [ ] 每节标题也是观点型判断
|
||||
- [ ] 每个数字/事实后接 [src_xxx]
|
||||
- [ ] 每段末尾有 So What 句
|
||||
- [ ] 没有显式标注 "S/C/Q/A"
|
||||
- [ ] 没有"巨大/快速/显著/强劲"等无数据形容词
|
||||
- [ ] 没有"本章定位/字数配额/研究员"等调度元数据
|
||||
- [ ] 没有占位符 [待验证](除非确实找不到第二个信源)
|
||||
|
||||
---
|
||||
|
||||
## 八、严禁出现的写作坏习惯(humanizer 已列,此处精简)
|
||||
|
||||
**AI 套话**:随着、不断、深入、值得注意、不难发现、显而易见、具有重要意义、发挥重要作用、显著、巨大、快速发展、在此背景下、综上所述、由此可见、总的来说
|
||||
|
||||
**规避 "是" 的冗余结构**(AI 高频):标志着 / 代表着 / 构成 / 成为 / 跃升为 → 直接用 "是"
|
||||
|
||||
**三段式堆砌**:不要为凑数硬拼"需求侧 / 供给侧 / 政策侧"、"短期 / 中期 / 长期"
|
||||
|
||||
**破折号过用**:长破折号每章不超过 3 处
|
||||
|
||||
**负向平行**:不要"不仅...更..."、"不是...而是..."(偶用可,成段出现不可)
|
||||
|
||||
完整规则见 `skill:humanizer-cn`。
|
||||
@@ -0,0 +1,266 @@
|
||||
---
|
||||
name: output-hygiene
|
||||
description: 报告输出卫生检查。禁止词清单(调度元数据、占位符残留、待验证标注)、格式异常检测、参考文献完整性校验。dr-polisher 在润色最后一步必跑;dr-reporter 出稿前复查一次。
|
||||
---
|
||||
|
||||
# 输出卫生清单(Output Hygiene Checklist)
|
||||
|
||||
## 目的
|
||||
|
||||
拦截"调度元数据"和"中间产物残留"进入最终报告。9MW1911 那份报告之所以干净,是因为过滤掉了一切过程性内容,只留最终成品。
|
||||
|
||||
---
|
||||
|
||||
## 一、禁止出现在最终报告正文中的字样(元数据黑名单)
|
||||
|
||||
以下字符串在 final.md / final_zh.md / final_en.md 里**一旦出现即为缺陷**,dr-polisher 必须清除:
|
||||
|
||||
### A. 调度元数据
|
||||
|
||||
- `章节定位`
|
||||
- `字数配额`
|
||||
- `研究员:dr-analyst`
|
||||
- `研究员:dr-searcher`
|
||||
- `生成时间:2026-`(Year-MM 生成日期只在版本信息页出现一次)
|
||||
- `P0 核心章` / `P1` / `P2`(这些是内部分级,不给读者看)
|
||||
- `dr-plan` / `dr-pm` / `dr-analyst` / `dr-verifier` / `dr-chief-editor` / `dr-editor-in-chief` / `dr-polisher` / `dr-reporter` / `dr-translator`
|
||||
- `Phase 1` / `Phase 2` / `Phase 3` / `Phase 4`(除非在"方法论说明"附录讨论研究流程时)
|
||||
|
||||
### B. 占位符残留
|
||||
|
||||
- `[由 dr-reporter 自动生成]`
|
||||
- `[待填]` / `[TBD]` / `[TODO]`
|
||||
- `<slug>` / `<topic>` / `<N>` / `<X>` 等模板占位符
|
||||
- `{{ ... }}` / `${...}` 变量语法残留
|
||||
|
||||
### C. 中间产物引用
|
||||
|
||||
- `参考信源:[src_101] –[src_120] (详见 sources.jsonl ch02 条目)`
|
||||
- `详见 phase2/evidence/chXX-evidence.md`
|
||||
- `详见 sources.jsonl`
|
||||
- `本章信源索引:...(详见 ...)`
|
||||
- `⚠️ 待验证` / `⚠️ [待验证]`(这是过程性标注;如必须保留某个"存疑观点"的提示,应改为正式语言如"该数据仅有 X 个来源支持,建议人工核实")
|
||||
|
||||
### D. 研究思路泄漏
|
||||
|
||||
- `研究思路:`
|
||||
- `核心研究问题:`
|
||||
- `初步假设:`
|
||||
- `预期信源:`
|
||||
- `预期篇幅:`
|
||||
|
||||
这些是 framework.md 里给 dr-analyst 看的规划信息,不能出现在读者版。
|
||||
|
||||
### E. Agent 交付汇报语
|
||||
|
||||
- `产出:` / `完成后返回:`
|
||||
- `任务:` / `硬性要求:`
|
||||
- `必读 skill:`
|
||||
- `章节小结:` (改为自然段落收尾)
|
||||
|
||||
---
|
||||
|
||||
## 二、格式异常检测
|
||||
|
||||
### F. SCQA 显式标注(已禁止的机械模式)
|
||||
|
||||
以下组合**不应在最终报告中成对出现**(用 grep 扫):
|
||||
- `**Situation(背景)**` + `**Complication(张力)**`
|
||||
- `**S(背景)**` + `**C(挑战)**` + `**Q(问题)**` + `**A(答案)**`
|
||||
- `Answer-First` 显式标注
|
||||
- `**核心结论(Answer-First)**`
|
||||
|
||||
SCQA 要写得隐式融合(见 mckinsey-method skill)。
|
||||
|
||||
### G. 三级以上嵌套标题乱用
|
||||
|
||||
正文正式章节标题不要超过 3 级:
|
||||
- `# 第 X 章` (报告级)
|
||||
- `## X.Y 节` (章内节)
|
||||
- `### X.Y.Z 小节` (节内小节)
|
||||
|
||||
禁止 `####` `#####` `######`。如果需要 4 级以上,重新组织结构。
|
||||
|
||||
### H. 引用格式不统一
|
||||
|
||||
所有引用统一 `[src_XXX]` 格式(3 位数字)。禁止混用:
|
||||
- `[src_1]`(没补零)
|
||||
- `[source_001]`(变形)
|
||||
- `(src_001)`(圆括号)
|
||||
- `[ref_1]` / `[r1]`(其他简写)
|
||||
|
||||
### I. 中英文标点混用
|
||||
|
||||
中文正文里的标点应是**中文标点**:
|
||||
- `,` 不是 `,`
|
||||
- `。` 不是 `.`
|
||||
- `;` 不是 `;`
|
||||
- `:` 不是 `:`
|
||||
- `"..."` 不是 `"..."`(除了直接引用英文)
|
||||
- `(...)` 不是 `(...)`
|
||||
|
||||
例外:行内英文术语、代码、URL、数据单位前后保持英文标点合理。
|
||||
|
||||
### J. Emoji(强制禁用)
|
||||
|
||||
**正文与表格中严禁使用任何 emoji / 彩色符号**:
|
||||
|
||||
禁用清单(但不限于):
|
||||
`✅ ❌ ✔ ✖ 🔶 🔷 ⭐ 🟢 🔴 🟡 🟠 ⚠️ ⚠ 💡 📌 🔑 📊 📈 📉 🔥 ✨ 🎯 🎉 ➔ ➜`
|
||||
|
||||
**原因**:PDF 使用的思源字体子集不包含这些字符的 glyph,渲染为空白方框(□)。
|
||||
|
||||
**替代写法**:
|
||||
- 表格标记"有/无":用 `✓` `×`(思源字体支持)或中文字 `是` / `否`
|
||||
- 强调状态:用 `◆` `●` 等几何符号(字体支持)
|
||||
- 警示:用 `注:` `警告:` `※` 等文字前缀
|
||||
- 重点:用 **粗体** 或引用块,不用 emoji
|
||||
|
||||
扫描命令:
|
||||
```bash
|
||||
python3 -c "
|
||||
import re
|
||||
txt = open('final_zh_polished.md').read()
|
||||
pat = re.compile(r'[\u2700-\u27BF]|[\U0001F300-\U0001F9FF]|[\u2B00-\u2BFF]')
|
||||
hits = [(i, m.group()) for i, m in enumerate(pat.finditer(txt))]
|
||||
print(f'emoji 命中:{len(hits)} 处')
|
||||
for i, c in hits[:10]:
|
||||
print(f' 位置 {i}: {c!r} (U+{ord(c):04X})')
|
||||
"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、参考文献完整性校验(最关键)
|
||||
|
||||
dr-reporter 出稿前**必须**执行:
|
||||
|
||||
```bash
|
||||
# 1. 从 final.md 提取所有引用的 src_id
|
||||
grep -oE '\[src_[0-9]+\]' projects/<slug>/phase4/final.md | sort -u > /tmp/cited.txt
|
||||
|
||||
# 2. 从 citations.md / sources.jsonl 提取所有已登记的 src_id
|
||||
grep -oE 'src_[0-9]+' projects/<slug>/phase4/citations.md | sort -u > /tmp/registered.txt
|
||||
# 或从 sources.jsonl
|
||||
python3 -c "
|
||||
import json
|
||||
with open('projects/<slug>/phase2/sources.jsonl') as f:
|
||||
for line in f:
|
||||
d = json.loads(line)
|
||||
print(d['id'])
|
||||
" | sort -u > /tmp/registered.txt
|
||||
|
||||
# 3. 差集:cited 里有但 registered 里没有 → 严重错误
|
||||
comm -23 /tmp/cited.txt <(sed 's/[][]//g' /tmp/registered.txt) > /tmp/missing.txt
|
||||
|
||||
# 4. 反向差集:registered 有但从未被 cited → 孤立信源,可剔除
|
||||
comm -13 /tmp/cited.txt <(sed 's/[][]//g' /tmp/registered.txt) > /tmp/orphan.txt
|
||||
```
|
||||
|
||||
### 处理规则
|
||||
|
||||
- 有 missing 信源(引用了但无记录)→ **致命错误**,dr-reporter 拒绝出稿,抛回上游排查
|
||||
- 有 orphan 信源(有记录但未被引用)→ 警告,从 citations.md 剔除
|
||||
- final.md 里的"参考文献"段落**必须包含完整的编号清单**,不能是 `[由 dr-reporter 自动生成]` 之类的占位符
|
||||
- 如果 final.md 的参考文献段落是占位符 → 读 citations.md 内容回填
|
||||
|
||||
---
|
||||
|
||||
## 四、标题规范
|
||||
|
||||
### 章标题
|
||||
|
||||
- 观点型判断句,不是"概述/现状/背景"
|
||||
- 长度 15-40 字(中)/ 10-25 词(英)
|
||||
- 不以动词开头(如"分析/探讨/研究"),改为判断句
|
||||
|
||||
**反例**:
|
||||
- 第 2 章 分析中国 GLP-1 市场的现状
|
||||
- 第 3 章 探讨 NEB 产品的竞争优势
|
||||
|
||||
**正例**:
|
||||
- 第 2 章 中国 GLP-1 市场 2025 年已跨越 10 亿美元门槛
|
||||
- 第 3 章 NEB 的 30 年专利丛林将在 2028 年后开始瓦解
|
||||
|
||||
### 节标题
|
||||
|
||||
- 同样要求观点型
|
||||
- 长度 10-25 字 / 8-15 词
|
||||
- 禁止 `2.1 背景 / 2.2 现状 / 2.3 趋势` 这种模板化结构
|
||||
|
||||
---
|
||||
|
||||
## 五、图表与数据卫生
|
||||
|
||||
### 表格
|
||||
|
||||
- 表头第一行要有单位(金额 USD / 百分比 % / 年份等)
|
||||
- 所有数据有来源标注(行内 [src_xxx] 或表脚注)
|
||||
- 避免超过 10 列宽表(PDF 会被截断)
|
||||
|
||||
### 图表标题
|
||||
|
||||
格式:`图 X-Y:<内容描述>(数据来源:[src_xxx])`
|
||||
|
||||
### 数字规范
|
||||
|
||||
- 阿拉伯数字 + 中文量词:`12 项研究` / `3.2 亿元`
|
||||
- 大数字三位分节:`12,000` 而非 `12000`
|
||||
- 百分比带 `%`,不写"百分之十二"
|
||||
- 时间范围用连字符:`2020-2025 年` 不是 `2020 至 2025 年`
|
||||
|
||||
---
|
||||
|
||||
## 六、自动化检查脚本(dr-polisher / dr-reporter 必跑)
|
||||
|
||||
```python
|
||||
# hygiene_check.py
|
||||
import re, sys
|
||||
|
||||
BLACKLIST_ZH = [
|
||||
"章节定位", "字数配额", "研究员:dr-",
|
||||
"P0 核心章", "P1 主干章", "P2 辅助章",
|
||||
"Phase 1", "Phase 2", "Phase 3", "Phase 4",
|
||||
"dr-plan", "dr-pm", "dr-analyst", "dr-verifier",
|
||||
"dr-chief-editor", "dr-editor-in-chief", "dr-polisher",
|
||||
"dr-reporter", "dr-translator",
|
||||
"[由 dr-reporter 自动生成]", "[待填]", "[TBD]", "[TODO]",
|
||||
"详见 phase2/", "详见 sources.jsonl",
|
||||
"本章信源索引", "⚠️ 待验证", "⚠️ [待验证]",
|
||||
"**Situation(背景)**", "**Complication(张力)**",
|
||||
"**Question(问题)**", "**Answer(答案)**",
|
||||
"**S(背景)**", "**C(挑战)**",
|
||||
"Answer-First", "核心结论(Answer-First)",
|
||||
"研究思路:", "核心研究问题:", "初步假设:",
|
||||
"预期信源:", "预期篇幅:",
|
||||
"硬性要求:", "必读 skill:", "产出:",
|
||||
]
|
||||
|
||||
path = sys.argv[1]
|
||||
text = open(path, encoding='utf-8').read()
|
||||
issues = []
|
||||
for pattern in BLACKLIST_ZH:
|
||||
if pattern in text:
|
||||
count = text.count(pattern)
|
||||
issues.append(f" × '{pattern}' 出现 {count} 次")
|
||||
|
||||
if issues:
|
||||
print(f"{path} 存在 {len(issues)} 项卫生问题:")
|
||||
for i in issues:
|
||||
print(i)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print(f"{path} 输出卫生检查通过")
|
||||
sys.exit(0)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、硬规则
|
||||
|
||||
1. ✅ dr-polisher 润色的最后一步跑 hygiene_check
|
||||
2. ✅ dr-reporter 出稿前再跑一次 hygiene_check + 参考文献完整性校验
|
||||
3. ✅ 任何禁止词残留都必须修正,不能"放过一马"
|
||||
4. ✅ 参考文献段落必须包含完整编号清单,不允许占位符
|
||||
5. ❌ 禁止把"⚠️ 待验证"这种过程标注留到读者版
|
||||
6. ❌ 禁止三级以上嵌套标题
|
||||
@@ -0,0 +1,303 @@
|
||||
---
|
||||
name: pdf-reportlab
|
||||
description: 用 ReportLab 生成专业中文 PDF 研究报告。集中样式管理、紧凑分页(widows/orphans/keepWithNext)、颜色层次、封面保密标识、页眉页脚简洁化。基于 9MW1911 综合战略报告的编排参考。
|
||||
---
|
||||
|
||||
# ReportLab 中文 PDF 模板使用指南(v0.5)
|
||||
|
||||
## 一、为什么是 ReportLab
|
||||
|
||||
- **完全可控**:每个字号、行距、颜色由代码说了算,不被引擎意外改动
|
||||
- **中文字体一次搞定**:`pdfmetrics.registerFont` 注册后全局可用,子集嵌入 PDF,无授权问题
|
||||
- **分页规则精确**:支持 widows/orphans、keepWithNext、splitByRow 等避免孤行/寡行
|
||||
- **图表嵌入高质量**:matplotlib 300 DPI PNG,速度快
|
||||
- **样式集中在 StyleSheet**:避免字号不一
|
||||
|
||||
---
|
||||
|
||||
## 二、模板入口
|
||||
|
||||
脚本:`.opencode/templates/report-template.py`
|
||||
|
||||
调用:
|
||||
```bash
|
||||
uv run python .opencode/templates/report-template.py \
|
||||
--input projects/<slug>/phase4/final.md \
|
||||
--manifest projects/<slug>/manifest.json \
|
||||
--output projects/<slug>/phase4/final.pdf \
|
||||
--fonts-dir .opencode/templates/fonts
|
||||
```
|
||||
|
||||
首次使用前:
|
||||
```bash
|
||||
bash .opencode/templates/fonts/download-fonts.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、字体注册(7 个字重)
|
||||
|
||||
```
|
||||
SrcSerif-Regular 思源宋体 Regular 正文
|
||||
SrcSerif-Bold 思源宋体 Bold 正文粗体
|
||||
SrcSans-Light 思源黑体 Light 页眉页脚
|
||||
SrcSans-Medium 思源黑体 Medium 三级标题/图表
|
||||
SrcSans-Bold 思源黑体 Bold 一二级标题
|
||||
SrcSans-Heavy 思源黑体 Heavy 封面大标题
|
||||
Kai 霞鹜文楷 Regular 摘要/引文
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、样式表(StyleSheet,集中管理)
|
||||
|
||||
| 样式名 | 字体 | 字号 | 行高 | 颜色 | 备注 |
|
||||
|---|---|---|---|---|---|
|
||||
| `body` | SrcSerif | 10.5 | 18 | `#1a1a1a` | 正文,首行缩进 21pt |
|
||||
| `body-bold` | SrcSerif-Bold | 10.5 | 18 | `#1a1a1a` | 行内加粗 |
|
||||
| `h1` | SrcSans-Bold | 18 | 28 | `#1e3a8a` | 章标题,前强制分页 |
|
||||
| `h2` | SrcSans-Bold | 14 | 22 | `#2c5282` | 节标题 |
|
||||
| `h3` | SrcSans-Medium | 12 | 18 | `#374151` | 小节标题 |
|
||||
| `quote` | Kai | 10.5 | 18 | `#4b5563` | 引文 |
|
||||
| `caption` | SrcSans-Medium | 9 | 13 | `#6b7280` | 图表标题 |
|
||||
| `footnote` | SrcSerif | 9 | 13 | `#374151` | 脚注/参考文献 |
|
||||
| `header-footer` | SrcSans-Light | 8 | 12 | `#9ca3af` | 页眉页脚 |
|
||||
| `cover-title` | SrcSans-Heavy | 28 | 40 | `#0f172a` | 封面主标题 |
|
||||
| `cover-subtitle` | SrcSans-Medium | 15 | 24 | `#475569` | 封面副标题 |
|
||||
| `cover-confidential` | SrcSans-Bold | 11 | 16 | `#dc2626` | 封面保密标识(红色)|
|
||||
| `cover-meta` | SrcSerif | 11 | 18 | `#334155` | 封面元信息 |
|
||||
| `summary` | SrcSerif | 11 | 20 | `#1a1a1a` | 执行摘要 |
|
||||
|
||||
---
|
||||
|
||||
## 五、分页规则(关键升级点)
|
||||
|
||||
### 章(h1)
|
||||
|
||||
- `pageBreakBefore=1`(每章新起一页)
|
||||
- `keepWithNext=1`(标题和下一段不分离)
|
||||
|
||||
### 节(h2)
|
||||
|
||||
- **禁止单独触发分页**
|
||||
- `keepWithNext=1`(标题紧跟内容)
|
||||
|
||||
### 小节(h3)
|
||||
|
||||
- 同 h2,`keepWithNext=1`
|
||||
|
||||
### 段落
|
||||
|
||||
- `widows=2, orphans=2`(避免寡行/孤行)
|
||||
- 每段之间 `spaceBefore=6, spaceAfter=6`
|
||||
|
||||
### 表格
|
||||
|
||||
- `TableStyle` 中启用 `splitByRow=True`(长表格按行分页)
|
||||
- `repeatRows=1`(表头在分页后重复)
|
||||
- 单元格 padding 统一 4-6pt
|
||||
|
||||
### 摘要/术语表/目录/参考文献
|
||||
|
||||
- 每个独占起始页(用 `PageBreak`)
|
||||
|
||||
---
|
||||
|
||||
## 六、封面模板(参考 9MW1911)
|
||||
|
||||
封面独立一页,无页眉页脚,布局:
|
||||
|
||||
```
|
||||
(上 30% 空白)
|
||||
|
||||
主标题(cover-title,黑色,居中)
|
||||
副标题(cover-subtitle,深灰,居中)
|
||||
|
||||
(中部 40% 空白)
|
||||
|
||||
[机密 | 仅供 XX 内部决策使用] (cover-confidential,红色,居中)
|
||||
|
||||
(下部 20%)
|
||||
|
||||
类型:研究类
|
||||
作者:Deep Research 系统 / <公司名>
|
||||
编制日期:YYYY 年 M 月
|
||||
版本:v1.0
|
||||
```
|
||||
|
||||
字段来源:
|
||||
- `manifest.report_title` / `report_subtitle`
|
||||
- `manifest.confidentiality` (如 "机密 | 仅供迈威生物内部决策使用")
|
||||
- `manifest.author` / `manifest.date` / `manifest.version`
|
||||
|
||||
---
|
||||
|
||||
## 七、页眉页脚(简洁化)
|
||||
|
||||
### 页眉
|
||||
|
||||
左边:报告简称(从 `manifest.report_title` 取前 15 字)
|
||||
右边:章节名(动态,从当前 h1 内容取)
|
||||
底线:`#e5e7eb` 浅灰分隔线
|
||||
|
||||
### 页脚
|
||||
|
||||
居中:页码(格式 `— X —`)
|
||||
字号:8pt,`#9ca3af` 浅灰
|
||||
|
||||
### 特殊页
|
||||
|
||||
- 封面:无页眉页脚
|
||||
- 免责声明:无页眉,仅页脚
|
||||
- 其他(摘要/术语表/目录/正文/附录/参考文献):有页眉页脚
|
||||
|
||||
---
|
||||
|
||||
## 八、报告结构(11 件套)
|
||||
|
||||
ReportLab 按以下顺序组装:
|
||||
|
||||
1. **封面**(cover PageTemplate)
|
||||
2. **免责声明**(normal PageTemplate,单页)
|
||||
3. **Executive Summary / 执行摘要**(summary PageTemplate,1-2 页)
|
||||
4. **Abstract / 摘要**(normal,单页)
|
||||
5. **Glossary / 术语表**(normal)
|
||||
6. **Table of Contents / 目录**(TOC,自动生成)
|
||||
7. **正文各章**(normal,每章 h1 强制分页)
|
||||
8. **结论与建议**(正文的一部分)
|
||||
9. **附录**(normal)
|
||||
10. **参考文献**(bibliography PageTemplate,footnote 样式)
|
||||
11. **版本信息**(normal,单页)
|
||||
|
||||
---
|
||||
|
||||
## 九、Markdown 支持范围
|
||||
|
||||
| Markdown | ReportLab 渲染 |
|
||||
|---|---|
|
||||
| `# 第 X 章 ...` | h1(新起一页,深蓝色)|
|
||||
| `## X.Y ...` | h2(节,蓝色,不分页)|
|
||||
| `### X.Y.Z ...` | h3(小节,深灰)|
|
||||
| `**粗体**` | inline `<b>` |
|
||||
| `*斜体*` | inline `<i>` |
|
||||
| `` `代码` `` | 等宽字体 |
|
||||
| `> 引文` | quote 样式(楷体,浅底色)|
|
||||
| `- 项` / `1. 项` | 项目符号列表 |
|
||||
| 表格 `\| \| \|` | Table,自动列宽 + splitByRow |
|
||||
| `` | 图片 + caption 样式 |
|
||||
| `[src_001]` | 上标引用 |
|
||||
| `---` | 分页符 |
|
||||
|
||||
**不支持**:HTML 标签、数学公式、代码块高亮。
|
||||
|
||||
---
|
||||
|
||||
## 十、图表嵌入
|
||||
|
||||
不用 ReportLab 原生绘图,全部预渲染为 PNG:
|
||||
|
||||
```python
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.font_manager as fm
|
||||
|
||||
font_path = '.opencode/templates/fonts/SourceHanSansSC-Medium.otf'
|
||||
fm.fontManager.addfont(font_path)
|
||||
plt.rcParams['font.family'] = 'Source Han Sans SC'
|
||||
plt.rcParams['axes.unicode_minus'] = False
|
||||
|
||||
fig, ax = plt.subplots(figsize=(6, 4), dpi=300)
|
||||
# ...
|
||||
plt.savefig('projects/<slug>/phase4/figures/fig_01_XXX.png', dpi=300, bbox_inches='tight')
|
||||
```
|
||||
|
||||
Markdown 中引用:`![图 1-1:2020-2025 GLP-1 市场规模(数据来源:[src_042])](figures/fig_01_XXX.png)`
|
||||
|
||||
---
|
||||
|
||||
## 十一、manifest 必需字段
|
||||
|
||||
```json
|
||||
{
|
||||
"slug": "...",
|
||||
"report_title": "自研 O-糖苷酶立项可行性研究报告",
|
||||
"report_subtitle": "对标 NEB 与 Merck 经典产品的技术路径、IP 壁垒与差异化战略",
|
||||
"confidentiality": "机密 | 仅供内部决策使用",
|
||||
"author": "Deep Research 系统",
|
||||
"date": "2026-04-21",
|
||||
"version": "1.0",
|
||||
"type": "研究类",
|
||||
"disclaimer": "本报告基于公开信息与 AI 辅助研究生成,仅供参考..."
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 十二、常见坑与对策
|
||||
|
||||
| 坑 | 对策 |
|
||||
|---|---|
|
||||
| 中文字号不一 | 集中 StyleSheet,不在 Paragraph 里 inline 改 fontSize |
|
||||
| 行距太挤 | 行高 = 字号 × 1.5~1.7 |
|
||||
| 换行断错 | `wordWrap='CJK'` 必设 |
|
||||
| 表格被截断 | `splitByRow=True, repeatRows=1` |
|
||||
| 标题孤行(页末一个标题后直接新页)| `keepWithNext=1` |
|
||||
| 段落寡行(末段只剩一行在下页)| `widows=2, orphans=2` |
|
||||
| 图片变形 | 先 matplotlib 出 300 DPI PNG,再 `Image(path, width=..., kind="proportional")` |
|
||||
| 生成慢 | matplotlib 图表预渲染,不要在 PDF 生成阶段现算 |
|
||||
| 参考文献丢失 | dr-reporter 出稿前检查:读 citations.md,确认内容已写入 final.md |
|
||||
|
||||
---
|
||||
|
||||
## 十三、dr-reporter 调用流程
|
||||
|
||||
```
|
||||
1. 环境检查
|
||||
- 字体 ≥6 个 OTF 文件
|
||||
- final.md 存在
|
||||
- manifest.json 有必需字段
|
||||
|
||||
2. 回填参考文献(关键步骤,修复 v0.4 的 bug)
|
||||
- 读 citations.md 内容
|
||||
- 在 final.md 中找到"## 参考文献"段落
|
||||
- 如果段落内容是占位符(如 "[由 dr-reporter 自动生成]" 或为空)
|
||||
→ 替换为 citations.md 的完整内容
|
||||
- 写回 final.md
|
||||
|
||||
3. 图表检查
|
||||
- 扫描 final.md 中所有  图片引用
|
||||
- 验证每个 path 在 figures/ 目录下存在
|
||||
- 缺失图片 → 警告并继续,但汇报中注明
|
||||
|
||||
4. 生成 PDF
|
||||
uv run python .opencode/templates/report-template.py \
|
||||
--input projects/<slug>/phase4/final.md \
|
||||
--manifest projects/<slug>/manifest.json \
|
||||
--output projects/<slug>/phase4/final.pdf \
|
||||
--fonts-dir .opencode/templates/fonts
|
||||
|
||||
5. 生成 DOCX(可选)
|
||||
pandoc projects/<slug>/phase4/final.md \
|
||||
--from markdown --to docx \
|
||||
--output projects/<slug>/phase4/final.docx \
|
||||
--toc --toc-depth=3
|
||||
|
||||
6. 验证
|
||||
- PDF 文件大小 > 500KB(太小说明字体没嵌)
|
||||
- PDF 页数合理(按字数估算)
|
||||
- "参考文献"章节存在且非空
|
||||
|
||||
7. 汇报
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 十四、输出卫生检查(必跑)
|
||||
|
||||
生成 PDF 前:
|
||||
|
||||
```bash
|
||||
# 加载 skill:output-hygiene
|
||||
python3 .opencode/templates/hygiene_check.py projects/<slug>/phase4/final.md
|
||||
```
|
||||
|
||||
禁止词残留 → 抛回 dr-polisher 再润色一轮。
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
name: search-gateway
|
||||
description: Use when Deep Research agents or subagents need web, scholar, patent, news, regulatory, or source-discovery search without using platform MCP tools or browser search directly.
|
||||
---
|
||||
|
||||
# Search Gateway
|
||||
|
||||
## Rule
|
||||
|
||||
Use the project Python search gateway as the only default search interface. Do not call Tavily MCP, browser MCP, generic web tools, or platform-native search from a subagent unless the user explicitly asks for that escape hatch.
|
||||
|
||||
## Commands
|
||||
|
||||
Run searches from the repository root:
|
||||
|
||||
```bash
|
||||
uv run python scripts/search.py "<query>" --route general --json --trace
|
||||
uv run python scripts/search.py "<query>" --route evidence --json --trace
|
||||
uv run python scripts/search.py "<query>" --route scholar --year-low 2020 --json --trace
|
||||
uv run python scripts/search.py "<query>" --route news --time-range y --json --trace
|
||||
uv run python scripts/search.py "<query>" --route patents --json --trace
|
||||
uv run python scripts/search.py "<query>" --profile biomed_literature --json --trace
|
||||
```
|
||||
|
||||
If `uv` cannot use the user cache in a sandbox, set a local cache:
|
||||
|
||||
```bash
|
||||
UV_CACHE_DIR=/private/tmp/deep_research_uv_cache uv run python scripts/search.py "<query>" --route general --json --trace
|
||||
```
|
||||
|
||||
## Routing
|
||||
|
||||
- `general`: Tavily first, Exa fallback, Brave fallback; use for broad discovery and gap filling.
|
||||
- `evidence`: Exa highlights first, Tavily fallback, Brave fallback; use when a task card needs concise, source-level candidate evidence for an evidence packet.
|
||||
- `scholar`: Serper Scholar first; use for papers, reviews, technical literature, and academic validation only.
|
||||
- `news`: Serper News first; use for recent industry/current information.
|
||||
- `patents`: Serper Google Patents first.
|
||||
- `biomed_literature`: scholar plus general discovery.
|
||||
|
||||
Serper is not the default general web search source. Keep it mainly for Scholar, Google Patents, News, and targeted `site:` searches where Google coverage matters.
|
||||
|
||||
Tavily Research is a phase-level scan tool, not a packet-writing shortcut. Use it for Phase 1 initial landscape scans, Phase 2 gap-fill after a chapter is thin, or Phase 3回炉补证据;its output must be saved, source-scored, deduplicated, and converted into candidate evidence before citation.
|
||||
|
||||
Exa is the preferred controlled evidence discovery route for agents because it can return short highlights/text per URL. Treat Exa hits as candidate sources unless the URL itself is an original Tier 1-2 source.
|
||||
|
||||
API keys are loaded from `secrets.env` by `scripts/search.py`; do not ask the user to authorize MCP calls when the env keys are available.
|
||||
|
||||
## Subagent Protocol
|
||||
|
||||
For evidence packets:
|
||||
|
||||
1. Search through `scripts/search.py`, save or summarize the returned JSON in the packet’s `raw_quotes_or_notes`.
|
||||
2. Use search hits only as candidate sources; whenever possible, cite the original regulator, guideline, paper, or official document.
|
||||
3. Put every used source in `sources` with `id`, `title`, `url`, `tier`, and `score`.
|
||||
4. Do not write a final chapter during search; produce structured evidence only.
|
||||
5. For repeatedly used Tier 1-2 sources, run `uv run python scripts/dr.py sources cache <project>` so later phases can cite a local Markdown snapshot rather than only a URL.
|
||||
|
||||
For chapter assembly:
|
||||
|
||||
1. Do not search. Use only `phase2/chapter_briefs`, `phase2/packets`, `phase2/sources.jsonl`, `phase0/extracted`, and `phase1/framework.md`.
|
||||
2. Do not create new `source_id`.
|
||||
3. If evidence is thin, mark the chapter as needing Phase 2 enrichment instead of filling with generic prose.
|
||||
@@ -0,0 +1,289 @@
|
||||
---
|
||||
name: search-strategy
|
||||
description: 生物医药深度研究的统一检索策略。规定信源优先级金字塔、检索轮次、关键词策略、API 调用顺序,以及何时切换到专业信源。所有做信息收集的 agent(dr-searcher/dr-analyst/dr-verifier/dr-plan)必须加载此技能。
|
||||
---
|
||||
|
||||
# 检索策略总纲(Deep Research 黄金法则)
|
||||
|
||||
## 一、信源优先级金字塔
|
||||
|
||||
**永远从上至下尝试,不要从 Tier 4 开始**:
|
||||
|
||||
```
|
||||
╱ Tier 1 ╲ 最高权重
|
||||
╱ (一手) ╲
|
||||
╱──────────────╲
|
||||
╱ Tier 2 ╲ 标准权重
|
||||
╱ (权威二手) ╲
|
||||
╱──────────────────╲
|
||||
╱ Tier 3 ╲ 辅助权重
|
||||
╱ (预印本/会议/券商) ╲
|
||||
─────────────────────────
|
||||
Tier 4 仅做发现入口
|
||||
(通用搜索 + Wiki)
|
||||
─────────────────────────
|
||||
【黑名单】禁用
|
||||
```
|
||||
|
||||
### Tier 1(优先使用,加权 1.2x)
|
||||
- **论文**:PubMed、Cochrane、顶刊(NEJM/Lancet/Nature/Science/Cell/JAMA/NatMed)
|
||||
- **监管**:FDA/EMA/NMPA/PMDA 官网、openFDA
|
||||
- **临床试验**:ClinicalTrials.gov、ChiCTR、EU CTR
|
||||
- **专利**:USPTO、EPO、CNIPA、Google Patents、PatentsView
|
||||
- **披露**:SEC(10-K/10-Q/S-1)、港交所、沪深交易所年报
|
||||
|
||||
### Tier 2(可用,标准权重)
|
||||
- **咨询**:McKinsey/BCG/Deloitte/IQVIA/Evaluate Pharma/Frost & Sullivan/沙利文
|
||||
- **综述**:系统综述、Cochrane Review、Meta 分析
|
||||
- **协会**:PhRMA、BIO、中国医药工业协会、中国医药创新促进会
|
||||
- **专业媒体**:BioSpace、Endpoints News、FiercePharma、STAT、医药魔方、Insight 数据库
|
||||
|
||||
### Tier 3(辅助,需 Tier 1-2 支撑)
|
||||
- **预印本**:bioRxiv、medRxiv、SSRN(必须标注"未同行评审")
|
||||
- **券商**:中金/中信/高盛/摩根士丹利生物医药(注意利益冲突)
|
||||
- **会议**:AACR/ASCO/ASH/JPM Healthcare Conference 摘要
|
||||
|
||||
### Tier 4(仅做入口)
|
||||
- Tavily / Brave / Exa 返回的普通网页 → **只用来发现 Tier 1-2 URL**,不做结论佐证
|
||||
- Wikipedia → **只做术语理解**,结论不得引用
|
||||
|
||||
### 黑名单(禁用为证据)
|
||||
- 百家号、头条号、大部分公众号自媒体
|
||||
- 未署名行业博客
|
||||
- Retraction Watch 标记的撤稿论文
|
||||
- "据业内人士透露"类无来源文章
|
||||
- >5 年的综述(机制研究可放宽)
|
||||
|
||||
---
|
||||
|
||||
## 二、检索 4 轮法则
|
||||
|
||||
对任何一个 section/chapter,**必须至少 4 轮检索**:
|
||||
|
||||
### 第 1 轮:Tier 1 直命中
|
||||
- 先用**精确查询**去 PubMed / ClinicalTrials / openFDA 打
|
||||
- 关键词用 MeSH Term(医学主题词)+ 布尔逻辑
|
||||
- 例:`(GLP-1[MeSH] OR "glucagon-like peptide-1") AND (obesity[MeSH]) AND ("2023"[PDAT]:"2026"[PDAT])`
|
||||
|
||||
### 第 2 轮:Tier 2 综述扫描
|
||||
- 去 McKinsey Insights / BCG / Deloitte 官网搜 industry-overview
|
||||
- Evaluate Pharma / IQVIA 白皮书(通常需注册)
|
||||
- 目标:获取市场规模、竞争格局、趋势判断
|
||||
|
||||
### 第 3 轮:反方/证伪检索
|
||||
- 主动搜索与初步结论相反的关键词
|
||||
- 例:研究"GLP-1 成为减重首选"→ 反方要搜 "GLP-1 limitations" "semaglutide side effects" "discontinuation rate"
|
||||
- 至少 3-5 条反方证据
|
||||
|
||||
### 第 4 轮:Exa/Tavily/Brave 补漏
|
||||
- 仅用于发现前 3 轮遗漏的 URL
|
||||
- 发现后**必须**回溯到原始 Tier 1-2 来源(论文 DOI、监管公告原文)
|
||||
- 不得直接引用搜索返回的二次报道
|
||||
- 章节级 evidence packet 优先用 `scripts/search.py --route evidence`,让 Exa highlights 进入 source-quality 和 evidence-table。
|
||||
- Tavily Research 只用于 Phase 1 初扫、薄弱章节补证据和 Phase 3 回炉;输出必须存盘、评分、去重后再转成 candidate evidence。
|
||||
|
||||
---
|
||||
|
||||
## 三、强制工具入口(v0.12)
|
||||
|
||||
所有 agent 做联网检索时,**优先调用项目内 Python 网关**,不要直接把 Tavily / Brave / Exa MCP 当成主路径:
|
||||
|
||||
```bash
|
||||
uv run python scripts/search.py "<query>" --route scholar --num-results 10 --year-low 2023
|
||||
uv run python scripts/search.py "<query>" --route evidence --num-results 10 --json --trace
|
||||
uv run python scripts/search.py "<query>" --route patents --num-results 10
|
||||
uv run python scripts/search.py "<query>" --route news --num-results 10 --time-range m
|
||||
uv run python scripts/search.py "<query>" --route general --num-results 10
|
||||
uv run python scripts/search.py "<query>" --profile china_market --num-results 10 --trace
|
||||
uv run python scripts/ground.py "<query>" --model google/gemini-3.1-flash-lite-preview --json
|
||||
```
|
||||
|
||||
也可以按研究场景跑 profile:
|
||||
|
||||
```bash
|
||||
uv run python scripts/search.py "<query>" --profile biomed_literature --num-results 10 --year-low 2023
|
||||
uv run python scripts/search.py "<query>" --profile patent_heavy --num-results 10
|
||||
```
|
||||
|
||||
**原因**:
|
||||
- Python 网关在 repo 内,可被 OpenCode / Codex / Gemini CLI / Claude Code 共同复用。
|
||||
- `--route patents` 固定优先 Serper + Google Patents,避免专利检索被 Tavily 普通网页结果替代。
|
||||
- `--route scholar` 固定优先 Serper Scholar,避免论文检索只停留在通用网页摘要。
|
||||
- 专用 route(scholar/patents/news)默认 `--strict-specialized`,Serper 异常时应显式失败,不允许静默降级。
|
||||
- Exa evidence route 是 packet 候选证据发现主路径;Tavily / Brave 只作为 gap-fill 或 MCP 兜底,不作为文献/专利主路径。
|
||||
|
||||
每个检索小结必须写明实际使用过的 route,例如:
|
||||
|
||||
```text
|
||||
Routes used: scholar, patents, general
|
||||
```
|
||||
|
||||
如果由于缺 key 或 API 错误无法调用 Serper,必须在输出中明确写(且建议重新执行,不直接进入正文证据):
|
||||
|
||||
```text
|
||||
Serper unavailable: <原因>; fallback used: general site:patents.google.com
|
||||
```
|
||||
|
||||
## 四、API 调用顺序(技术栈,v0.11 更新)
|
||||
|
||||
**按"查询类型"路由到最合适的 API**,而不是一律走通用搜索。
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ 查询类型 首选 备选 │
|
||||
├──────────────────────────────────────────────────────────────┤
|
||||
│ 专利 Serper Patents Google Patents 爬页 │
|
||||
│ (site:patents.google.com) │
|
||||
│ │
|
||||
│ 学术论文 Serper Scholar PubMed E-utils │
|
||||
│ (带引用数/年份/期刊) (原始数据库) │
|
||||
│ │
|
||||
│ 新闻 / 行业动态 Serper News Tavily │
|
||||
│ (时效性敏感) │
|
||||
│ │
|
||||
│ 临床试验 ClinicalTrials.gov ChiCTR │
|
||||
│ (原始 API) │
|
||||
│ │
|
||||
│ 监管公告 openFDA / FDA 搜索 EMA / NMPA 官网 │
|
||||
│ │
|
||||
│ 公司/机构识别 Exa Tavily │
|
||||
│ (LinkedIn/官网召回强) │
|
||||
│ │
|
||||
│ 通用网页 Exa Tavily / Brave │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### Serper(google.serper.dev)使用模板
|
||||
|
||||
**专利检索**:
|
||||
```bash
|
||||
uv run python scripts/search.py "dual-target siRNA GalNAc" --route patents --num-results 10
|
||||
```
|
||||
|
||||
**学术论文**:
|
||||
```bash
|
||||
uv run python scripts/search.py "dual-target RNAi 2024" --route scholar --num-results 10 --year-low 2023
|
||||
```
|
||||
|
||||
**新闻(时效性)**:
|
||||
```bash
|
||||
uv run python scripts/search.py "Arrowhead ARO-DIMER-PA clinical trial" --route news --num-results 10 --time-range w
|
||||
```
|
||||
|
||||
### Tavily MCP 调用模板(兜底,不作为主路径)
|
||||
|
||||
仅当 `scripts/search.py` 不可用,或需要 MCP 特有能力时使用。通用网页结果必须回溯到 Tier 1-2 原始来源。
|
||||
```
|
||||
工具名:tavily_search
|
||||
参数:
|
||||
query: "<关键词>"
|
||||
search_depth: "advanced"
|
||||
max_results: 10
|
||||
include_domains: ["pubmed.ncbi.nlm.nih.gov", "nejm.org", "lancet.com"]
|
||||
exclude_domains: ["baijiahao.baidu.com", "toutiao.com"]
|
||||
time_range: "year"
|
||||
```
|
||||
|
||||
### 何时用哪个
|
||||
|
||||
- **专利相关问题**("谁拥有技术 X"、"FTO 自由度分析")→ `c.patents()`,**永远先走 Google Patents**
|
||||
- **需要引用数排序的论文**("找影响力最大的 N 篇")→ `c.scholar()`
|
||||
- **近期新闻**("2025 年 Q4 交易"、"上月 IND 批准")→ `c.news(..., time_range="m")`
|
||||
- **快速概念验证 / 术语理解** → `c.search()`(通用)
|
||||
|
||||
### PubMed E-utils(bash 调用示例)
|
||||
```bash
|
||||
# 1. esearch 拿 PMID 列表
|
||||
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=GLP-1+obesity&retmax=20&api_key=$NCBI_API_KEY&retmode=json"
|
||||
|
||||
# 2. efetch 拿摘要
|
||||
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=PMID1,PMID2&rettype=abstract&retmode=xml&api_key=$NCBI_API_KEY"
|
||||
```
|
||||
|
||||
### ClinicalTrials.gov v2 API
|
||||
```bash
|
||||
curl -s "https://clinicaltrials.gov/api/v2/studies?query.term=semaglutide&pageSize=20&format=json"
|
||||
```
|
||||
|
||||
### openFDA
|
||||
```bash
|
||||
curl -s "https://api.fda.gov/drug/event.json?search=patient.drug.medicinalproduct:semaglutide&count=patient.reaction.reactionmeddrapt.exact&limit=20"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、关键词策略
|
||||
|
||||
### 中英双语必备
|
||||
- 任何生物医药主题**必须同时用中英文检索**
|
||||
- 中文关键词去找:中国监管(NMPA)、A股研报、医药魔方、Insight
|
||||
- 英文关键词去找:PubMed、FDA、顶刊、欧美研报
|
||||
|
||||
### MeSH Term 优先于自由词
|
||||
- PubMed 查询必须用 MeSH Term(医学主题词表)
|
||||
- MeSH Term 能自动扩展同义词,召回更全
|
||||
- 例:`obesity[MeSH]` 会自动包含 `adiposity`, `body weight, excess` 等
|
||||
|
||||
### 布尔逻辑 + 时间过滤
|
||||
- 默认加 `("2023"[PDAT]:"2026"[PDAT])` 时间窗
|
||||
- 机制研究可放宽到 10 年,新药/市场/政策必须近 3 年
|
||||
|
||||
### 反方关键词清单(备忘)
|
||||
- `limitations` / `adverse events` / `side effects` / `discontinuation`
|
||||
- `failed trial` / `FDA rejection` / `withdrawn`
|
||||
- `conflict of interest` / `industry-funded`
|
||||
- `retraction` / `replication failure`
|
||||
|
||||
---
|
||||
|
||||
## 六、每条信源的提取字段(标准化)
|
||||
|
||||
任何信源进 `sources.jsonl` 必须有以下字段:
|
||||
|
||||
```jsonl
|
||||
{
|
||||
"id": "src_001",
|
||||
"tier": 1,
|
||||
"score": 9.2,
|
||||
"type": "journal" | "trial" | "regulatory" | "patent" | "report" | "news",
|
||||
"url": "https://...",
|
||||
"doi": "10.xxxx/...",
|
||||
"title": "...",
|
||||
"authors": ["...", "..."],
|
||||
"year": 2025,
|
||||
"venue": "NEJM",
|
||||
"impact_factor": 176.0,
|
||||
"accessed_at": "2026-04-20",
|
||||
"abstract": "...",
|
||||
"key_data": {
|
||||
"market_size_2025": "12.3B USD",
|
||||
"cagr": "23%"
|
||||
},
|
||||
"used_in": ["ch01", "ch03.sec2"],
|
||||
"notes": "关键图表见 Fig 2"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、失败兜底
|
||||
|
||||
- 某个 API 限流/超时:**等 5s 重试 3 次**,仍失败则跳过并在日志标注
|
||||
- 某个信源 404:在 sources.jsonl 标 `"dead_link": true`,不删除(审计用)
|
||||
- 关键数据查不到:**不要编造**,在正文写 "该数据暂未找到公开来源(截至 2026-04)"
|
||||
|
||||
---
|
||||
|
||||
## 八、硬规则总结
|
||||
|
||||
1. ✅ 每 section 至少 4 轮检索
|
||||
2. ✅ 中英双语必查
|
||||
3. ✅ PubMed 用 MeSH Term
|
||||
4. ✅ 反方关键词必查
|
||||
5. ✅ Tier 4 结果只做发现,不做佐证
|
||||
6. ✅ 所有信源写入 sources.jsonl 并评分
|
||||
7. ✅ 文献检索必须优先 `scripts/search.py --route scholar`
|
||||
8. ✅ 专利检索必须优先 `scripts/search.py --route patents`
|
||||
9. ❌ 不得引用 Wikipedia 做结论
|
||||
10. ❌ 不得编造数据、URL、DOI
|
||||
11. ❌ 不得使用黑名单信源
|
||||
@@ -0,0 +1,188 @@
|
||||
---
|
||||
name: source-quality
|
||||
description: 信源质量评分系统(0-10 分制)与黑名单机制。规定每个信源入库前的评估维度、硬性淘汰规则、利益冲突检测。所有收集信源的 agent 都必须用此技能给每条信源打分后写入 sources.jsonl。
|
||||
---
|
||||
|
||||
# 信源质量评分(0-10 分制)
|
||||
|
||||
## 一、评分维度(满分 10 分)
|
||||
|
||||
| 维度 | 满分 | 判断标准 |
|
||||
|---|---|---|
|
||||
| 权威性 | 3 | 期刊 IF、机构排名 |
|
||||
| 时效性 | 2 | 发表时间 vs 主题 |
|
||||
| 一手性 | 2 | 一手数据 > 综述 > 二次解读 |
|
||||
| 可验证性 | 2 | 有 DOI/URL/原始数据 |
|
||||
| 无利益冲突 | 1 | 厂商自发降权 |
|
||||
|
||||
### 维度 1:权威性(0-3 分)
|
||||
|
||||
| 分值 | 情形 |
|
||||
|---|---|
|
||||
| 3.0 | IF ≥ 30(NEJM/Lancet/Nature/Science/Cell/JAMA)、FDA/EMA/NMPA 官方、SEC 披露 |
|
||||
| 2.5 | IF 10-30(NatMed/NatBiotech/BMJ/AnnOncol 等)、顶级咨询(MKS/BCG/Deloitte) |
|
||||
| 2.0 | IF 5-10(JCO/CircRes/AJRCCM)、IQVIA/EvaluatePharma、系统综述 |
|
||||
| 1.5 | IF 3-5、券商研报、行业协会白皮书 |
|
||||
| 1.0 | IF 1-3、专业媒体(BioSpace/Endpoints News) |
|
||||
| 0.5 | 预印本(bioRxiv/medRxiv)、会议摘要 |
|
||||
| 0 | 自媒体、百家号、未署名博客 |
|
||||
|
||||
### 维度 2:时效性(0-2 分)
|
||||
|
||||
| 主题类型 | 满分年限 | 每老 1 年扣分 |
|
||||
|---|---|---|
|
||||
| 市场 / 监管 / 临床 | 3 年内 | -0.5 |
|
||||
| 作用机制 / 基础研究 | 10 年内 | -0.2 |
|
||||
| 政策法规 | **以最新版本为准** | 过时版本 0 分 |
|
||||
| 历史追溯(有意为之) | 不限 | 不扣 |
|
||||
|
||||
### 维度 3:一手性(0-2 分)
|
||||
|
||||
| 分值 | 情形 |
|
||||
|---|---|
|
||||
| 2.0 | 一手数据(原始 RCT 论文、监管公告、年报原文、专利原文) |
|
||||
| 1.5 | 系统综述 / Meta 分析 |
|
||||
| 1.0 | 叙述性综述 / Review |
|
||||
| 0.5 | 二次解读(新闻报道、券商改写) |
|
||||
| 0 | 三次传播以上("据报道"/"业内人士") |
|
||||
|
||||
### 维度 4:可验证性(0-2 分)
|
||||
|
||||
| 分值 | 情形 |
|
||||
|---|---|
|
||||
| 2.0 | 有 DOI + 原始数据可下载(如 ClinicalTrials 的 CSR 附件) |
|
||||
| 1.5 | 有 DOI 或稳定 URL,全文可访问 |
|
||||
| 1.0 | URL 稳定但需付费墙 |
|
||||
| 0.5 | 仅有 URL,无唯一标识符 |
|
||||
| 0 | URL 失效 / 404 / 无法验证 |
|
||||
|
||||
### 维度 5:利益冲突(0-1 分)
|
||||
|
||||
| 分值 | 情形 |
|
||||
|---|---|
|
||||
| 1.0 | 独立研究(学术机构、政府)、无资助声明冲突 |
|
||||
| 0.5 | 有 industry funding 但已声明且方法独立 |
|
||||
| 0 | 厂商自发报告 / 直接商业软文 |
|
||||
| **-1**(惩罚) | 声明冲突但方法可疑、或对比实验明显偏向资助方 |
|
||||
|
||||
---
|
||||
|
||||
## 二、综合评分硬规则
|
||||
|
||||
| 评分 | 可用性 |
|
||||
|---|---|
|
||||
| 8.0+ | 可作为核心论据,单独支撑结论 |
|
||||
| 6.0-7.9 | 可用,但结论需 ≥2 个独立信源 |
|
||||
| 4.0-5.9 | 仅作为参考,**不得作为唯一支撑** |
|
||||
| < 4.0 | **禁止**用于结论佐证,只能入发现库 |
|
||||
|
||||
---
|
||||
|
||||
## 三、黑名单(直接拒绝入库)
|
||||
|
||||
以下信源**无论评分多少都禁用**:
|
||||
|
||||
### 1. 明确劣质信源
|
||||
- 百家号(baijiahao.baidu.com)
|
||||
- 头条号(toutiao.com 非原创栏目)
|
||||
- 知乎回答(除非作者本人为业内专家且有实名背书)
|
||||
- 小红书、抖音笔记
|
||||
- 未署名作者的 wordpress / medium 博客
|
||||
|
||||
### 2. 被撤稿论文
|
||||
- 查询 Retraction Watch 数据库(https://retractionwatch.com/)
|
||||
- Crossref API 检查论文状态:`https://api.crossref.org/works/<DOI>`
|
||||
|
||||
### 3. 明显软文/PR 稿
|
||||
识别特征(命中任意 2 条即拒):
|
||||
- 标题含 "重磅发布" "首创" "引领" 等夸张词
|
||||
- 通篇无具体数据,只有 CEO/专家口头引述
|
||||
- 发布渠道是企业官网的"新闻中心"且无交叉第三方验证
|
||||
- 仅讲优势不讲局限
|
||||
|
||||
### 4. 时效过期
|
||||
- 综述 > 5 年(机制研究可放宽)
|
||||
- 政策/监管 > 1 年(以最新版本为准)
|
||||
- 市场数据 > 2 年
|
||||
|
||||
### 5. 维基百科
|
||||
- **仅可作术语理解入口**
|
||||
- 结论永不引用
|
||||
- 如从 Wiki 发现了参考文献,**回溯到原始来源**再引用
|
||||
|
||||
---
|
||||
|
||||
## 四、利益冲突检测要点
|
||||
|
||||
### 常见利益冲突场景
|
||||
- 药企赞助的 RCT 对自家产品评价极高 → 查对比剂、盲法、样本量
|
||||
- 咨询公司报告引用自家客户数据 → 查 acknowledgment 段
|
||||
- 行业协会报告涉及会员企业 → 查资助方名单
|
||||
- 券商研报 + 该券商是相关公司的保荐人 → 查 IPO/承销记录
|
||||
|
||||
### 操作方法
|
||||
每条信源入库前检查:
|
||||
1. 作者/机构是否与被评估的公司/产品有商业关联?
|
||||
2. 资助声明(funding statement)里提到什么?
|
||||
3. 利益披露(disclosure)是否完整?
|
||||
|
||||
**发现强利益冲突**:评分 ≤ 3(等同废弃);写入 `sources.jsonl` 的 `"conflict_of_interest": "..."` 字段。
|
||||
|
||||
---
|
||||
|
||||
## 五、评分执行流程(伪代码)
|
||||
|
||||
```
|
||||
for each candidate_source in search_results:
|
||||
# 1. 黑名单快筛
|
||||
if is_blacklisted(candidate_source):
|
||||
log("BLACKLIST: " + source.url); continue
|
||||
|
||||
# 2. 撤稿检查
|
||||
if has_doi(source) and is_retracted(source.doi):
|
||||
log("RETRACTED: " + source.doi); continue
|
||||
|
||||
# 3. 评分
|
||||
score = 0
|
||||
score += authority_score(source) # 0-3
|
||||
score += recency_score(source, topic) # 0-2
|
||||
score += primacy_score(source) # 0-2
|
||||
score += verifiability_score(source) # 0-2
|
||||
score += coi_score(source) # 0-1 or -1
|
||||
|
||||
# 4. Tier 加权
|
||||
if source.tier == 1: score *= 1.2
|
||||
|
||||
# 5. 入库
|
||||
if score >= 4.0:
|
||||
append_to_sources_jsonl(source, score)
|
||||
else:
|
||||
log("LOW SCORE (" + score + "): " + source.url)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 六、输出字段(写入 sources.jsonl)
|
||||
|
||||
```jsonl
|
||||
{
|
||||
"id": "src_042",
|
||||
"score": 8.6,
|
||||
"tier": 1,
|
||||
"authority": 3.0,
|
||||
"recency": 2.0,
|
||||
"primacy": 2.0,
|
||||
"verifiability": 2.0,
|
||||
"coi": 1.0,
|
||||
"conflict_of_interest": null,
|
||||
"blacklist_checked": true,
|
||||
"retraction_checked": true,
|
||||
"notes": "NEJM 2025 原文,RCT 独立研究"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、审计留痕
|
||||
|
||||
所有被**拒绝**的信源,也要写入 `projects/<slug>/phase2/rejected-sources.jsonl`(注明原因)。这是事后复盘的关键,不要静默丢弃。
|
||||
@@ -0,0 +1,67 @@
|
||||
# Fonts 目录
|
||||
|
||||
## 说明
|
||||
|
||||
本目录存放 Deep Research 系统生成 PDF 报告所需的中文字体。
|
||||
**所有字体文件均通过 `.gitignore` 排除**,不会进入 git 版本库,以避免仓库体积膨胀(~140MB)。
|
||||
|
||||
## 快速开始
|
||||
|
||||
首次使用时,运行:
|
||||
|
||||
```bash
|
||||
bash .opencode/templates/fonts/download-fonts.sh
|
||||
```
|
||||
|
||||
脚本会自动从官方 GitHub 下载以下字体:
|
||||
|
||||
| 文件 | 字体名 | 用途 |
|
||||
|---|---|---|
|
||||
| `SourceHanSerifSC-Regular.otf` | 思源宋体 Regular | 正文 |
|
||||
| `SourceHanSerifSC-Bold.otf` | 思源宋体 Bold | 正文粗体/术语 |
|
||||
| `SourceHanSansSC-Light.otf` | 思源黑体 Light | 页眉页脚 |
|
||||
| `SourceHanSansSC-Medium.otf` | 思源黑体 Medium | 三级标题、图表 |
|
||||
| `SourceHanSansSC-Bold.otf` | 思源黑体 Bold | 一二级标题 |
|
||||
| `SourceHanSansSC-Heavy.otf` | 思源黑体 Heavy | 封面大标题 |
|
||||
| `LXGWWenKai-Regular.ttf` | 霞鹜文楷 Regular | 摘要、引文、批注 |
|
||||
|
||||
## 许可证
|
||||
|
||||
全部字体为 **SIL Open Font License 1.1**,可自由商用、嵌入 PDF 分发。
|
||||
|
||||
- 思源宋体 / 思源黑体:© Adobe Systems Incorporated + Google,SIL OFL 1.1
|
||||
- 霞鹜文楷:© LXGW(基于台北黑体和 Klee One 修改),SIL OFL 1.1
|
||||
|
||||
## 手动下载(脚本失败时的备用方案)
|
||||
|
||||
如果 `download-fonts.sh` 因网络问题失败,请手动从官方 Release 下载并放入本目录:
|
||||
|
||||
- **思源宋体**:https://github.com/adobe-fonts/source-han-serif/releases
|
||||
- 取 `SubsetOTF/CN/` 路径下的 `SourceHanSerifCN-Regular.otf` 和 `SourceHanSerifCN-Bold.otf`
|
||||
- 放入本目录并重命名为 `SourceHanSerifSC-Regular.otf` 和 `SourceHanSerifSC-Bold.otf`
|
||||
|
||||
- **思源黑体**:https://github.com/adobe-fonts/source-han-sans/releases
|
||||
- 取 `SubsetOTF/CN/` 路径下的 Light / Medium / Bold / Heavy 四个字重
|
||||
- 放入本目录并重命名(CN → SC)
|
||||
|
||||
- **霞鹜文楷**:https://github.com/lxgw/LxgwWenKai/releases
|
||||
- 取最新版 `LXGWWenKai-Regular.ttf` 放入本目录(无需改名)
|
||||
|
||||
## 常见问题
|
||||
|
||||
### Q: 下载速度慢 / 失败
|
||||
A: 国内网络访问 GitHub 可能不稳定。`download-fonts.sh` 会自动尝试镜像。仍失败可手动从国内字体镜像下载(注意认证版本号一致)。
|
||||
|
||||
### Q: 为什么不用系统自带的苹方/微软雅黑?
|
||||
A: 这两个字体许可**禁止嵌入 PDF 分发**。用思源系列(SIL OFL)可无限制嵌入,报告传给客户/团队不会有许可问题。
|
||||
|
||||
### Q: 字体文件可以入 git 吗?
|
||||
A: 不推荐。140MB 会严重拖慢 git 操作。目前策略是 `.gitignore` + `download-fonts.sh` 按需下载。
|
||||
|
||||
### Q: 我已经有字体文件了,在别的路径
|
||||
A: 有两种选择:
|
||||
1. 直接 `cp / ln -s` 到本目录
|
||||
2. 调用 `report-template.py` 时用 `--fonts-dir /path/to/your/fonts`
|
||||
|
||||
### Q: 字体版本会影响渲染吗?
|
||||
A: 思源字体 v2.x 之后字形基本稳定。霞鹜文楷不同版本字形有微调,建议锁定到 v1.330 或更高。
|
||||
@@ -0,0 +1,142 @@
|
||||
#!/usr/bin/env bash
|
||||
# 字体下载脚本:思源宋体 + 思源黑体 + 霞鹜文楷
|
||||
# 用法:bash .opencode/templates/fonts/download-fonts.sh
|
||||
# 许可:全部 SIL OFL,可自由商用、嵌入 PDF 分发
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
FONTS_DIR="$SCRIPT_DIR"
|
||||
|
||||
echo "====================================="
|
||||
echo "Deep Research 字体下载"
|
||||
echo "目标目录:$FONTS_DIR"
|
||||
echo "====================================="
|
||||
|
||||
# 检测下载工具
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
DOWNLOADER="curl -fL --retry 3 --retry-delay 5 -o"
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
DOWNLOADER="wget -O"
|
||||
else
|
||||
echo "❌ 需要 curl 或 wget,请先安装"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 字体清单:文件名 | 下载 URL
|
||||
# 思源字体走 adobe-fonts GitHub Release 的 "Language Specific OTFs Simplified Chinese" 包
|
||||
# 霞鹜文楷走 lxgw/LxgwWenKai Release
|
||||
declare -a FONTS=(
|
||||
"SourceHanSerifSC-Regular.otf|https://github.com/adobe-fonts/source-han-serif/raw/release/SubsetOTF/CN/SourceHanSerifCN-Regular.otf"
|
||||
"SourceHanSerifSC-Bold.otf|https://github.com/adobe-fonts/source-han-serif/raw/release/SubsetOTF/CN/SourceHanSerifCN-Bold.otf"
|
||||
"SourceHanSansSC-Light.otf|https://github.com/adobe-fonts/source-han-sans/raw/release/SubsetOTF/CN/SourceHanSansCN-Light.otf"
|
||||
"SourceHanSansSC-Medium.otf|https://github.com/adobe-fonts/source-han-sans/raw/release/SubsetOTF/CN/SourceHanSansCN-Medium.otf"
|
||||
"SourceHanSansSC-Bold.otf|https://github.com/adobe-fonts/source-han-sans/raw/release/SubsetOTF/CN/SourceHanSansCN-Bold.otf"
|
||||
"SourceHanSansSC-Heavy.otf|https://github.com/adobe-fonts/source-han-sans/raw/release/SubsetOTF/CN/SourceHanSansCN-Heavy.otf"
|
||||
"LXGWWenKai-Regular.ttf|https://github.com/lxgw/LxgwWenKai/releases/download/v1.330/LXGWWenKai-Regular.ttf"
|
||||
)
|
||||
|
||||
# 备用镜像(主源失败时用)
|
||||
declare -a MIRRORS=(
|
||||
"SourceHanSerifSC-Regular.otf|https://raw.githubusercontent.com/adobe-fonts/source-han-serif/release/SubsetOTF/CN/SourceHanSerifCN-Regular.otf"
|
||||
"SourceHanSerifSC-Bold.otf|https://raw.githubusercontent.com/adobe-fonts/source-han-serif/release/SubsetOTF/CN/SourceHanSerifCN-Bold.otf"
|
||||
"SourceHanSansSC-Light.otf|https://raw.githubusercontent.com/adobe-fonts/source-han-sans/release/SubsetOTF/CN/SourceHanSansCN-Light.otf"
|
||||
"SourceHanSansSC-Medium.otf|https://raw.githubusercontent.com/adobe-fonts/source-han-sans/release/SubsetOTF/CN/SourceHanSansCN-Medium.otf"
|
||||
"SourceHanSansSC-Bold.otf|https://raw.githubusercontent.com/adobe-fonts/source-han-sans/release/SubsetOTF/CN/SourceHanSansCN-Bold.otf"
|
||||
"SourceHanSansSC-Heavy.otf|https://raw.githubusercontent.com/adobe-fonts/source-han-sans/release/SubsetOTF/CN/SourceHanSansCN-Heavy.otf"
|
||||
"LXGWWenKai-Regular.ttf|https://ghproxy.com/https://github.com/lxgw/LxgwWenKai/releases/download/v1.330/LXGWWenKai-Regular.ttf"
|
||||
)
|
||||
|
||||
download_font() {
|
||||
local filename="$1"
|
||||
local url="$2"
|
||||
local target="$FONTS_DIR/$filename"
|
||||
|
||||
if [[ -f "$target" ]]; then
|
||||
local size
|
||||
size=$(stat -f%z "$target" 2>/dev/null || stat -c%s "$target" 2>/dev/null || echo 0)
|
||||
if [[ $size -gt 100000 ]]; then
|
||||
echo " ✓ 已存在($size bytes),跳过:$filename"
|
||||
return 0
|
||||
else
|
||||
echo " ⚠ 文件过小($size bytes),重新下载:$filename"
|
||||
rm -f "$target"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo " ↓ 下载 $filename ..."
|
||||
if $DOWNLOADER "$target" "$url" 2>/dev/null; then
|
||||
local size
|
||||
size=$(stat -f%z "$target" 2>/dev/null || stat -c%s "$target" 2>/dev/null || echo 0)
|
||||
if [[ $size -gt 100000 ]]; then
|
||||
echo " ✓ 完成($size bytes)"
|
||||
return 0
|
||||
else
|
||||
echo " ⚠ 下载的文件过小,可能失败"
|
||||
rm -f "$target"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
echo " ✗ 下载失败"
|
||||
rm -f "$target"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_mirror_url() {
|
||||
local filename="$1"
|
||||
for entry in "${MIRRORS[@]}"; do
|
||||
IFS='|' read -r fn url <<< "$entry"
|
||||
if [[ "$fn" == "$filename" ]]; then
|
||||
echo "$url"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
echo ""
|
||||
echo "开始下载..."
|
||||
echo ""
|
||||
|
||||
FAILED=()
|
||||
for entry in "${FONTS[@]}"; do
|
||||
IFS='|' read -r filename url <<< "$entry"
|
||||
if ! download_font "$filename" "$url"; then
|
||||
# 主源失败,试镜像
|
||||
mirror_url=$(get_mirror_url "$filename" || true)
|
||||
if [[ -n "$mirror_url" ]]; then
|
||||
echo " ↻ 尝试镜像..."
|
||||
if download_font "$filename" "$mirror_url"; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
FAILED+=("$filename")
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "====================================="
|
||||
|
||||
if [[ ${#FAILED[@]} -eq 0 ]]; then
|
||||
echo "✅ 全部字体下载成功!"
|
||||
echo ""
|
||||
echo "字体文件清单:"
|
||||
ls -lh "$FONTS_DIR" | grep -E '\.(otf|ttf)$' || true
|
||||
echo ""
|
||||
echo "许可证:全部 SIL OFL,可自由商用、嵌入 PDF 分发。"
|
||||
exit 0
|
||||
else
|
||||
echo "❌ 以下字体下载失败:"
|
||||
for f in "${FAILED[@]}"; do
|
||||
echo " - $f"
|
||||
done
|
||||
echo ""
|
||||
echo "请手动下载,并放入 $FONTS_DIR/"
|
||||
echo ""
|
||||
echo "手动下载链接:"
|
||||
echo " 思源宋体:https://github.com/adobe-fonts/source-han-serif/releases"
|
||||
echo " 思源黑体:https://github.com/adobe-fonts/source-han-sans/releases"
|
||||
echo " 霞鹜文楷:https://github.com/lxgw/LxgwWenKai/releases"
|
||||
exit 1
|
||||
fi
|
||||
+1672
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user