Exp design

From Chanw-research/claude-code-paper-writing · View interactive version

Exp design is an AI agent skill from the GitHub repository Chanw-research/claude-code-paper-writing. Claim-driven 实验设计:界定目标 claims → 设计实验块(baseline/validation/ablation/robustness)→ 构建执行顺序 → 可选 Review LLM review → 写入 wiki

How to use this skill

Skill file

/exp-design

根据一个 idea(或自由文本假设),设计完整的实验计划。

以 claims 为核心:从 Target / Decomposition / Threats 三个维度界定要验证的 claims,

设计 baseline(基线复现)、validation(核心验证)、ablation(因素隔离)、robustness(鲁棒性)四种实验块。

实验按依赖关系排序,阶段间设决策门(sanity fail → 提前停止)。

可选 Review LLM review 检查实验完整性。所有实验写入 wiki/experiments/ 并添加 graph edges。

Inputs

Outputs

Wiki Interaction

Reads

Writes

Graph edges created

Workflow

前置:确认工作目录为 wiki 项目根(包含 wiki/、raw/、tools/ 的目录)。

Step 1: 加载上下文

  1. 解析 idea 输入:
  1. 加载相关 wiki 上下文:
  1. 若 idea 无 origin_gaps:从假设描述中提取隐含的 claims,在 wiki/claims/ 中查找或标注需要新建

Step 2: 界定 Claims(Scope Claims)

从三个维度界定本次实验计划涉及的 claims。对于每个维度,先在 wiki/claims/ 中查找已有 claim;若不存在,创建新 claim(status: proposed, confidence: 0.3)。

  1. Target(验证什么):
  1. Decomposition(拆解什么):
  1. Threats(什么会推翻我们):

输出:界定的 claims 清单(slug 列表 + 维度标注 + 每个 claim 的当前 status/confidence)

Step 3: 设计实验块(Design Experiment Blocks)

为每个界定的 claim 设计实验块,4 种类型:

A. Baseline 实验(基线复现):

B. Validation 实验(验证 Target claim):

C. Ablation 实验(验证 Decomposition claims):

D. Robustness 实验(排除 Threats):

每个实验块包含:

Step 4: 构建执行顺序(Build Run Order)

按依赖关系排序实验,设置决策门:

Stage 0: Sanity check
  └── 小规模运行(1 epoch / 100 steps)验证代码无 bug、数据可加载、GPU 可用
  └── 门:若 sanity 失败 → 停止,修复代码

Stage 1: Baseline(基线复现)
  └── 复现基线结果
  └── 门:若基线偏差 > 5% → 停止,检查实现(与 Step 3 成功标准同阈值)

Stage 2: Validation(核心验证)
  └── 在基线之上验证核心方法
  └── 门:若无提升 → 停止,分析原因(可能是 idea 不成立)

Stage 3: Ablation(因素隔离)
  └── 可并行执行多个 ablation
  └── 门:若某因素 ablation 无影响 → 记录,但继续其他 ablation

Stage 4: Robustness(鲁棒性验证)
  └── 仅在 Stage 2 成功后执行
  └── 范围由 --budget 剩余额度决定

输出:

Step 5: 可选 Review LLM Review(--review)

若指定 --review:

mcp__llm-review__chat:
  system: "You are a senior ML researcher reviewing an experiment plan.
           Focus on: missing baselines, missing ablations, unfair comparisons,
           statistical rigor (enough seeds?), and dataset selection.
           For every issue found, suggest a concrete fix."
  message: |
    ## Experiment Plan
    {complete experiment plan: claims, blocks, run order, budgets}

    ## Context
    {target claims with current status, related papers' experiment setups}

    ## Review Questions
    1. Are any critical experiments missing?
    2. Are the baselines fair and comprehensive?
    3. Is the ablation design sufficient to isolate each contribution?
    4. Are the success criteria well-defined and reasonable?
    5. Any statistical concerns (sample size, variance, seeds)?

根据 Review LLM 反馈调整实验计划(添加遗漏的实验、修正不合理的标准)。

Step 6: 写入 Wiki

  1. 创建实验页面:

对每个实验块:

```bash

python3 tools/research_wiki.py slug "<experiment-title>"

```

创建 wiki/experiments/{slug}.md:

```yaml

创建 wiki/experiments/{slug}.md,严格遵循 CLAUDE.md experiments template —— 下方所有字段都必须存在(即使为空),因为 /exp-run 稍后会用 tools/research_wiki.py set-meta 来更新它们,而 set-meta 拒绝创建 frontmatter 中不存在的字段(它只更新已存在的 key):

```yaml


title: ""

slug: ""

status: planned

target_claim: "" # claim slug

hypothesis: ""

tags: []

domain: ""

setup:

model: ""

dataset: ""

hardware: ""

framework: ""

metrics: []

baseline: ""

outcome: "" # 留空,由 /exp-run Phase 4 填写 — succeeded | failed | inconclusive

key_result: "" # 留空,由 /exp-run Phase 4 填写

linked_idea: "{idea-slug}" # 必填:源 idea slug(与 wiki/ideas/{idea-slug}.md 的 linked_experiments 互为双向链接)

date_planned: YYYY-MM-DD

date_completed: "" # 留空,由 /exp-run Phase 4 填写

run_log: "" # 留空,由 /exp-run Phase 2 填写

started: "" # 留空,由 /exp-run Phase 2 填写(ISO 时间戳,通过 set-meta)

estimated_hours: 0 # 0,由 /exp-run Phase 2 更新(通过 set-meta)

remote: # 完整 block 必须存在,以便 /exp-run --env remote 通过 Edit 填充子字段

server: ""

gpu: ""

session: ""

started: ""

completed: ""


## Objective

{what this experiment proves}

## Setup

{detailed setup: model, dataset, hardware, hyperparameters}

## Procedure

{step-by-step execution plan}

## Results

(to be filled after /exp-run)

## Analysis

(to be filled after /exp-run)

## Claim updates

(to be filled after /exp-eval)

## Follow-up

{contingency plans: what to do if success / failure}

```

  1. 创建新 claims(若 Step 2 中发现缺失的 claims):

```bash

python3 tools/research_wiki.py slug "<claim-title>"

```

创建 wiki/claims/{slug}.md(status: proposed, confidence: 0.3)

  1. 添加 graph edges:

```bash

# 对每个实验 → 目标 claim

python3 tools/research_wiki.py add-edge wiki/ \

--from "claims/{target-claim}" --to "experiments/{slug}" \

--type tested_by --evidence "Designed by /exp-design"

```

  1. 更新 idea 页面(若 idea 来自 wiki):
  1. 更新 index.md:在 experiments 和 claims(若新建)类别下追加条目
  1. 重建派生数据:

```bash

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

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

```

  1. 追加日志:

```bash

python3 tools/research_wiki.py log wiki/ \

"exp-design | {N} experiments designed for idea {slug} | claims: {claim-list}"

```

  1. 输出 EXPERIMENT_PLAN_REPORT 到终端:

```markdown

# Experiment Plan Report

## Target Idea

## Scoped Claims

| Claim | Current status | Confidence | Dimension |

|-------|---------------|------------|-----------|

| [[claim-slug]] | proposed | 0.3 | target |

| [[claim-slug]] | weakly_supported | 0.5 | decomposition |

## Experiment Blocks

| # | Experiment | Type | Claim | GPU-hrs | Stage |

|---|-----------|------|-------|---------|-------|

| 1 | [[baseline-slug]] | baseline | — | 2 | 1 |

| 2 | [[validation-slug]] | validation | target | 8 | 2 |

| 3 | [[ablation-1-slug]] | ablation | decomposition-1 | 8 | 3 |

| 4 | [[robustness-slug]] | robustness | target | 16 | 4 |

## Run Order

Stage 0: Sanity → Stage 1: Baseline → Stage 2: Validation → Stage 3: Ablation → Stage 4: Robustness

Decision gates at each stage boundary.

## Budget

## Next Steps

```

Constraints

Error Handling

Dependencies

Tools(via Bash)

MCP Servers

Claude Code Native

Shared References

Called by

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.