Research

From Lambenthan/empiricalwiki · View interactive version

Research is an AI agent skill from the GitHub repository Lambenthan/empiricalwiki. 端到端研究编排器:idea 发现 → 实验设计 → 执行 → 判决 → 论文撰写,带人工门控和状态恢复

How to use this skill

Skill file

/research

端到端研究编排器,将所有 skill 组合为完整的研究流程。

Stage 0 (Bootstrap) + 5 个 Stage + 2 个 Human Gate,覆盖从空 wiki 到论文提交的全流程。

零摩擦入口:wiki 为空时自动触发 Bootstrap(搜索 + auto-ingest 5 篇论文),无需手动 /init。

每个 Gate 和 Stage 保存进度到 wiki/outputs/pipeline-progress.md,支持跨 session 恢复。

Stage 3 为非阻塞设计:实验部署后立即返回(--auto 模式自动设置 CronCreate 每 30 分钟监控),

实验全部完成后自动进入 Stage 4。可随时用 /exp-status 查看进度。

--auto 模式跳过人工确认(自动选 top-1 idea),--skip-paper 只做研究不写论文。

Inputs

Outputs

Wiki Interaction

Reads

Writes

Graph edges created

Workflow

前置:

  1. 确认工作目录为 wiki 项目根(包含 wiki/、raw/、tools/ 的目录)
  2. 若 --start-from 指定,读取 wiki/outputs/pipeline-progress.md 恢复状态

Step 0: 初始化

  1. 解析输入:
  1. 自动恢复检测(无 --start-from 时):

```

检测到未完成的 pipeline:

方向: {direction}

当前阶段: {current_stage}

开始时间: {started}

[1] 从 {current_stage} 继续(推荐)

[2] 开始新的 pipeline(将覆盖旧进度)

[3] 先查看实验状态(/exp-status --pipeline {slug})

```

  1. 检查恢复(有 --start-from 时):
  1. 创建进度文件 wiki/outputs/pipeline-progress.md:

```yaml


slug: "{pipeline-slug}"

direction: "{research direction}"

status: running

current_stage: stage1

started: YYYY-MM-DD

mode: auto|interactive

skip_paper: true|false

venue: "{venue}"

idea_slug: ""

experiment_slugs: []

stage3a_deployed: []

claim_slugs: []

iteration_count: 0


## Stage Log

```

  1. 追加日志:

```bash

python3 tools/research_wiki.py log wiki/ \

"research | started | direction: {direction} | mode: {auto|interactive}"

```

  1. Snapshot wiki 状态(用于 Step Final 的 Growth Report):

```bash

python3 tools/research_wiki.py maturity wiki/ --json

```

保存返回的 JSON 到内存变量 maturity_before。

Stage 0: Bootstrap(wiki 为空时自动触发)

触发条件:运行 python3 tools/research_wiki.py maturity wiki/ --json,若 level == "cold" 且 papers < 3:自动进入 Bootstrap。否则跳过,直接进入 Stage 1。

  1. 初始化 wiki 结构(若未初始化):

```bash

python3 tools/research_wiki.py init wiki/

```

  1. 搜索相关论文(使用 Agent tool 并行 3 路搜索):
  1. 合并排名 & 选取 top 5:
  1. 逐一 auto-ingest:

```

Skill: ingest

Args: "{arxiv_url_or_path}"

```

每篇 ingest 后输出进度:[{i}/5] Ingested: {paper_title}

  1. 重建派生数据:

```bash

python3 tools/research_wiki.py rebuild-context-brief wiki/

python3 tools/research_wiki.py rebuild-open-questions wiki/

```

  1. Bootstrap 报告:

```bash

python3 tools/research_wiki.py maturity wiki/ --json

```

输出到终端:

```

Bootstrap 完成:

Papers: {N} | Claims: {M} | Concepts: {K} | Edges: {E}

Maturity: cold → {new_level}

继续进入 Stage 1: Idea Discovery...

```

  1. 日志 + 进度更新:

```bash

python3 tools/research_wiki.py log wiki/ \

"research | stage0-bootstrap | auto-ingested {N} papers | maturity: {level}"

python3 tools/research_wiki.py set-meta \

wiki/outputs/pipeline-progress.md current_stage stage1

```

Stage 1: Idea Discovery

调用 /ideate:

Skill: ideate
Args: "{direction}" --domain {domain}

完成后:

  1. 读取生成的 ideas,按 priority 排序
  2. 更新 pipeline-progress:Stage 1 → completed,记录生成的 idea slugs
  3. 追加日志

Gate 1: 选择 Idea

若 --auto 模式:

若交互模式:

保存进度:

Stage 2: Experiment Design

调用 /exp-design:

Skill: exp-design
Args: "{idea_slug}" --review

完成后:

  1. 读取生成的 experiment slugs(从 wiki/experiments/ 中 linked_idea == idea_slug 的页面)
  2. 更新 pipeline-progress:Stage 2 → completed,记录 experiment_slugs

Stage 3: Experiment Execution(非阻塞)

Stage 3 分为三个子阶段,允许实验在后台异步运行,不阻塞 session。

Stage 3a: Deploy All

按 run order(baseline → validation → ablation → robustness)依次调用 /exp-run {experiment_slug}(默认 deploy 模式,Phase 1+2):

Skill: exp-run
Args: "{experiment_slug}"

(默认 deploy 模式,Phase 1+2,部署后立即返回,不等待实验完成)

每次部署后:

全部部署完成后,更新 pipeline-progress.md:

python3 tools/research_wiki.py set-meta \
  wiki/outputs/pipeline-progress.md current_stage stage3-await
python3 tools/research_wiki.py set-meta \
  wiki/outputs/pipeline-progress.md stage3a_deployed \
  "[{experiment_slug_1}, {experiment_slug_2}, ...]"

追加日志:

python3 tools/research_wiki.py log wiki/ \
  "research | stage3a | deployed {N} experiments | pipeline: {slug}"
Stage 3b: Await(非阻塞)

实验部署完毕后,计算 ETA、保存进度并结束当前 session。

  1. 更新 pipeline-progress:

```bash

python3 tools/research_wiki.py set-meta \

wiki/outputs/pipeline-progress.md current_stage stage3-await

```

  1. 计算各实验预计完成时间:

对每个已部署实验,读取 frontmatter 的 started 和 estimated_hours 字段:

  1. 追加日志:

```bash

python3 tools/research_wiki.py log wiki/ \

"research | stage3b | awaiting {N} experiments | latest eta: {YYYY-MM-DD HH:MM} | pipeline: {slug}"

```

  1. 输出操作指引后结束当前 session:

```

✅ Stage 3a 完成:{N} 个实验已全部部署:

实验 环境 预计时长 预计完成

──────────────────────────── ──────────── ──────── ──────────────

exp-foo-baseline local ~8h 明天 09:30

exp-foo-validation remote (gpu1) ~6h 今天 23:00

exp-foo-ablation local ~4h 今天 21:00

⏳ 最晚完成:明天 09:30(exp-foo-baseline)

建议 明天 10:00 之后运行:

/exp-status ← 确认所有实验完成

/research --start-from stage3-collect ← 收集结果并继续

进度已保存至 wiki/outputs/pipeline-progress.md,当前 session 可以关闭。

```

Stage 3c: Collect(实验完成后触发)

触发条件:用户手动运行 /research --start-from stage3-collect

对每个已部署的 experiment(从 stage3a_deployed 列表读取):

Skill: exp-run
Args: "{experiment_slug} --collect"

(collect 模式,Phase 3+4:检查完成状态并收集结果)

每次 collect 后的决策:

全部 collect 完成后:

```bash

python3 tools/research_wiki.py set-meta \

wiki/outputs/pipeline-progress.md current_stage stage4

```

```bash

python3 tools/research_wiki.py log wiki/ \

"research | stage3c | collected {N} experiments | pipeline: {slug}"

```

Stage 4: Verdict & Iteration

对每个 completed experiment 调用 /exp-eval:

Skill: exp-eval
Args: "{experiment_slug}" --auto

评估 claims 是否充分:

  1. 读取所有 target claims 的最新状态
  2. 判断是否需要迭代:

迭代路径(claims 不足时,最多 1 次重试):

  1. 分析失败原因
  2. 调用 /refine 改进 experiment plan:

```

Skill: refine

Args: "{experiment_plan_slug}" --max-rounds 2 --focus evidence

```

  1. 对新增/修改的 experiments 重新执行 Stage 3 → Stage 4
  2. 最多迭代 2 轮(防止无限循环),每个 stage 最多 1 次 auto retry

完成后:

Gate 2: 确认 Paper Ready

若 --skip-paper:跳过 Gate 2 和 Stage 5,直接生成最终报告

若 --auto 模式:自动继续,进入 Stage 5

若交互模式:

```

Claim: {slug} | Status: {status} | Confidence: {confidence}

Evidence: {count} sources ({strong}/{moderate}/{weak})

```

保存进度:

Stage 5: Paper Writing

依次调用子 skills:/paper-plan → /paper-draft → /refine → /paper-compile

5a. 调用 /paper-plan:

Skill: paper-plan
Args: "{claim_slugs}" --venue {venue}

5b. 调用 /paper-draft:

Skill: paper-draft
Args: "wiki/outputs/PAPER_PLAN.md" --review

5c. 调用 /refine on Paper:

Skill: refine
Args: "paper/main.tex" --max-rounds 3 --target-score 8 --focus writing

5d. 调用 /paper-compile:

Skill: paper-compile
Args: "paper/"

完成后:

Step Final: Pipeline Report

生成 wiki/outputs/PIPELINE_REPORT.md:

# Research Pipeline Report

## Stage Summary
| Stage | Status | Duration |
|-------|--------|----------|
| Stage 0: Bootstrap | completed/skipped | ... |
| Stage 1: Idea Discovery | completed | ... |
| Gate 1: Idea Selection | passed | ... |
| Stage 2: Experiment Design | completed | ... |
| Stage 3a: Deploy Experiments | completed | ... |
| Stage 3b: Await (async) | completed | ... |
| Stage 3c: Collect Results | completed | ... |
| Stage 4: Verdict | completed | ... |
| Gate 2: Paper Ready | passed | ... |
| Stage 5: Paper Writing | completed | ... |

## Selected Idea
- **Idea**: [[{idea_slug}]] — {idea title}
- **Priority**: {N}
- **Novelty score**: {score}

## Claims Trail
| Claim | Initial Status | Final Status | Confidence (proposed → supported) |
|-------|---------------|-------------|-----------------------------------|
| [[{slug}]] | proposed | supported | 0.3 → 0.8 |

## Experiment Results
| Experiment | Outcome | Key Result |
|-----------|---------|------------|
| [[{slug}]] | succeeded | {result} |

## Iteration History
- Total iterations: {N}
- Reason for iteration: {claims insufficient / ...}

## Deliverables
- Ideas: +{N} created
- Experiments: +{N} created, {N} completed
- Claims: {N} updated
- Graph edges: +{N}
- Paper: paper/main.pdf (if applicable)

## Wiki Growth (pipeline total)
| Metric | Before | After | Delta |
|--------|--------|-------|-------|
| Papers | {N} | {N} | +{N} |
| Claims | {N} | {N} | +{N} |
| Ideas | {N} | {N} | +{N} |
| Experiments | {N} | {N} | +{N} |
| Edges | {N} | {N} | +{N} |
| Maturity | {level} | {level} | {status} |
| Coverage | {%} | {%} | +{%} |
(数据来自 Step 0 step 5 的 `maturity_before` 与此处重新调用 `maturity --json` 的对比。仅展示 delta != 0 的行。)

## Next Steps
- {recommendations based on remaining gaps or unresolved issues}

追加日志:

python3 tools/research_wiki.py log wiki/ \
  "research | completed | idea: {slug} | claims: {N} updated | paper: {yes/no}"

更新 pipeline-progress:status: completed

Constraints

Error Handling

Dependencies

Skills(via Skill tool)

Tools(via Bash)

MCP Servers

Claude Code Native

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.