deep-research
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeep Research
深度研究
<!-- STATIC CONTEXT BLOCK START - Optimized for prompt caching -->
<!-- All static instructions, methodology, and templates below this line -->
<!-- Dynamic content (user queries, results) added after this block -->
<!-- STATIC CONTEXT BLOCK START - 针对提示词缓存优化 -->
<!-- 以下为所有静态指令、方法论和模板 -->
<!-- 动态内容(用户查询、结果)将添加至该区块之后 -->
Core System Instructions
核心系统指令
Purpose: Deliver citation-backed, verified research reports through 8-phase pipeline (Scope → Plan → Retrieve → Triangulate → Synthesize → Critique → Refine → Package) with source credibility scoring and progressive context management.
Context Strategy: This skill uses 2025 context engineering best practices:
- Static instructions cached (this section)
- Progressive disclosure (load references only when needed)
- Avoid "loss in the middle" (critical info at start/end, not buried)
- Explicit section markers for context navigation
目标: 通过8阶段流程(范围界定→规划→检索→三角验证→综合→批判→优化→打包)交付带引用支持、经过验证的研究报告,同时进行来源可信度评分和渐进式上下文管理。
上下文策略: 本技能采用2025年上下文工程最佳实践:
- 静态指令缓存(本章节内容)
- 渐进式披露(仅在需要时加载参考资料)
- 避免“中间信息丢失”(关键信息置于开头/结尾,而非埋在中间)
- 使用明确的章节标记便于上下文导航
Decision Tree (Execute First)
决策树(优先执行)
Request Analysis
├─ Simple lookup? → STOP: Use WebSearch, not this skill
├─ Debugging? → STOP: Use standard tools, not this skill
└─ Complex analysis needed? → CONTINUE
Mode Selection
├─ Initial exploration? → quick (3 phases, 2-5 min)
├─ Standard research? → standard (6 phases, 5-10 min) [DEFAULT]
├─ Critical decision? → deep (8 phases, 10-20 min)
└─ Comprehensive review? → ultradeep (8+ phases, 20-45 min)
Execution Loop (per phase)
├─ Load phase instructions from [methodology](./reference/methodology.md#phase-N)
├─ Execute phase tasks
├─ Spawn parallel agents if applicable
└─ Update progress
Validation Gate
├─ Run `python scripts/validate_report.py --report [path]`
├─ Pass? → Deliver
└─ Fail? → Fix (max 2 attempts) → Still fails? → Escalate请求分析
├─ 是否为简单查询? → 终止:使用WebSearch,而非本技能
├─ 是否为调试需求? → 终止:使用标准工具,而非本技能
└─ 是否需要复杂分析? → 继续执行
模式选择
├─ 初始探索? → 快速模式(3个阶段,2-5分钟)
├─ 标准研究? → 标准模式(6个阶段,5-10分钟)【默认】
├─ 关键决策支撑? → 深度模式(8个阶段,10-20分钟)
└─ 全面综述? → 超深度模式(8+阶段,20-45分钟)
执行循环(每个阶段)
├─ 从[方法论](./reference/methodology.md#phase-N)加载阶段指令
├─ 执行阶段任务
├─ 如有需要,启动并行Agent
└─ 更新进度
验证关卡
├─ 运行`python scripts/validate_report.py --report [path]`
├─ 通过? → 交付报告
└─ 未通过? → 修复(最多2次尝试)→ 仍未通过? → 升级处理Workflow (Clarify → Plan → Act → Verify → Report)
工作流(澄清→规划→执行→验证→报告)
AUTONOMY PRINCIPLE: This skill operates independently. Infer assumptions from query context. Only stop for critical errors or incomprehensible queries.
自主原则: 本技能可独立运行,从查询上下文中推导假设。仅在出现严重错误或查询无法理解时才停止。
1. Clarify (Rarely Needed - Prefer Autonomy)
1. 澄清(极少需要 - 优先自主运行)
DEFAULT: Proceed autonomously. Derive assumptions from query signals.
ONLY ask if CRITICALLY ambiguous:
- Query is incomprehensible (e.g., "research the thing")
- Contradictory requirements (e.g., "quick 50-source ultradeep analysis")
When in doubt: PROCEED with standard mode. User will redirect if incorrect.
Default assumptions:
- Technical query → Assume technical audience
- Comparison query → Assume balanced perspective needed
- Trend query → Assume recent 1-2 years unless specified
- Standard mode is default for most queries
默认: 自主推进,从查询信号中推导假设。
仅在以下严重歧义场景下询问用户:
- 查询无法理解(例如:“研究那个东西”)
- 需求矛盾(例如:“快速完成50个来源的超深度分析”)
如有疑问: 以标准模式推进。若有误,用户会进行纠正。
默认假设:
- 技术类查询 → 假设受众为技术人员
- 对比类查询 → 假设需要中立视角
- 趋势类查询 → 假设默认分析最近1-2年的内容,除非另有指定
- 标准模式为大多数查询的默认选项
2. Plan
2. 规划
Mode selection criteria:
- Quick (2-5 min): Exploration, broad overview, time-sensitive
- Standard (5-10 min): Most use cases, balanced depth/speed [DEFAULT]
- Deep (10-20 min): Important decisions, need thorough verification
- UltraDeep (20-45 min): Critical analysis, maximum rigor
Announce plan and execute:
- Briefly state: selected mode, estimated time, number of sources
- Example: "Starting standard mode research (5-10 min, 15-30 sources)"
- Proceed without waiting for approval
模式选择标准:
- 快速模式(2-5分钟):探索性研究、概览、时间敏感场景
- 标准模式(5-10分钟):大多数使用场景,平衡深度与速度【默认】
- 深度模式(10-20分钟):重要决策支撑,需要彻底验证
- 超深度模式(20-45分钟):关键分析,最高严谨性要求
告知规划并执行:
- 简要说明:所选模式、预计耗时、来源数量
- 示例:“启动标准模式研究(5-10分钟,15-30个来源)”
- 无需等待批准即可推进
3. Act (Phase Execution)
3. 执行(阶段落地)
All modes execute:
- Phase 1: SCOPE - Define boundaries (method)
- Phase 3: RETRIEVE - Parallel search execution (5-10 concurrent searches + agents) (method)
- Phase 8: PACKAGE - Generate report using template
Standard/Deep/UltraDeep execute:
- Phase 2: PLAN - Strategy formulation
- Phase 4: TRIANGULATE - Verify 3+ sources per claim
- Phase 4.5: OUTLINE REFINEMENT - Adapt structure based on evidence (WebWeaver 2025) (method)
- Phase 5: SYNTHESIZE - Generate novel insights
Deep/UltraDeep execute:
- Phase 6: CRITIQUE - Red-team analysis
- Phase 7: REFINE - Address gaps
Critical: Avoid "Loss in the Middle"
- Place key findings at START and END of sections, not buried
- Use explicit headers and markers
- Structure: Summary → Details → Conclusion (not Details sandwiched)
Progressive Context Loading:
- Load methodology sections on-demand
- Load template only for Phase 8
- Do not inline everything - reference external files
Anti-Hallucination Protocol (CRITICAL):
- Source grounding: Every factual claim MUST cite a specific source immediately [N]
- Clear boundaries: Distinguish between FACTS (from sources) and SYNTHESIS (your analysis)
- Explicit markers: Use "According to [1]..." or "[1] reports..." for source-grounded statements
- No speculation without labeling: Mark inferences as "This suggests..." not "Research shows..."
- Verify before citing: If unsure whether source actually says X, do NOT fabricate citation
- When uncertain: Say "No sources found for X" rather than inventing references
Parallel Execution Requirements (CRITICAL for Speed):
Phase 3 RETRIEVE - Mandatory Parallel Search:
- Decompose query into 5-10 independent search angles before ANY searches
- Launch ALL searches in single message with multiple tool calls (NOT sequential)
- Quality threshold monitoring for FFS pattern:
- Track source count and avg credibility score
- Proceed when threshold reached (mode-specific, see methodology)
- Continue background searches for additional depth
- Spawn 3-5 parallel agents using Task tool for deep-dive investigations
Example correct execution:
[Single message with 8+ parallel tool calls]
WebSearch #1: Core topic semantic
WebSearch #2: Technical keywords
WebSearch #3: Recent 2024-2025 filtered
WebSearch #4: Academic domains
WebSearch #5: Critical analysis
WebSearch #6: Industry trends
Task agent #1: Academic paper analysis
Task agent #2: Technical documentation deep dive❌ WRONG (sequential execution):
WebSearch #1 → wait for results → WebSearch #2 → wait → WebSearch #3...✅ RIGHT (parallel execution):
All searches + agents launched simultaneously in one message所有模式均需执行:
- 阶段1:范围界定 - 明确研究边界(方法)
- 阶段3:检索 - 并行搜索执行(5-10个并发搜索+Agent)(方法)
- 阶段8:打包 - 使用模板生成报告
标准/深度/超深度模式额外执行:
- 阶段2:规划 - 制定研究策略
- 阶段4:三角验证 - 每个结论需验证3个以上来源
- 阶段4.5:大纲优化 - 根据证据调整结构(WebWeaver 2025)(方法)
- 阶段5:综合 - 生成全新洞察
深度/超深度模式额外执行:
- 阶段6:批判 - 红队分析
- 阶段7:优化 - 填补信息缺口
关键:避免“中间信息丢失”
- 将关键发现置于章节开头和结尾,而非埋在中间
- 使用明确的标题和标记
- 结构:摘要→细节→结论(而非细节夹在中间)
渐进式上下文加载:
- 按需加载方法论章节
- 仅在阶段8加载模板
- 请勿内联所有内容 - 仅引用外部文件
反幻觉协议(CRITICAL):
- 来源锚定:每个事实性结论必须立即标注具体来源[N]
- 明确边界:区分事实(来自来源)与综合分析(你的分析)
- 明确标记:对于基于来源的陈述,使用“根据[1]...”或“[1]报告称...”
- 无标注不推测:将推论标记为“这表明...”而非“研究表明...”
- 引用前先验证:若不确定来源是否确实包含X内容,请勿编造引用
- 存疑时的处理:说明“未找到关于X的来源”,而非编造参考资料
并行执行要求(对速度至关重要):
阶段3 检索 - 强制并行搜索:
- 分解查询:在进行任何搜索前,将查询拆分为5-10个独立的搜索角度
- 批量启动搜索:在单条消息中发起所有搜索调用(而非顺序执行)
- 质量阈值监控(FFS模式):
- 追踪来源数量和平均可信度得分
- 达到阈值后推进(阈值因模式而异,详见方法论)
- 后台继续搜索以获取更多深度内容
- 启动3-5个并行Agent:使用Task工具进行深度调查
正确执行示例:
[单条消息包含8个以上并行工具调用]
WebSearch #1: 核心主题语义搜索
WebSearch #2: 技术关键词搜索
WebSearch #3: 2024-2025年最新内容筛选
WebSearch #4: 学术领域搜索
WebSearch #5: 批判性分析搜索
WebSearch #6: 行业趋势搜索
Task agent #1: 学术论文分析
Task agent #2: 技术文档深度挖掘❌ 错误(顺序执行):
WebSearch #1 → 等待结果 → WebSearch #2 → 等待 → WebSearch #3...✅ 正确(并行执行):
在单条消息中同时启动所有搜索和Agent4. Verify (Always Execute)
4. 验证(始终执行)
Step 1: Citation Verification (Catches Fabricated Sources)
bash
python scripts/verify_citations.py --report [path]Checks:
- DOI resolution (verifies citation actually exists)
- Title/year matching (detects mismatched metadata)
- Flags suspicious entries (2024+ without DOI, no URL, failed verification)
If suspicious citations found:
- Review flagged entries manually
- Remove or replace fabricated sources
- Re-run until clean
Step 2: Structure & Quality Validation
bash
python scripts/validate_report.py --report [path]8 automated checks:
- Executive summary length (50-250 words)
- Required sections present (+ recommended: Claims table, Counterevidence)
- Citations formatted [1], [2], [3]
- Bibliography matches citations
- No placeholder text (TBD, TODO)
- Word count reasonable (500-10000)
- Minimum 10 sources
- No broken internal links
If fails:
- Attempt 1: Auto-fix formatting/links
- Attempt 2: Manual review + correction
- After 2 failures: STOP → Report issues → Ask user
步骤1:引用验证(检测伪造来源)
bash
python scripts/verify_citations.py --report [path]检查项:
- DOI解析(验证引用是否真实存在)
- 标题/年份匹配(检测元数据不匹配)
- 标记可疑条目(2024+无DOI、无URL、验证失败)
若发现可疑引用:
- 手动复查标记条目
- 删除或替换伪造来源
- 重新运行直至无问题
步骤2:结构与质量验证
bash
python scripts/validate_report.py --report [path]8项自动检查:
- 执行摘要长度(50-250词)
- 必填章节是否齐全(推荐额外包含:结论表格、反证)
- 引用格式为[1], [2], [3]
- 参考文献与引用匹配
- 无占位文本(TBD、TODO)
- 字数合理(500-10000词)
- 至少10个来源
- 无失效内部链接
若未通过:
- 尝试1:自动修复格式/链接
- 尝试2:手动复查+修正
- 2次失败后:终止 → 报告问题 → 询问用户
5. Report
5. 报告
CRITICAL: Generate COMPREHENSIVE, DETAILED markdown reports
File Organization (CRITICAL - Clean Accessibility):
1. Create Organized Folder in /code:
- ALWAYS create dedicated folder:
/code/[TopicName]_Research_[YYYYMMDD]/ - Extract clean topic name from research question (remove special chars, use underscores/CamelCase)
- Examples:
- "psilocybin research 2025" →
/code/Psilocybin_Research_20251104/ - "compare React vs Vue" →
/code/React_vs_Vue_Research_20251104/ - "AI safety trends" →
/code/AI_Safety_Trends_Research_20251104/
- "psilocybin research 2025" →
- If folder exists, use it; if not, create it
- This ensures clean organization and easy accessibility
2. Save All Formats to Same Folder:
Markdown (Primary Source):
- Save to:
[Documents folder]/research_report_[YYYYMMDD]_[topic_slug].md - Also save copy to: (internal tracking)
/code/research_output/ - Full detailed report with all findings
HTML (McKinsey Style - ALWAYS GENERATE):
- Save to:
[Documents folder]/research_report_[YYYYMMDD]_[topic_slug].html - Use McKinsey template: mckinsey_template
- Design principles: Sharp corners (NO border-radius), muted corporate colors (navy #003d5c, gray #f8f9fa), ultra-compact layout, info-first structure
- Place critical metrics dashboard at top (extract 3-4 key quantitative findings)
- Use data tables for dense information presentation
- 14px base font, compact spacing, no decorative gradients or colors
- Attribution Gradients (2025): Wrap each citation [N] in with nested tooltip div showing source details
<span class="citation"> - OPEN in browser automatically after generation
PDF (Professional Print - ALWAYS GENERATE):
- Save to:
[Documents folder]/research_report_[YYYYMMDD]_[topic_slug].pdf - Use generating-pdf skill (via Task tool with general-purpose agent)
- Professional formatting with headers, page numbers
- OPEN in default PDF viewer after generation
3. File Naming Convention:
All files use same base name for easy matching:
research_report_20251104_psilocybin_2025.mdresearch_report_20251104_psilocybin_2025.htmlresearch_report_20251104_psilocybin_2025.pdf
Length Requirements (UNLIMITED with Progressive Assembly):
- Quick mode: 2,000+ words (baseline quality threshold)
- Standard mode: 4,000+ words (comprehensive analysis)
- Deep mode: 6,000+ words (thorough investigation)
- UltraDeep mode: 10,000-50,000+ words (NO UPPER LIMIT - as comprehensive as evidence warrants)
How Unlimited Length Works:
Progressive file assembly allows ANY report length by generating section-by-section.
Each section is written to file immediately (avoiding output token limits).
Complex topics with many findings? Generate 20, 30, 50+ findings - no constraint!
Content Requirements:
- Use template as exact structure
- Generate each section to APPROPRIATE depth (determined by evidence, not word targets)
- Include specific data, statistics, dates, numbers (not vague statements)
- Multiple paragraphs per finding with evidence (as many as needed)
- Each section gets focused generation attention
- DO NOT write summaries - write FULL analysis
Writing Standards:
- Narrative-driven: Write in flowing prose. Each finding tells a story with beginning (context), middle (evidence), end (implications)
- Precision: Every word deliberately chosen, carries intention
- Economy: No fluff, eliminate fancy grammar, unnecessary modifiers
- Clarity: Exact numbers embedded in sentences ("The study demonstrated a 23% reduction in mortality"), not isolated in bullets
- Directness: State findings without embellishment
- High signal-to-noise: Dense information, respect reader's time
Bullet Point Policy (Anti-Fatigue Enforcement):
- Use bullets SPARINGLY: Only for distinct lists (product names, company roster, enumerated steps)
- NEVER use bullets as primary content delivery - they fragment thinking
- Each findings section requires substantive prose paragraphs (3-5+ paragraphs minimum)
- Example: Instead of "• Market size: $2.4B" write "The global market reached $2.4 billion in 2023, driven by increasing consumer demand and regulatory tailwinds [1]."
Anti-Fatigue Quality Check (Apply to EVERY Section):
Before considering a section complete, verify:
- Paragraph count: ≥3 paragraphs for major sections (## headings)
- Prose-first: <20% of content is bullet points (≥80% must be flowing prose)
- No placeholders: Zero instances of "Content continues", "Due to length", "[Sections X-Y]"
- Evidence-rich: Specific data points, statistics, quotes (not vague statements)
- Citation density: Major claims cited within same sentence
If ANY check fails: Regenerate the section before moving to next.
Source Attribution Standards (Critical for Preventing Fabrication):
- Immediate citation: Every factual claim followed by [N] citation in same sentence
- Quote sources directly: Use "According to [1]..." or "[1] reports..." for factual statements
- Distinguish fact from synthesis:
- ✅ GOOD: "Mortality decreased 23% (p<0.01) in the treatment group [1]."
- ❌ BAD: "Studies show mortality improved significantly."
- No vague attributions:
- ❌ NEVER: "Research suggests...", "Studies show...", "Experts believe..."
- ✅ ALWAYS: "Smith et al. (2024) found..." [1], "According to FDA data..." [2]
- Label speculation explicitly:
- ✅ GOOD: "This suggests a potential mechanism..." (analysis, not fact)
- ❌ BAD: "The mechanism is..." (presented as fact without citation)
- Admit uncertainty:
- ✅ GOOD: "No sources found addressing X directly."
- ❌ BAD: Fabricating a citation to fill the gap
- Template pattern: "[Specific claim with numbers/data] [Citation]. [Analysis/implication]."
Deliver to user:
- Executive summary (inline in chat)
- Organized folder path (e.g., "All files saved to: /code/Psilocybin_Research_20251104/")
- Confirmation of all three formats generated:
- Markdown (source)
- HTML (McKinsey-style, opened in browser)
- PDF (professional print, opened in viewer)
- Source quality assessment summary (source count)
- Next steps (if relevant)
Generation Workflow: Progressive File Assembly (Unlimited Length)
Phase 8.1: Setup
bash
undefined关键:生成全面、详细的markdown报告
文件组织(关键 - 便于访问):
1. 在/code中创建有序文件夹:
- 必须创建专用文件夹:
/code/[TopicName]_Research_[YYYYMMDD]/ - 从研究问题中提取清晰的主题名称(移除特殊字符,使用下划线/驼峰命名)
- 示例:
- "psilocybin research 2025" →
/code/Psilocybin_Research_20251104/ - "compare React vs Vue" →
/code/React_vs_Vue_Research_20251104/ - "AI safety trends" →
/code/AI_Safety_Trends_20251104/
- "psilocybin research 2025" →
- 若文件夹已存在则直接使用;若不存在则创建
- 确保文件组织清晰,便于访问
2. 将所有格式保存至同一文件夹:
Markdown(主源文件):
- 保存至:
[Documents folder]/research_report_[YYYYMMDD]_[topic_slug].md - 同时保存副本至:(内部追踪用)
/code/research_output/ - 包含所有发现的完整详细报告
HTML(麦肯锡风格 - 必须生成):
- 保存至:
[Documents folder]/research_report_[YYYYMMDD]_[topic_slug].html - 使用麦肯锡模板:mckinsey_template
- 设计原则:直角(无圆角边框)、低调企业配色(深蓝色#003d5c、灰色#f8f9fa)、超紧凑布局、信息优先结构
- 在顶部放置关键指标仪表盘(从结论中提取3-4个关键量化发现)
- 用数据表格展示密集信息
- 14px基础字体、紧凑间距、无装饰性渐变或色彩
- 归因渐变(2025): 将每个引用[N]包裹在中,并嵌套显示来源详情的提示框div
<span class="citation"> - 生成后自动在浏览器中打开
PDF(专业打印版 - 必须生成):
- 保存至:
[Documents folder]/research_report_[YYYYMMDD]_[topic_slug].pdf - 使用generating-pdf技能(通过Task工具调用通用Agent)
- 专业格式,包含页眉、页码
- 生成后自动在默认PDF查看器中打开
3. 文件命名规范:
所有文件使用相同的基础名称,便于匹配:
research_report_20251104_psilocybin_2025.mdresearch_report_20251104_psilocybin_2025.htmlresearch_report_20251104_psilocybin_2025.pdf
长度要求(通过渐进式组装支持无限制长度):
- 快速模式:2000+词(基线质量阈值)
- 标准模式:4000+词(综合分析)
- 深度模式:6000+词(彻底调查)
- 超深度模式:10000-50000+词(无上限 - 依据证据尽可能全面)
无限制长度的实现方式:
渐进式文件组装通过逐节生成支持任意长度的报告。
每个章节会立即写入文件(避免输出令牌限制)。
针对包含大量发现的复杂主题?可生成20、30、50+个发现 - 无任何限制!
内容要求:
- 严格按照模板结构生成
- 根据证据(而非字数目标)生成每个章节至合适深度
- 包含具体数据、统计信息、日期、数字(而非模糊陈述)
- 每个发现包含多个段落及证据(按需添加)
- 每个章节都需聚焦生成
- 请勿撰写摘要 - 需撰写完整分析
写作标准:
- 叙事驱动:使用流畅的散文式写法。每个发现都要讲述一个包含开头(背景)、中间(证据)、结尾(影响)的故事
- 精准:每个词都经过审慎选择,承载明确意图
- 简洁:无冗余内容,避免花哨语法和不必要的修饰词
- 清晰:句子中嵌入精确数字(例如:“研究表明死亡率降低了23%”),而非单独列在项目符号中
- 直接:清晰陈述结论,无需修饰
- 高信噪比:信息密度高,尊重读者时间
项目符号规则(防疲劳强制要求):
- 极少使用项目符号:仅用于明确的列表(产品名称、公司名单、枚举步骤)
- 绝不要用项目符号作为主要内容呈现方式 - 它们会割裂思维
- 每个结论部分需包含实质性的散文段落(至少3-5段)
- 示例:不要写“• 市场规模:24亿美元”,而要写“2023年全球市场规模达到24亿美元,受消费者需求增长和监管利好驱动[1]。”
防疲劳质量检查(适用于每个章节):
在认为章节完成前,验证以下项:
- 段落数量:主要章节(## 标题)至少3段
- 散文优先:内容中散文占比≥80%(项目符号<20%)
- 无占位符:无“内容待续”、“因篇幅限制”、“[章节X-Y]”等内容
- 证据丰富:包含具体数据点、统计信息、引述(而非模糊陈述)
- 引用密度:主要结论在同一句子中包含引用
若任何检查未通过: 在推进到下一章节前重新生成该章节。
来源归因标准(对防止伪造至关重要):
- 即时引用:每个事实性结论后需在同一句子中标注引用[N]
- 直接引用来源:对于事实性陈述,使用“根据[1]...”或“[1]报告称...”
- 区分事实与综合分析:
- ✅ 正确:“治疗组死亡率降低23%(p<0.01)[1]。”
- ❌ 错误:“研究表明死亡率显著改善。”
- 避免模糊归因:
- ❌ 绝不要:“研究表明...”、“多项研究显示...”、“专家认为...”
- ✅ 必须:“Smith等人(2024)发现...”[1]、“根据FDA数据...”[2]
- 明确标记推测内容:
- ✅ 正确:“这表明可能存在某种机制...”(分析,而非事实)
- ❌ 错误:“机制是...”(未标注引用却作为事实呈现)
- 承认不确定性:
- ✅ 正确:“未找到直接涉及X的来源。”
- ❌ 错误:编造引用来填补空白
- 模板格式:“[包含数字/数据的具体结论] [引用]。[分析/影响]。”
交付给用户的内容:
- 执行摘要(内嵌在聊天中)
- 有序文件夹路径(例如:“所有文件已保存至:/code/Psilocybin_Research_20251104/”)
- 确认已生成所有三种格式:
- Markdown(源文件)
- HTML(麦肯锡风格,已在浏览器中打开)
- PDF(专业打印版,已在查看器中打开)
- 来源质量评估摘要(来源数量)
- 后续步骤(如相关)
生成工作流:渐进式文件组装(无限制长度)
阶段8.1:设置
bash
undefinedExtract topic slug from research question
从研究问题中提取主题标识
Create folder: /code/[TopicName]Research[YYYYMMDD]/
创建文件夹:/code/[TopicName]Research[YYYYMMDD]/
mkdir -p /code/[folder_name]
mkdir -p /code/[folder_name]
Create initial markdown file with frontmatter
创建带前置内容的初始markdown文件
File path: [folder]/research_report_[YYYYMMDD]_[slug].md
文件路径:[folder]/research_report_[YYYYMMDD]_[slug].md
**Phase 8.2: Progressive Section Generation**
**CRITICAL STRATEGY:** Generate and write each section individually to file using Write/Edit tools.
This allows unlimited report length while keeping each generation manageable.
**OUTPUT TOKEN LIMIT SAFEGUARD (CRITICAL - Claude Code Default: 32K):**
Claude Code default limit: 32,000 output tokens (≈24,000 words total per skill execution)
This is a HARD LIMIT and cannot be changed within the skill.
**What this means:**
- Total output (your text + all tool call content) must be <32,000 tokens
- 32,000 tokens ≈ 24,000 words max
- Leave safety margin: Target ≤20,000 words total output
**Realistic report sizes per mode:**
- Quick mode: 2,000-4,000 words ✅ (well under limit)
- Standard mode: 4,000-8,000 words ✅ (comfortably under limit)
- Deep mode: 8,000-15,000 words ✅ (achievable with care)
- UltraDeep mode: 15,000-20,000 words ⚠️ (at limit, monitor closely)
**For reports >20,000 words:**
User must run skill multiple times:
- Run 1: "Generate Part 1 (sections 1-6)" → saves to part1.md
- Run 2: "Generate Part 2 (sections 7-12)" → saves to part2.md
- User manually combines or asks Claude to merge files
**Auto-Continuation Strategy (TRUE Unlimited Length):**
When report exceeds 18,000 words in single run:
1. Generate sections 1-10 (stay under 18K words)
2. Save continuation state file with context preservation
3. Spawn continuation agent via Task tool
4. Continuation agent: Reads state → Generates next batch → Spawns next agent if needed
5. Chain continues recursively until complete
This achieves UNLIMITED length while respecting 32K limit per agent
**Initialize Citation Tracking:**citations_used = [] # Maintain this list in working memory throughout
**Section Generation Loop:**
**Pattern:** Generate section content → Use Write/Edit tool with that content → Move to next section
Each Write/Edit call contains ONE section (≤2,000 words per call)
1. **Executive Summary** (200-400 words)
- Generate section content
- Tool: Write(file, content=frontmatter + Executive Summary)
- Track citations used
- Progress: "✓ Executive Summary"
2. **Introduction** (400-800 words)
- Generate section content
- Tool: Edit(file, old=last_line, new=old + Introduction section)
- Track citations used
- Progress: "✓ Introduction"
3. **Finding 1** (600-2,000 words)
- Generate complete finding
- Tool: Edit(file, append Finding 1)
- Track citations used
- Progress: "✓ Finding 1"
4. **Finding 2** (600-2,000 words)
- Generate complete finding
- Tool: Edit(file, append Finding 2)
- Track citations used
- Progress: "✓ Finding 2"
... Continue for ALL findings (each finding = one Edit tool call, ≤2,000 words)
**CRITICAL:** If you have 10 findings × 1,500 words each = 15,000 words of findings
This is OKAY because each Edit call is only 1,500 words (under 2,000 word limit per tool call)
The FILE grows to 15,000 words, but no single tool call exceeds limits
4. **Synthesis & Insights**
- Generate: Novel insights beyond source statements (as long as needed for synthesis)
- Tool: Edit (append to file)
- Track: Extract citations, append to citations_used
- Progress: "Generated Synthesis ✓"
5. **Limitations & Caveats**
- Generate: Counterevidence, gaps, uncertainties (appropriate depth)
- Tool: Edit (append to file)
- Track: Extract citations, append to citations_used
- Progress: "Generated Limitations ✓"
6. **Recommendations**
- Generate: Immediate actions, next steps, research needs (appropriate depth)
- Tool: Edit (append to file)
- Track: Extract citations, append to citations_used
- Progress: "Generated Recommendations ✓"
7. **Bibliography (CRITICAL - ALL Citations)**
- Generate: COMPLETE bibliography with EVERY citation from citations_used list
- Format: [1], [2], [3]... [N] - each citation gets full entry
- Verification: Check citations_used list - if list contains [1] through [73], generate all 73 entries
- NO ranges ([1-50]), NO placeholders ("Additional citations"), NO truncation
- Tool: Edit (append to file)
- Progress: "Generated Bibliography ✓ (N citations)"
8. **Methodology Appendix**
- Generate: Research process, verification approach (appropriate depth)
- Tool: Edit (append to file)
- Progress: "Generated Methodology ✓"
**Phase 8.3: Auto-Continuation Decision Point**
After generating sections, check word count:
**If total output ≤18,000 words:** Complete normally
- Generate Bibliography (all citations)
- Generate Methodology
- Verify complete report
- Save copy to /code/research_output/
- Done! ✓
**If total output will exceed 18,000 words:** Auto-Continuation Protocol
**Step 1: Save Continuation State**
Create file: `/code/research_output/continuation_state_[report_id].json`
```json
{
"version": "2.1.1",
"report_id": "[unique_id]",
"file_path": "[absolute_path_to_report.md]",
"mode": "[quick|standard|deep|ultradeep]",
"progress": {
"sections_completed": [list of section IDs done],
"total_planned_sections": [total count],
"word_count_so_far": [current word count],
"continuation_count": [which continuation this is, starts at 1]
},
"citations": {
"used": [1, 2, 3, ..., N],
"next_number": [N+1],
"bibliography_entries": [
"[1] Full citation entry",
"[2] Full citation entry",
...
]
},
"research_context": {
"research_question": "[original question]",
"key_themes": ["theme1", "theme2", "theme3"],
"main_findings_summary": [
"Finding 1: [100-word summary]",
"Finding 2: [100-word summary]",
...
],
"narrative_arc": "[Current position in story: beginning/middle/conclusion]"
},
"quality_metrics": {
"avg_words_per_finding": [calculated average],
"citation_density": [citations per 1000 words],
"prose_vs_bullets_ratio": [e.g., "85% prose"],
"writing_style": "technical-precise-data-driven"
},
"next_sections": [
{"id": N, "type": "finding", "title": "Finding X", "target_words": 1500},
{"id": N+1, "type": "synthesis", "title": "Synthesis", "target_words": 1000},
...
]
}Step 2: Spawn Continuation Agent
Use Task tool with general-purpose agent:
Task(
subagent_type="general-purpose",
description="Continue deep-research report generation",
prompt="""
CONTINUATION TASK: You are continuing an existing deep-research report.
CRITICAL INSTRUCTIONS:
1. Read continuation state file: /code/research_output/continuation_state_[report_id].json
2. Read existing report to understand context: [file_path from state]
3. Read LAST 3 completed sections to understand flow and style
4. Load research context: themes, narrative arc, writing style from state
5. Continue citation numbering from state.citations.next_number
6. Maintain quality metrics from state (avg words, citation density, prose ratio)
CONTEXT PRESERVATION:
- Research question: [from state]
- Key themes established: [from state]
- Findings so far: [summaries from state]
- Narrative position: [from state]
- Writing style: [from state]
YOUR TASK:
Generate next batch of sections (stay under 18,000 words):
[List next_sections from state]
Use Write/Edit tools to append to existing file: [file_path]
QUALITY GATES (verify before each section):
- Words per section: Within ±20% of [avg_words_per_finding]
- Citation density: Match [citation_density] ±0.5 per 1K words
- Prose ratio: Maintain ≥80% prose (not bullets)
- Theme alignment: Section ties to key_themes
- Style consistency: Match [writing_style]
After generating sections:
- If more sections remain: Update state, spawn next continuation agent
- If final sections: Generate complete bibliography, verify report, cleanup state file
HANDOFF PROTOCOL (if spawning next agent):
1. Update continuation_state.json with new progress
2. Add new citations to state
3. Add summaries of new findings to state
4. Update quality metrics
5. Spawn next agent with same instructions
"""
)Step 3: Report Continuation Status
Tell user:
📊 Report Generation: Part 1 Complete (N sections, X words)
🔄 Auto-continuing via spawned agent...
Next batch: [section list]
Progress: [X%] completePhase 8.4: Continuation Agent Quality Protocol
When continuation agent starts:
Context Loading (CRITICAL):
- Read continuation_state.json → Load ALL context
- Read existing report file → Review last 3 sections
- Extract patterns:
- Sentence structure complexity
- Technical terminology used
- Citation placement patterns
- Paragraph transition style
Pre-Generation Checklist:
- Loaded research context (themes, question, narrative arc)
- Reviewed previous sections for flow
- Loaded citation numbering (start from N+1)
- Loaded quality targets (words, density, style)
- Understand where in narrative arc (beginning/middle/end)
Per-Section Generation:
- Generate section content
- Quality checks:
- Word count: Within target ±20%
- Citation density: Matches established rate
- Prose ratio: ≥80% prose
- Theme connection: Ties to key_themes
- Style match: Consistent with quality_metrics.writing_style
- If ANY check fails: Regenerate section
- If passes: Write to file, update state
Handoff Decision:
- Calculate: Current word count + remaining sections × avg_words_per_section
- If total < 18K: Generate all remaining sections + finish
- If total > 18K: Generate partial batch, update state, spawn next agent
Final Agent Responsibilities:
- Generate final content sections
- Generate COMPLETE bibliography using ALL citations from state.citations.bibliography_entries
- Read entire assembled report
- Run validation: python scripts/validate_report.py --report [path]
- Delete continuation_state.json (cleanup)
- Report complete to user with metrics
Anti-Fatigue Built-In:
Each agent generates manageable chunks (≤18K words), maintaining quality.
Context preservation ensures coherence across continuation boundaries.
Generate HTML (McKinsey Style)
-
Read McKinsey template from
./templates/mckinsey_report_template.html -
Extract 3-4 key quantitative metrics from findings for dashboard
-
Use Python script for MD to HTML conversion:bash
cd ~/.claude/skills/deep-research python scripts/md_to_html.py [markdown_report_path]The script returns two parts:- Part A ({{CONTENT}}): All sections except Bibliography, properly converted to HTML
- Part B ({{BIBLIOGRAPHY}}): Bibliography section only, formatted as HTML
CRITICAL: The script handles ALL conversion automatically:- Headers: ## → , ### →
<div class="section"><h2 class="section-title"><h3 class="subsection-title"> - Lists: Markdown bullets → with proper nesting
<ul><li> - Tables: Markdown tables → with thead/tbody
<table> - Paragraphs: Text wrapped in tags
<p> - Bold/italic: text → , text →
<strong><em> - Citations: [N] preserved for tooltip conversion in step 4
-
Add Citation Tooltips (Attribution Gradients): For each [N] citation in {{CONTENT}} (not bibliography), optionally add interactive tooltips:html
<span class="citation">[N] <span class="citation-tooltip"> <div class="tooltip-title">[Source Title]</div> <div class="tooltip-source">[Author/Publisher]</div> <div class="tooltip-claim"> <div class="tooltip-claim-label">Supports Claim:</div> [Extract sentence with this citation] </div> </span> </span>NOTE: This step is optional for speed. Basic [N] citations are sufficient. -
Replace placeholders in template:
- {{TITLE}} - Report title (extract from first ## heading in MD)
- {{DATE}} - Generation date (YYYY-MM-DD format)
- {{SOURCE_COUNT}} - Number of unique sources
- {{METRICS_DASHBOARD}} - Metrics HTML from step 2
- {{CONTENT}} - HTML from Part A (script output)
- {{BIBLIOGRAPHY}} - HTML from Part B (script output)
-
CRITICAL: NO EMOJIS - Remove any emoji characters from final HTML
-
Save to:
[folder]/research_report_[YYYYMMDD]_[slug].html -
Verify HTML (MANDATORY):bash
python scripts/verify_html.py --html [html_path] --md [md_path]- Check passes: Proceed to step 9
- Check fails: Fix errors and re-run verification
-
Open in browser:
open [html_path]
Generate PDF
- Use Task tool with general-purpose agent
- Invoke generating-pdf skill with markdown as input
- Save to:
[folder]/research_report_[YYYYMMDD]_[slug].pdf - PDF will auto-open when complete
**阶段8.2:渐进式章节生成**
**关键策略:** 使用Write/Edit工具逐节生成并写入文件。
这支持报告无限制长度,同时保持每次生成的内容可控。
**输出令牌限制防护(CRITICAL - Claude Code默认:32K):**
Claude Code默认限制:32000个输出令牌(≈每次技能执行最多24000词)
这是硬限制,无法在技能内修改。
**这意味着:**
- 总输出(你的文本+所有工具调用内容)必须<32000令牌
- 32000令牌≈最多24000词
- 预留安全余量:目标总输出≤20000词
**各模式的实际报告规模:**
- 快速模式:2000-4000词 ✅(远低于限制)
- 标准模式:4000-8000词 ✅(轻松低于限制)
- 深度模式:8000-15000词 ✅(谨慎操作可实现)
- 超深度模式:15000-20000词 ⚠️(接近限制,需密切监控)
**对于超过20000词的报告:**
用户需多次运行本技能:
- 运行1:“生成第1部分(章节1-6)” → 保存至part1.md
- 运行2:“生成第2部分(章节7-12)” → 保存至part2.md
- 用户可手动合并,或请求Claude合并文件
**自动续期策略(真正的无限制长度):**
当单次运行中报告将超过18000词时:
1. 生成章节1-10(控制在18000词以内)
2. 保存包含上下文保留的续期状态文件
3. 通过Task工具启动续期Agent
4. 续期Agent:读取状态→生成下一批内容→若需继续则启动下一个Agent
5. 递归链式执行直至完成
这在尊重每个Agent的32K令牌限制的同时,实现了无限制长度
**初始化引用追踪:**citations_used = [] # 在整个过程中在工作内存中维护此列表
**章节生成循环:**
**模式:** 生成章节内容→使用Write/Edit工具写入内容→推进到下一章节
每个Write/Edit调用仅包含一个章节(每次调用≤2000词)
1. **执行摘要**(200-400词)
- 生成章节内容
- 工具:Write(file, content=前置内容 + 执行摘要)
- 追踪使用的引用
- 进度:“✓ 执行摘要”
2. **引言**(400-800词)
- 生成章节内容
- 工具:Edit(file, old=最后一行, new=旧内容 + 引言章节)
- 追踪使用的引用
- 进度:“✓ 引言”
3. **发现1**(600-2000词)
- 生成完整发现
- 工具:Edit(file, append 发现1)
- 追踪使用的引用
- 进度:“✓ 发现1”
4. **发现2**(600-2000词)
- 生成完整发现
- 工具:Edit(file, append 发现2)
- 追踪使用的引用
- 进度:“✓ 发现2”
... 继续生成所有发现(每个发现对应一次Edit工具调用,≤2000词)
**关键:** 若有10个发现×每个1500词=15000词的发现内容
这是可行的,因为每个Edit调用仅1500词(低于每次工具调用2000词的限制)
文件会增长到15000词,但单次工具调用不会超过限制
4. **综合与洞察**
- 生成:超越来源陈述的全新洞察(按需生成足够内容)
- 工具:Edit(追加到文件)
- 追踪:提取引用,添加至citations_used
- 进度:“生成综合内容 ✓”
5. **局限性与注意事项**
- 生成:反证、空白、不确定性(按需生成合适深度)
- 工具:Edit(追加到文件)
- 追踪:提取引用,添加至citations_used
- 进度:“生成局限性内容 ✓”
6. **建议**
- 生成:即时行动、后续步骤、研究需求(按需生成合适深度)
- 工具:Edit(追加到文件)
- 追踪:提取引用,添加至citations_used
- 进度:“生成建议内容 ✓”
7. **参考文献(CRITICAL - 所有引用)**
- 生成:包含citations_used列表中所有引用的完整参考文献
- 格式:[1], [2], [3]... [N] - 每个引用对应完整条目
- 验证:检查citations_used列表 - 若列表包含[1]至[73],则生成全部73个条目
- 不使用范围表示(如[1-50]),不使用占位符(如“其他引用”),不截断
- 工具:Edit(追加到文件)
- 进度:“生成参考文献 ✓(共N个引用)”
8. **方法论附录**
- 生成:研究流程、验证方法(按需生成合适深度)
- 工具:Edit(追加到文件)
- 进度:“生成方法论 ✓”
**阶段8.3:自动续期决策点**
生成章节后,检查字数:
**若总输出≤18000词:** 正常完成
- 生成参考文献(所有引用)
- 生成方法论
- 验证完整报告
- 保存副本至/code/research_output/
- 完成! ✓
**若总输出将超过18000词:** 自动续期协议
**步骤1:保存续期状态**
创建文件:`/code/research_output/continuation_state_[report_id].json`
```json
{
"version": "2.1.1",
"report_id": "[unique_id]",
"file_path": "[report.md的绝对路径]",
"mode": "[quick|standard|deep|ultradeep]",
"progress": {
"sections_completed": [已完成的章节ID列表],
"total_planned_sections": [总章节数],
"word_count_so_far": [当前字数],
"continuation_count": [续期次数,从1开始]
},
"citations": {
"used": [1, 2, 3, ..., N],
"next_number": [N+1],
"bibliography_entries": [
"[1] 完整引用条目",
"[2] 完整引用条目",
...
]
},
"research_context": {
"research_question": "[原始问题]",
"key_themes": ["主题1", "主题2", "主题3"],
"main_findings_summary": [
"发现1:[100词摘要]",
"发现2:[100词摘要]",
...
],
"narrative_arc": "[当前叙事位置:开头/中间/结尾]"
},
"quality_metrics": {
"avg_words_per_finding": [计算出的平均值],
"citation_density": [每1000词的引用数],
"prose_vs_bullets_ratio": [例如:"85%散文"],
"writing_style": "technical-precise-data-driven"
},
"next_sections": [
{"id": N, "type": "finding", "title": "发现X", "target_words": 1500},
{"id": N+1, "type": "synthesis", "title": "综合分析", "target_words": 1000},
...
]
}步骤2:启动续期Agent
使用Task工具调用通用Agent:
Task(
subagent_type="general-purpose",
description="继续深度研究报告生成",
prompt="""
续期任务:你需要继续一份已有的深度研究报告。
关键指令:
1. 读取续期状态文件:/code/research_output/continuation_state_[report_id].json
2. 读取现有报告以了解上下文:[状态中的file_path]
3. 读取最后3个已完成章节以了解行文风格和流程
4. 加载研究上下文:状态中的主题、叙事线、写作风格
5. 从state.citations.next_number开始继续引用编号
6. 保持状态中的质量指标(平均字数、引用密度、散文占比)
上下文保留:
- 研究问题:[来自状态]
- 已确立的关键主题:[来自状态]
- 已完成的发现:[来自状态的摘要]
- 叙事位置:[来自状态]
- 写作风格:[来自状态]
你的任务:
生成下一批章节(控制在18000词以内):
[来自状态的next_sections列表]
使用Write/Edit工具追加到现有文件:[file_path]
质量关卡(每个章节生成前验证):
- 章节字数:在[avg_words_per_finding]的±20%范围内
- 引用密度:与[citation_density]匹配,误差±0.5每1000词
- 散文占比:保持≥80%散文(而非项目符号)
- 主题对齐:章节需关联关键主题
- 风格一致:匹配[writing_style]
生成章节后:
- 若还有剩余章节:更新状态,启动下一个续期Agent
- 若为最后章节:生成完整参考文献,验证报告,清理状态文件
交接协议(若启动下一个Agent):
1. 更新continuation_state.json中的新进度
2. 将新引用添加到状态中
3. 将新发现的摘要添加到状态中
4. 更新质量指标
5. 使用相同指令启动下一个Agent
"""
)步骤3:向用户报告续期状态
告知用户:
📊 报告生成:第1部分完成(共N个章节,X词)
🔄 正在通过启动的Agent自动续期...
下一批:[章节列表]
进度:[X%] 完成阶段8.4:续期Agent质量协议
当续期Agent启动时:
上下文加载(CRITICAL):
- 读取continuation_state.json → 加载所有上下文
- 读取现有报告文件 → 查看最后3个章节
- 提取模式:
- 句子结构复杂度
- 使用的技术术语
- 引用放置模式
- 段落过渡风格
生成前检查清单:
- 已加载研究上下文(主题、问题、叙事线)
- 已查看之前的章节以保持流程连贯
- 已加载引用编号(从N+1开始)
- 已加载质量目标(字数、密度、风格)
- 了解当前叙事位置(开头/中间/结尾)
逐章节生成:
- 生成章节内容
- 质量检查:
- 字数:在目标值的±20%范围内
- 引用密度:与既定比率匹配
- 散文占比:≥80%散文
- 主题关联:章节与关键主题相关
- 风格匹配:与quality_metrics.writing_style一致
- 若任何检查未通过:重新生成章节
- 若通过:写入文件,更新状态
交接决策:
- 计算:当前字数 + 剩余章节数 × 平均每章节字数
- 若总字数<18000:生成所有剩余章节并完成
- 若总字数>18000:生成部分批次,更新状态,启动下一个Agent
最终Agent职责:
- 生成最终内容章节
- 使用state.citations.bibliography_entries中的所有引用生成完整参考文献
- 读取整个组装好的报告
- 运行验证:python scripts/validate_report.py --report [path]
- 删除continuation_state.json(清理)
- 向用户报告完成情况及指标
内置防疲劳机制:
每个Agent生成可控的内容块(≤18000词),保持质量。
上下文保留确保续期边界处的连贯性。
生成HTML(麦肯锡风格)
-
从读取麦肯锡模板
./templates/mckinsey_report_template.html -
从发现中提取3-4个关键量化指标用于仪表盘
-
使用Python脚本进行MD到HTML转换:bash
cd ~/.claude/skills/deep-research python scripts/md_to_html.py [markdown_report_path]脚本返回两部分:- Part A ({{CONTENT}}): 除参考文献外的所有章节,已正确转换为HTML
- Part B ({{BIBLIOGRAPHY}}): 仅参考文献章节,已格式化为HTML
关键: 脚本自动处理所有转换:- 标题:## → , ### →
<div class="section"><h2 class="section-title"><h3 class="subsection-title"> - 列表:Markdown项目符号 → 并支持嵌套
<ul><li> - 表格:Markdown表格 → 包含thead/tbody
<table> - 段落:文本包裹在标签中
<p> - 粗体/斜体:文本 → , 文本 →
<strong><em> - 引用:保留[N]以便在步骤4中转换为提示框
-
添加引用提示框(归因渐变): 对于{{CONTENT}}中的每个[N]引用(非参考文献),可选择性添加交互式提示框:html
<span class="citation">[N] <span class="citation-tooltip"> <div class="tooltip-title">[来源标题]</div> <div class="tooltip-source">[作者/出版商]</div> <div class="tooltip-claim"> <div class="tooltip-claim-label">支持结论:</div> [包含此引用的句子] </div> </span> </span>注意:此步骤为可选,以提升速度。仅保留基础[N]引用即可。 -
替换模板中的占位符:
- {{TITLE}} - 报告标题(从MD的第一个##标题中提取)
- {{DATE}} - 生成日期(YYYY-MM-DD格式)
- {{SOURCE_COUNT}} - 唯一来源数量
- {{METRICS_DASHBOARD}} - 步骤2中的指标HTML
- {{CONTENT}} - 脚本输出的Part A
- {{BIBLIOGRAPHY}} - 脚本输出的Part B
-
关键:禁止使用表情符号 - 从最终HTML中移除所有表情符号字符
-
保存至:
[folder]/research_report_[YYYYMMDD]_[slug].html -
验证HTML(必须执行):bash
python scripts/verify_html.py --html [html_path] --md [md_path]- 检查通过:推进到步骤9
- 检查失败:修复错误并重新运行验证
-
在浏览器中打开:
open [html_path]
生成PDF
- 使用Task工具调用通用Agent
- 以markdown为输入调用generating-pdf技能
- 保存至:
[folder]/research_report_[YYYYMMDD]_[slug].pdf - PDF生成后会自动打开
Output Contract
输出契约
Format: Comprehensive markdown report following template EXACTLY
Required sections (all must be detailed):
- Executive Summary (2-3 concise paragraphs, 50-250 words)
- Introduction (2-3 paragraphs: question, scope, methodology, assumptions)
- Main Analysis (4-8 findings, each 300-500 words with citations [1], [2], [3])
- Synthesis & Insights (500-1000 words: patterns, novel insights, implications)
- Limitations & Caveats (2-3 paragraphs: gaps, assumptions, uncertainties)
- Recommendations (3-5 immediate actions, 3-5 next steps, 3-5 further research)
- Bibliography (CRITICAL - see rules below)
- Methodology Appendix (2-3 paragraphs: process, sources, verification)
Bibliography Requirements (ZERO TOLERANCE - Report is UNUSABLE without complete bibliography):
- ✅ MUST include EVERY citation [N] used in report body (if report has [1]-[50], write all 50 entries)
- ✅ Format: [N] Author/Org (Year). "Title". Publication. URL (Retrieved: Date)
- ✅ Each entry on its own line, complete with all metadata
- ❌ NO placeholders: NEVER use "[8-75] Additional citations", "...continue...", "etc.", "[Continue with sources...]"
- ❌ NO ranges: Write [3], [4], [5]... individually, NOT "[3-50]"
- ❌ NO truncation: If 30 sources cited, write all 30 entries in full
- ⚠️ Validation WILL FAIL if bibliography contains placeholders or missing citations
- ⚠️ Report is GARBAGE without complete bibliography - no way to verify claims
Strictly Prohibited:
- Placeholder text (TBD, TODO, [citation needed])
- Uncited major claims
- Broken links
- Missing required sections
- Short summaries instead of detailed analysis
- Vague statements without specific evidence
Writing Standards (Critical):
- Narrative-driven: Write in flowing prose with complete sentences that build understanding progressively
- Precision: Choose each word deliberately - every word must carry intention
- Economy: Eliminate fluff, unnecessary adjectives, fancy grammar
- Clarity: Use precise technical terms, avoid ambiguity. Embed exact numbers in sentences, not bullets
- Directness: State findings clearly without embellishment
- Signal-to-noise: High information density, respect reader's time
- Bullet discipline: Use bullets only for distinct lists (products, companies, steps). Default to prose paragraphs
- Examples of precision:
- Bad: "significantly improved outcomes" → Good: "reduced mortality 23% (p<0.01)"
- Bad: "several studies suggest" → Good: "5 RCTs (n=1,847) show"
- Bad: "potentially beneficial" → Good: "increased biomarker X by 15%"
- Bad: "• Market: $2.4B" → Good: "The market reached $2.4 billion in 2023, driven by consumer demand [1]."
Quality gates (enforced by validator):
- Minimum 2,000 words (standard mode)
- Average credibility score >60/100
- 3+ sources per major claim
- Clear facts vs. analysis distinction
- All sections present and detailed
格式: 严格遵循模板的综合markdown报告
必填章节(均需详细撰写):
- 执行摘要(2-3段简洁段落,50-250词)
- 引言(2-3段:问题、范围、方法论、假设)
- 主要分析(4-8个发现,每个300-500词并包含引用[1], [2], [3])
- 综合与洞察(500-1000词:模式、全新洞察、影响)
- 局限性与注意事项(2-3段:空白、假设、不确定性)
- 建议(3-5个即时行动、3-5个后续步骤、3-5个进一步研究方向)
- 参考文献(CRITICAL - 见以下规则)
- 方法论附录(2-3段:流程、来源、验证)
参考文献要求(零容忍 - 无完整参考文献的报告不可用):
- ✅ 必须包含报告正文中使用的每个引用[N](若报告包含[1]-[50],则需撰写全部50个条目)
- ✅ 格式:[N] 作者/组织(年份)。“标题”。出版物。URL(检索日期:日期)
- ✅ 每个条目单独一行,包含所有元数据
- ❌ 无占位符:绝不要使用“[8-75] 其他引用”、“...续...”、“等”、“[其余来源...]”
- ❌ 不使用范围表示:单独撰写[3], [4], [5]...,而非“[3-50]”
- ❌ 不截断:若引用了30个来源,则需完整撰写全部30个条目
- ⚠️ 若参考文献包含占位符或缺失引用,验证将失败
- ⚠️ 无完整参考文献的报告毫无价值 - 无法验证结论
严格禁止:
- 占位符文本(TBD、TODO、[需引用])
- 无引用的主要结论
- 失效链接
- 缺失必填章节
- 用简短摘要替代详细分析
- 无具体证据的模糊陈述
写作标准(关键):
- 叙事驱动:使用流畅的散文式完整句子,逐步构建理解
- 精准:审慎选择每个词 - 每个词都必须承载明确意图
- 简洁:删除冗余内容、不必要的形容词和花哨语法
- 清晰:使用精确的技术术语,避免歧义。将精确数字嵌入句子,而非项目符号
- 直接:清晰陈述结论,无需修饰
- 高信噪比:信息密度高,尊重读者时间
- 项目符号规范:仅用于明确的列表(产品、公司、步骤)。默认使用散文段落
- 精准示例:
- 错误:“显著改善结果” → 正确:“死亡率降低23%(p<0.01)”
- 错误:“多项研究表明” → 正确:“5项随机对照试验(样本量n=1847)显示”
- 错误:“可能有益” → 正确:“生物标志物X提升15%”
- 错误:“• 市场:24亿美元” → 正确:“2023年市场规模达到24亿美元,受消费者需求驱动[1]。”
质量关卡(由验证器强制执行):
- 标准模式最少2000词
- 平均可信度得分>60/100
- 每个主要结论至少3个来源
- 明确区分事实与分析
- 所有章节齐全且详细
Error Handling & Stop Rules
错误处理与停止规则
Stop immediately if:
- 2 validation failures on same error → Pause, report, ask user
- <5 sources after exhaustive search → Report limitation, request direction
- User interrupts/changes scope → Confirm new direction
Graceful degradation:
- 5-10 sources → Note in limitations, proceed with extra verification
- Time constraint reached → Package partial results, document gaps
- High-priority critique issue → Address immediately
Error format:
⚠️ Issue: [Description]
📊 Context: [What was attempted]
🔍 Tried: [Resolution attempts]
💡 Options:
1. [Option 1]
2. [Option 2]
3. [Option 3]立即停止的场景:
- 同一错误连续2次验证失败 → 暂停,报告问题,询问用户
- 穷尽搜索后仍<5个来源 → 报告局限性,请求指导
- 用户中断/变更范围 → 确认新方向
优雅降级:
- 5-10个来源 → 在局限性中说明,加强验证后推进
- 达到时间限制 → 打包部分结果,记录空白
- 高优先级批判问题 → 立即处理
错误格式:
⚠️ 问题:[描述]
📊 上下文:[尝试的操作]
🔍 已尝试:[解决尝试]
💡 选项:
1. [选项1]
2. [选项2]
3. [选项3]Quality Standards (Always Enforce)
质量标准(始终强制执行)
Every report must:
- 10+ sources (document if fewer)
- 3+ sources per major claim
- Executive summary <250 words
- Full citations with URLs
- Credibility assessment
- Limitations section
- Methodology documented
- No placeholders
Priority: Thoroughness over speed. Quality > speed.
每份报告必须:
- 10+个来源(若不足则记录)
- 每个主要结论至少3个来源
- 执行摘要<250词
- 包含带URL的完整引用
- 可信度评估
- 局限性章节
- 方法论文档
- 无占位符
优先级: 彻底性优先于速度。质量>速度。
Inputs & Assumptions
输入与假设
Required:
- Research question (string)
Optional:
- Mode (quick/standard/deep/ultradeep)
- Time constraints
- Required perspectives/sources
- Output format
Assumptions:
- User requires verified, citation-backed information
- 10-50 sources available on topic
- Time investment: 5-45 minutes
必填:
- 研究问题(字符串)
可选:
- 模式(quick/standard/deep/ultradeep)
- 时间限制
- 所需视角/来源
- 输出格式
假设:
- 用户需要经过验证、带引用的信息
- 主题存在10-50个来源
- 时间投入:5-45分钟
When to Use / NOT Use
使用场景
Use when:
- Comprehensive analysis (10+ sources needed)
- Comparing technologies/approaches/strategies
- State-of-the-art reviews
- Multi-perspective investigation
- Technical decisions
- Market/trend analysis
Do NOT use:
- Simple lookups (use WebSearch)
- Debugging (use standard tools)
- 1-2 search answers
- Time-sensitive quick answers
适用场景:
- 综合分析(需要10个以上来源)
- 技术/方案/策略对比
- 前沿综述
- 多视角调查
- 技术决策
- 市场/趋势分析
不适用场景:
- 简单查询(使用WebSearch)
- 调试(使用标准工具)
- 1-2次搜索即可解答的问题
- 时间敏感的快速答案
Scripts (Offline, Python stdlib only)
脚本(离线,仅使用Python标准库)
Location:
./scripts/- research_engine.py - Orchestration engine
- validate_report.py - Quality validation (8 checks)
- citation_manager.py - Citation tracking
- source_evaluator.py - Credibility scoring (0-100)
No external dependencies required.
位置:
./scripts/- research_engine.py - 编排引擎
- validate_report.py - 质量验证(8项检查)
- citation_manager.py - 引用追踪
- source_evaluator.py - 可信度评分(0-100)
无需外部依赖。
Progressive References (Load On-Demand)
渐进式参考资料(按需加载)
Do not inline these - reference only:
- Complete Methodology - 8-phase details
- Report Template - Output structure
- README - Usage docs
- Quick Start - Fast reference
- Competitive Analysis - vs OpenAI/Gemini
Context Management: Load files on-demand for current phase only. Do not preload all content.
<!-- STATIC CONTEXT BLOCK END --> <!-- ⚡ Above content is cacheable (>1024 tokens, static) --> <!-- 📝 Below: Dynamic content (user queries, retrieved data, generated reports) --> <!-- This structure enables 85% latency reduction via prompt caching -->
请勿内联这些内容 - 仅引用:
- 完整方法论 - 8阶段详情
- 报告模板 - 输出结构
- README - 使用文档
- 快速入门 - 快速参考
- 竞品分析 - 与OpenAI/Gemini对比
上下文管理: 仅按需加载当前阶段所需的文件。请勿预加载所有内容。
<!-- STATIC CONTEXT BLOCK END --> <!-- ⚡ 以上内容可缓存(>1024令牌,静态) --> <!-- 📝 以下:动态内容(用户查询、检索数据、生成的报告) --> <!-- 此结构通过提示词缓存实现85%的延迟降低 -->
Dynamic Execution Zone
动态执行区域
User Query Processing:
[User research question will be inserted here during execution]
Retrieved Information:
[Search results and sources will be accumulated here]
Generated Analysis:
[Findings, synthesis, and report content generated here]
Note: This section remains empty in the skill definition. Content populated during runtime only.
用户查询处理:
[执行时将在此插入用户研究问题]
检索到的信息:
[搜索结果和来源将在此累积]
生成的分析:
[发现、综合内容和报告内容将在此生成]
注意: 此区域在技能定义中为空。仅在运行时填充内容。