Dispatch biomedical research and data analysis tasks to Claude Code with K-Dense Scientific Skills. Use this skill when the user asks to run any bioinformatics, genomics, drug discovery, clinical data analysis, proteomics, multi-omics, medical imaging, or scientific computation task. Also use for literature search (PubMed, bioRxiv), pathway analysis, protein structure prediction, or scientific writing tasks.
Bridge between the OpenClaw conversational interface and Claude Code's scientific execution environment (K-Dense Scientific Skills).
/workspace/data/TASK_DIR=data/<task_name>
mkdir -p "$TASK_DIR/dashboard" "$TASK_DIR/output"
cp skills/dashboard/dashboard.html "$TASK_DIR/dashboard/"
cp skills/dashboard/dashboard_serve.py "$TASK_DIR/dashboard/"
# Write initial state.json with: progress(0%), 研究概要, 分析计划(list), empty steps
# Start server
python "$TASK_DIR/dashboard/dashboard_serve.py" --port <free_port> &
# Tell user the URL immediately: http://localhost:<port>/dashboard/dashboard.html
先读 ~/next-medgeai/MedgeClaw/scientific-skills/scientific-skills/scientific-writing/SKILL.md)$TASK_DIR/output/step panels with desc, code, code_file, outputs{"src": "/output/file.csv"} for table references (NOT inline data)/output/fig1.png# 推荐:stream-json 模式(可观测)
cd "$TASK_DIR" && claude -p "短任务描述。先读 skill 文件。完成后: openclaw system event --text 'Done: 摘要' --mode now" \
--output-format stream-json \
--verbose \
--dangerously-skip-permissions \
2>/dev/null | tail -1
# 旧方式(不推荐,无可观测性)
claude --dangerously-skip-permissions -p "Use available scientific skills. [TASK]. Input: [PATH]. Outputs: $TASK_DIR/output/. Update dashboard at $TASK_DIR/dashboard/state.json after each step (step panels with code + outputs). Completion: openclaw system event --text 'Done: summary' --mode now"
progress.json 判断进度:
last_update 超过 5 分钟没变 → 大概率卡了,kill 掉重来文献综述 / 论文写作必须拆分:
# Phase 1: 文献搜索 + 大纲(5-10 分钟)
cd writing_outputs/<task_name> && claude -p "读 ~/next-medgeai/MedgeClaw/scientific-skills/scientific-skills/literature-review/SKILL.md 和 scientific-writing/SKILL.md。按 literature-review 流程搜索文献,创建 outline.md(Stage 1)。" \
--output-format stream-json --verbose --dangerously-skip-permissions 2>/dev/null | tail -1
# Phase 2: 写正文(分章节,每章 5-10 分钟)
cd writing_outputs/<task_name> && claude -p "读 outline.md 的第 1-3 节。用 Edit 工具在 manuscript.tex 中补充这些章节的正文。写完整的学术散文。" \
--output-format stream-json --verbose --dangerously-skip-permissions 2>/dev/null | tail -1
# Phase 3: 创建 BibTeX + 添加引用(5 分钟)
cd writing_outputs/<task_name> && claude -p "读 manuscript.tex 和 outline.md。创建 references/references.bib(至少 30 篇),在 tex 中添加 \cite{}(每节至少 5 处),在 \end{document} 前加 \bibliographystyle{unsrt} 和 \bibliography{references}。" \
--output-format stream-json --verbose --dangerously-skip-permissions 2>/dev/null | tail -1
# Phase 4: 生成图表(5-10 分钟)
cd writing_outputs/<task_name> && claude -p "在 figures/ 下创建 5 个 Python 脚本生成图表 PDF。中文标签用 Noto Sans CJK SC 字体。" \
--output-format stream-json --verbose --dangerously-skip-permissions 2>/dev/null | tail -1
# Phase 5: 编译 PDF(手动或简单 CC)
cd writing_outputs/<task_name>/drafts && xelatex -output-directory=../final manuscript.tex
cd ../final && bibtex manuscript && cd ../drafts && xelatex -output-directory=../final manuscript.tex && xelatex -output-directory=../final manuscript.tex
为什么必须拆分:
Clinical data analysis (complete flow with dashboard):
# 1. Setup
TASK_DIR=data/charls_ace
mkdir -p "$TASK_DIR/dashboard" "$TASK_DIR/output"
cp skills/dashboard/dashboard.html "$TASK_DIR/dashboard/"
cp skills/dashboard/dashboard_serve.py "$TASK_DIR/dashboard/"
# 2. Write initial state.json
# 3. Start dashboard server
python "$TASK_DIR/dashboard/dashboard_serve.py" --port 7790 &
# 4. Dispatch to Claude Code
claude --dangerously-skip-permissions -p "分析 CHARLS 队列中 ACE 与 CVD 的关联。Input: data/charls_ace/charls.dta. Output: data/charls_ace/output/. 每步更新 dashboard state.json(step panels with code + outputs)。完成后: openclaw system event --text 'Done: ACE-CVD分析完成' --mode now"
RNA-seq differential expression:
claude --dangerously-skip-permissions -p "Use DESeq2 scientific skill. Run differential expression. Counts: /workspace/data/counts.csv, metadata: /workspace/data/meta.csv, contrast: treatment vs control. Save to /workspace/data/rnaseq/output/. Update dashboard at /workspace/data/rnaseq/dashboard/state.json."
Single-cell RNA-seq:
claude --dangerously-skip-permissions -p "Use Scanpy scientific skill. Analyze 10X data at /workspace/data/10x/. QC, clustering, markers. Save to /workspace/data/10x/output/. Update dashboard state.json with step panels."
所有任务输出必须写入指定目录:
| 任务类型 | 输出路径 | 说明 |
|---|---|---|
| 数据分析 | data/<task_name>/output/ | CSV、图表、报告 |
| Dashboard | data/<task_name>/dashboard/ | state.json, dashboard.html, serve.py |
| 科学写作 | writing_outputs/<date>_<topic>/ | LaTeX、PDF、BibTeX、figures/ |
| 临时文件 | data/<task_name>/temp/ | 中间产物 |
禁止写入:
~/next-medgeai/MedgeClaw/)/workspace/outputs/(已废弃)/workspace/data/(只读,用户输入数据)/workspace/data/uv pip install [package] prepended to the commandskills/cjk-viz/scripts/setup_cjk_font.py 执行字体检测,不要硬编码字体名