ResearchClaw — Autonomous Research Pipeline Skill
Description
Run ResearchClaw's 23-stage autonomous research pipeline. Given a research topic, this skill orchestrates the entire research workflow: literature review → hypothesis generation → experiment design → code generation & execution → result analysis → paper writing → peer review → final export.
Trigger Conditions
Activate this skill when the user:
- - Asks to "research [topic]", "write a paper about [topic]", or "investigate [topic]"
- Wants to run an autonomous research pipeline
- Asks to generate a research paper from scratch
- Mentions "ResearchClaw" by name
Instructions
Prerequisites Check
- 1. Verify config file exists:
ls config.yaml || ls config.researchclaw.example.yaml
- 2. If no
config.yaml, create one from the example:
cp config.researchclaw.example.yaml config.yaml
- 3. Ensure the user's LLM API key is configured in
config.yaml under llm.api_key or via llm.api_key_env environment variable.
Running the Pipeline
Option A: CLI (recommended)
CODEBLOCK2
Options:
- -
--topic / -t: Override the research topic from config - INLINECODE6 /
-c: Config file path (default: config.yaml) - INLINECODE9 /
-o: Output directory (default: artifacts/rc-YYYYMMDD-HHMMSS-HASH/) - INLINECODE12 : Resume from a specific stage (e.g.,
PAPER_OUTLINE) - INLINECODE14 : Auto-approve gate stages (5, 9, 20) without human input
Option B: Python API
CODEBLOCK3
Option C: Iterative Pipeline (multi-round improvement)
CODEBLOCK4
Output Structure
After a successful run, the output directory contains:
CODEBLOCK5
Experiment Modes
| Mode | Description | Config |
|---|
| INLINECODE15 | LLM generates synthetic results (no code execution) | INLINECODE16 |
| INLINECODE17 |
Execute generated code locally via subprocess |
experiment.mode: sandbox |
|
ssh_remote | Execute on remote GPU server via SSH |
experiment.mode: ssh_remote |
Troubleshooting
- - Config validation error: Run INLINECODE21
- LLM connection failure: Check
llm.base_url and API key - Sandbox execution failure: Verify
experiment.sandbox.python_path exists and has numpy installed - Gate rejection: Use
--auto-approve or manually approve at stages 5, 9, 20
Tools Required
- - File read/write (for config and artifacts)
- Bash (for CLI execution)
- No external MCP servers required for basic operation
ResearchClaw — 自主研究管线技能
描述
运行ResearchClaw的23阶段自主研究管线。给定一个研究主题,该技能将编排整个研究工作流程:文献综述→假设生成→实验设计→代码生成与执行→结果分析→论文撰写→同行评审→最终导出。
触发条件
当用户出现以下情况时激活此技能:
- - 要求研究[主题]、撰写关于[主题]的论文或调查[主题]
- 希望运行自主研究管线
- 要求从头生成研究论文
- 提及ResearchClaw名称
操作说明
前置条件检查
- 1. 验证配置文件是否存在:
bash
ls config.yaml || ls config.researchclaw.example.yaml
- 2. 如果没有config.yaml,从示例创建:
bash
cp config.researchclaw.example.yaml config.yaml
- 3. 确保用户的LLM API密钥已在config.yaml的llm.apikey下配置,或通过llm.apikey_env环境变量设置。
运行管线
选项A:CLI(推荐)
bash
researchclaw run --topic 您的研究主题 --auto-approve
选项:
- - --topic / -t:覆盖配置中的研究主题
- --config / -c:配置文件路径(默认:config.yaml)
- --output / -o:输出目录(默认:artifacts/rc-YYYYMMDD-HHMMSS-HASH/)
- --from-stage:从特定阶段恢复(例如PAPER_OUTLINE)
- --auto-approve:自动批准关卡阶段(5、9、20),无需人工输入
选项B:Python API
python
from researchclaw.pipeline.runner import execute_pipeline
from researchclaw.config import RCConfig
from researchclaw.adapters import AdapterBundle
from pathlib import Path
config = RCConfig.load(config.yaml, check_paths=False)
results = execute_pipeline(
run_dir=Path(artifacts/my-run),
run_id=research-001,
config=config,
adapters=AdapterBundle(),
autoapprovegates=True,
)
检查结果
for r in results:
print(f阶段 {r.stage.name}: {r.status.value})
选项C:迭代管线(多轮改进)
python
from researchclaw.pipeline.runner import executeiterativepipeline
results = executeiterativepipeline(
run_dir=Path(artifacts/my-run),
run_id=research-001,
config=config,
adapters=AdapterBundle(),
max_iterations=3,
convergence_rounds=2,
)
输出结构
成功运行后,输出目录包含:
artifacts//
├── stage-1/ # TOPIC_INIT 输出
├── stage-2/ # PROBLEM_DECOMPOSE 输出
├── ...
├── stage-10/
│ └── experiment.py # 生成的实验代码
├── stage-12/
│ └── runs/run-1.json # 实验执行结果
├── stage-14/
│ ├── experiment_summary.json # 聚合指标
│ └── results_table.tex # LaTeX结果表格
├── stage-17/
│ └── paper_draft.md # 完整论文草稿
├── stage-22/
│ └── charts/ # 生成的可视化图表
│ ├── metric_trajectory.png
│ └── experiment_comparison.png
└── pipeline_summary.json # 整体管线状态
实验模式
| 模式 | 描述 | 配置 |
|---|
| simulated | LLM生成合成结果(不执行代码) | experiment.mode: simulated |
| sandbox |
通过子进程在本地执行生成的代码 | experiment.mode: sandbox |
| ssh
remote | 通过SSH在远程GPU服务器上执行 | experiment.mode: sshremote |
故障排除
- - 配置验证错误:运行researchclaw validate --config config.yaml
- LLM连接失败:检查llm.baseurl和API密钥
- 沙箱执行失败:验证experiment.sandbox.pythonpath存在并已安装numpy
- 关卡拒绝:使用--auto-approve或在阶段5、9、20手动批准
所需工具
- - 文件读写(用于配置和工件)
- Bash(用于CLI执行)
- 基本操作无需外部MCP服务器