Research

From Lambenthan/empiricalwiki · View interactive version

Research is an AI agent skill from the GitHub repository Lambenthan/empiricalwiki. End-to-end research orchestrator — idea discovery → experiment design → execution → verdict → paper writing, with human gates and session-resumable state

How to use this skill

Skill file

/research

End-to-end research orchestrator that composes all skills into a complete research workflow.

Stage 0 (Bootstrap) + 5 Stages + 2 Human Gates, covering the full pipeline from empty wiki to paper submission.

Zero-friction entry: if the wiki is empty, Bootstrap is triggered automatically (search + auto-ingest 5 papers); no need to run /init manually.

Every Gate and Stage saves progress to wiki/outputs/pipeline-progress.md, supporting cross-session recovery.

Stage 3 is non-blocking: experiments are deployed and control returns immediately (--auto mode automatically sets up a CronCreate to monitor every 30 minutes).

When all experiments finish, Stage 4 is triggered automatically. Use /exp-status at any time to check progress.

--auto mode skips manual confirmation (automatically selects the top-1 idea). --skip-paper runs the research without writing a paper.

Inputs

Outputs

Wiki Interaction

Reads

Writes

Graph edges created

Workflow

Precondition:

  1. Confirm working directory is the wiki project root (containing wiki/, raw/, tools/)
  2. If --start-from is specified, read wiki/outputs/pipeline-progress.md to restore state

Step 0: Initialize

  1. Parse input:
  1. Auto-recovery detection (when --start-from is not specified):

```

Unfinished pipeline detected:

Direction: {direction}

Current stage: {current_stage}

Started: {started}

[1] Resume from {current_stage} (recommended)

[2] Start a new pipeline (will overwrite old progress)

[3] View experiment status first (/exp-status --pipeline {slug})

```

  1. Check recovery (when --start-from is specified):
  1. Create progress file 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. Append log:

```bash

python3 tools/research_wiki.py log wiki/ \

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

```

  1. Snapshot wiki state (for Growth Report in Step Final):

```bash

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

```

Save returned JSON to memory variable maturity_before.

Stage 0: Bootstrap (triggered automatically when wiki is empty)

Trigger condition: run python3 tools/research_wiki.py maturity wiki/ --json. If level == "cold" and papers < 3: enter Bootstrap automatically. Otherwise skip and proceed to Stage 1.

  1. Initialize wiki structure (if not yet initialized):

```bash

python3 tools/research_wiki.py init wiki/

```

  1. Search for relevant papers (use Agent tool with 3 parallel searches):
  1. Merge, rank, and select top 5:
  1. Auto-ingest each paper:

```

Skill: ingest

Args: "{arxiv_url_or_path}"

```

Output progress after each ingest: [{i}/5] Ingested: {paper_title}

  1. Rebuild derived data:

```bash

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

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

```

  1. Bootstrap report:

```bash

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

```

Output to terminal:

```

Bootstrap complete:

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

Maturity: cold → {new_level}

Proceeding to Stage 1: Idea Discovery...

```

  1. Log + update progress:

```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

Call /ideate:

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

After completion:

  1. Read the generated ideas, sorted by priority
  2. Update pipeline-progress: Stage 1 → completed, record generated idea slugs
  3. Append log

Gate 1: Select Idea

If --auto mode:

If interactive mode:

Save progress:

Stage 2: Experiment Design

Call /exp-design:

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

After completion:

  1. Read generated experiment slugs (pages in wiki/experiments/ where linked_idea == idea_slug)
  2. Update pipeline-progress: Stage 2 → completed, record experiment_slugs

Stage 3: Experiment Execution (non-blocking)

Stage 3 is divided into three sub-stages, allowing experiments to run asynchronously in the background without blocking the session.

Stage 3a: Deploy All

Deploy each experiment in run order (baseline → validation → ablation → robustness) by calling /exp-run {experiment_slug} (default deploy mode, Phase 1+2):

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

(Default deploy mode, Phase 1+2: returns immediately after deployment, does not wait for experiment to finish)

After each deployment:

After all deployments complete, update 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}, ...]"

Append log:

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

After all experiments are deployed, compute ETA, save progress, and end the current session.

  1. Update pipeline-progress:

```bash

python3 tools/research_wiki.py set-meta \

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

```

  1. Compute estimated completion time for each experiment:

For each deployed experiment, read started and estimated_hours from frontmatter:

  1. Append log:

```bash

python3 tools/research_wiki.py log wiki/ \

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

```

  1. Output instructions then end current session:

```

Stage 3a complete: {N} experiments all deployed:

Experiment Environment Est. Duration Est. Completion

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

exp-foo-baseline local ~8h Tomorrow 09:30

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

exp-foo-ablation local ~4h Today 21:00

Latest completion: Tomorrow 09:30 (exp-foo-baseline)

Recommended time to return: Tomorrow 10:00+

/exp-status ← confirm all experiments complete

/research --start-from stage3-collect ← collect results and continue

Progress saved to wiki/outputs/pipeline-progress.md; current session can be closed.

```

Stage 3c: Collect (triggered after experiments complete)

Trigger: user manually runs /research --start-from stage3-collect

For each deployed experiment (read from stage3a_deployed list):

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

(Collect mode, Phase 3+4: check completion status and collect results)

Decision after each collect:

After all collects complete:

```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

Call /exp-eval for each completed experiment:

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

Evaluate whether claims are sufficient:

  1. Read the latest status of all target claims
  2. Determine whether iteration is needed:

Iteration path (when claims are insufficient, up to 1 retry):

  1. Analyze the cause of failure
  2. Call /refine to improve the experiment plan:

```

Skill: refine

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

```

  1. Re-run Stage 3 → Stage 4 for new/modified experiments
  2. Maximum 2 iterations (prevents infinite loops); each stage has at most 1 auto-retry

After completion:

Gate 2: Confirm Paper Ready

If --skip-paper: skip Gate 2 and Stage 5, generate final report directly

If --auto mode: automatically continue, enter Stage 5

If interactive mode:

```

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

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

```

Save progress:

Stage 5: Paper Writing

Call sub-skills in sequence: /paper-plan → /paper-draft → /refine → /paper-compile

5a. Call /paper-plan:

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

5b. Call /paper-draft:

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

5c. Call /refine on paper:

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

5d. Call /paper-compile:

Skill: paper-compile
Args: "paper/"

After completion:

Step Final: Pipeline Report

Generate 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 | {%} | {%} | +{%} |
(Data from comparing `maturity_before` from Step 0 against a fresh call to `maturity --json` here. Only rows with delta != 0 are shown.)

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

Append log:

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

Update 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.