Communitygithub.com

科学示意图与图表

使用Nano Banana 2 AI创建符合发表标准的科学示意图,并结合Gemini 3.6 Flash进行质量审核。仅当质量低于文档类型阈值时才会智能迭代优化。专注于神经网络架构、系统图、流程图、生物通路和复杂科学可视化。

科学示意图与图表 是什么?

本技能利用Nano Banana 2 AI模型生成高质量科学示意图,并通过Gemini 3.6 Flash进行质量评审,实现智能迭代优化。用户只需用自然语言描述所需图表,系统便会自动生成并依据预设的文档类型阈值(如期刊论文需8.5/10,会议论文需8.0/10)评估质量。仅在首次生成质量不达标时才会触发重新生成,从而节省API调用成本。生成的图像为PNG栅格格式,存储于`figures/`子文件夹中,并附带详细的评审日志(包含评分、评审意见和提前停止原因)。该技能特别适用于神经网络架构图、系统流程图、生物通路图、电路图等科学可视化场景,并遵循科学出版的最佳实践(如无障碍配色、清晰标签和合理布局)。请注意,本技能仅生成PNG格式,不提供矢量输出或DPI控制,且所有图像和提示词会发送至OpenRouter进行处理。

兼容平台~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/scientific-schematics

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

科学示意图与图表 是做什么的?

概述

科学示意图与图表将复杂概念转化为清晰的视觉表示,以便发表。此技能使用Nano Banana 2 AI生成图表,并配合Gemini 3.6 Flash进行质量审核。

工作原理:

  • 用自然语言描述你的图表
  • Nano Banana 2自动生成符合发表标准的图像
  • Gemini 3.6 Flash根据文档类型阈值审核质量
  • 智能迭代:仅当质量低于阈值时才会重新生成
  • 数分钟内即可获得发表就绪的输出
  • 无需编码、模板或手动绘制

按文档类型的质量阈值:

文档类型阈值描述
期刊8.5/10Nature, Science, 同行评审期刊
会议8.0/10会议论文
学位论文8.0/10博士论文、硕士论文
基金申请8.0/10基金申请书
预印本7.5/10arXiv, bioRxiv等
报告7.5/10技术报告
海报7.0/10学术海报
演示文稿6.5/10幻灯片、演讲
默认7.5/10通用目的

只需描述你想要的,Nano Banana 2就会创建它。 所有图表都存储在figures/子文件夹中,并在论文/海报中引用。

输出内容: 由图像模型返回的任意分辨率的栅格PNG。此技能无矢量路径和DPI控制——如果期刊要求PDF、EPS或300 dpi的TIFF,请后续转换PNG,并在最终打印尺寸下检查结果。

快速入门:生成任意图表

只需描述即可创建任何科学图表。Nano Banana 2会自动处理所有事情,并具备智能迭代功能:

# 为期刊论文生成(最高质量阈值:8.5/10)
python scripts/generate_schematic.py "CONSORT参与者流程图,500人筛选,150人排除,350人随机分组" -o figures/consort.png --doc-type journal

# 为演示文稿生成(较低阈值:6.5/10 - 更快)
python scripts/generate_schematic.py "Transformer编码器-解码器架构,显示多头注意力" -o figures/transformer.png --doc-type presentation

# 为海报生成(中等阈值:7.0/10)
python scripts/generate_schematic.py "MAPK信号通路,从EGFR到基因转录" -o figures/mapk_pathway.png --doc-type poster

# 自定义最大迭代次数(最多2次)
python scripts/generate_schematic.py "复杂电路图,含运放、电阻和电容" -o figures/circuit.png --iterations 2 --doc-type journal

后台运行过程:

  1. 生成1:Nano Banana 2根据科学图表最佳实践创建初始图像
  2. 审核1:Gemini 3.6 Flash根据文档类型阈值评估质量
  3. 决策:如果质量 >= 阈值 → 完成(无需更多迭代!)
  4. 如果低于阈值:根据评审意见改进提示词,重新生成
  5. 重复:直到质量满足阈值或达到最大迭代次数

智能迭代优势:

  • ✅ 如果首次生成足够好,可节省API调用
  • ✅ 为期刊论文提供更高质量标准
  • ✅ 为演示文稿/海报提供更快的周转
  • ✅ 为每个用例提供适当的质量

输出:带版本号的图像(name_v1.png,name_v2.png),一份位于你指定路径的优胜副本,以及包含每次迭代的评分、评审意见和提前停止原因的 name_review_log.json 文件。

当审核无法运行时 —— 如遇到速率限制、内容过滤器、或审核者以意外形式回答 —— 图像仍会生成并保存,但不会为其编造分数。日志会记录 "score": null 和 "reviewed": false,并在 "review_error" 中注明原因,同时运行时会打印 Review unavailable — image kept, quality not verified。请将该图像视为未检查状态,自行查看;重新运行一次是值得的,因为失败通常是暂时的。

配置

设置你的OpenRouter API密钥:

export OPENROUTER_API_KEY='your_api_key_here'

在此获取API密钥:https://openrouter.ai/keys

数据离开机器。 你的提示词会发送至OpenRouter以生成图像,生成的图像会传回OpenRouter进行质量审核。两者均受OpenRouter的数据政策及其底层模型提供商的政策约束。请勿在提示词中描述未发表的数据、患者信息或任何受保密协议约束的内容。

AI生成最佳实践

科学图表的有效提示词:

✓ 好的提示词(具体、详细):

  • "CONSORT流程图,显示从筛选(n=500)到随机分组再到最终分析的参与者流程"
  • "Transformer神经网络架构,编码器堆栈在左,解码器堆栈在右,显示多头注意力和交叉注意力连接"
  • "生物信号级联:EGFR受体 → RAS → RAF → MEK → ERK → 细胞核,标记磷酸化步骤"
  • "物联网系统模块图:传感器 → 微控制器 → WiFi模块 → 云服务器 → 移动应用"

✗ 避免模糊提示词:

  • "画个流程图"(过于笼统)
  • "神经网络"(哪种类型?包含哪些组件?)
  • "通路图"(哪条通路?包含哪些分子?)

需要包含的关键要素:

  • 类型:流程图、架构图、通路、电路等
  • 组件:需包含的具体元素
  • 流程/方向:元素如何连接(从左到右、从上到下)
  • 标签:需包含的关键注释或文本
  • 风格:任何特定的视觉要求

科学质量指南(自动应用):

  • 干净的白色/浅色背景
  • 高对比度,便于阅读
  • 清晰易读的标签(最小10pt)
  • 专业排版(无衬线字体)
  • 色盲友好颜色(Okabe-Ito调色板)
  • 适当的间距,避免拥挤
  • 适当时包含比例尺、图例、坐标轴

何时使用此技能

此技能应在以下情况下使用:

  • 创建神经网络架构图(Transformer、CNN、RNN等)
  • 说明系统架构和数据流图
  • 为研究设计绘制方法论流程图(CONSORT、PRISMA)
  • 可视化算法工作流和处理管线
  • 创建电路图和电气原理图
  • 描绘生物通路和分子相互作用
  • 生成网络拓扑和层次结构
  • 说明概念框架和理论模型
  • 为技术论文设计模块图

如何使用此技能

只需用自然语言描述你的图表。 Nano Banana 2会自动生成:

python scripts/generate_schematic.py "你的图表描述" -o output.png

就这么简单! AI处理:

  • ✓ 布局和构图
  • ✓ 标签和注释
  • ✓ 颜色和样式
  • ✓ 质量审核和优化
  • ✓ 符合发表标准的输出

适用于所有图表类型:

  • 流程图(CONSORT、PRISMA等)
  • 神经网络架构
  • 生物通路
  • 电路图
  • 系统架构
  • 模块图
  • 任何科学可视化

无需编码、模板或手动绘制。


AI生成模式(Nano Banana 2 + Gemini 3.6 Flash审核)

智能迭代优化、高级用法和示例

生成-审核-优化循环、Python API和命令行选项、提示词工程指导以及四个工作示例(CONSORT流程图、神经网络架构、生物通路、系统架构)均位于 references/iterative_refinement.md 中。

一旦审核通过,循环就会停止,因此简单的图表通常只需一次迭代;只有复杂图形才会使用全部预算。

命令行用法

生成科学示意图的主要入口点:

# 基本用法
python scripts/generate_schematic.py "图表描述" -o output.png

# 自定义迭代次数(最多2次)
python scripts/generate_schematic.py "复杂图表" -o diagram.png --iterations 2

# 详细模式
python scripts/generate_schematic.py "图表" -o out.png -v

注意: Nano Banana 2 AI生成系统在其迭代优化过程中包含自动质量审核。每次迭代都会根据科学准确性、清晰度和可访问性进行评估。

最佳实践总结

设计原则 —— 在提示词中要求使用

  1. 清晰优于复杂 - 简化,去除不必要的元素
  2. 一致的风格 - 在论文的所有图表中描述相同的视觉惯例
  3. 色盲无障碍 - 要求使用Okabe-Ito调色板和冗余编码
  4. 适当的排版 - 无衬线字体,足够大的标签
  5. 逻辑流程 - 明确说明方向(从左到右、从上到下)

生成器默认应用所有这些原则,但对于特定图表,用自己的话说明它们比仅仅依赖内置指南效果更好。

管线无法实现的功能

  1. 矢量输出 - 仅PNG;不生成PDF、SVG或EPS
  2. 分辨率控制 - 由图像模型决定;无DPI标志
  3. 色彩空间 - 仅RGB;后续转换为CMYK印刷工作流
  4. 精确的线宽或文字大小 - 在提示词中描述,然后目视验证

对于要求矢量图或300+ dpi TIFF的期刊,请在生成后转换PNG,并在实际打印尺寸下检查结果。

集成指南

  1. 在LaTeX中包含 - 使用 \includegraphics{} 引入生成的图像
  2. 详细标题 - 描述所有元素和缩略词
  3. 在正文中引用 - 在叙述流程中解释图表
  4. 保持一致性 - 论文中所有图表使用相同风格
  5. 版本控制 - 将提示词和生成的图像保留在仓库中

常见问题排查

生成具有随机性且迭代次数限制为2次,因此实际能改变结果的因素是提示词、文档类型和重新运行。此技能没有后期处理步骤,也没有质量检查库:你可以检查的所有内容都存在于生成的PNG和 <name>_review_log.json 文件中。

图表不正确

文本重叠、元素拥挤或箭头未命中目标

  • 在提示词中指定布局:"垂直流程,每行一个框,阶段之间留有充足间距"
  • 指定连接关系:"从RAF到MEK的箭头,标记为磷酸化",而不是"显示级联"
  • 重新运行。同一提示词运行两次结果不同,糟糕的布局通常只是运气不好

内容在科学上错误或缺少组件

  • 显式列出组件,包括数量和标签——模型不会推断它们
  • 阅读审核日志中的 critique 字段:审核者通常会指出它看到的缺失内容

标签文本错误或图表中嵌入了图编号

  • 提示词已禁止出现"Figure 1:"标题;如果仍出现,请重新运行
  • 拼写错误的标签是图像模型最常见的失败点。使用前请阅读每个标签

评分似乎不正确

评分低于图表应得的分数

  • 在重新运行前阅读评审意见;审核者提出的问题通常是合理且具体的
  • 决定是否迭代的是阈值,而不是评分——--doc-type journal 要求8.5分

运行在低于阈值的分数处停止

  • 这是迭代上限。--iterations 2 是最大值;最后一张图像会被保留并报告其实际分数

日志中出现 "score": null 和 "reviewed": false

  • 审核调用失败或返回了不可用的格式。图像正常并被保留;只是质量从未被衡量。请检查 "review_error",自行查看图像,然后重新运行

设置

Error: OPENROUTER_API_KEY not found

  • export OPENROUTER_API_KEY='sk-or-v1-...',或者将其添加到 .env 文件,或传入 --api-key

Error: requests library not found

  • uv pip install requests

任何API错误 —— 使用 -v 运行以查看请求、模型slug和完整的错误主体

资源和参考

详细参考

加载这些文件以获取特定主题的全面信息:

  • references/iterative_refinement.md - 生成-审核-优化循环、Python API、所有命令行选项、提示词工程指导以及四个工作示例
  • references/best_practices.md - 出版标准和可访问性指南,用于编写提示词和判断结果时参考

外部资源

出版标准

与其他技能的集成

此技能可与以下技能协同使用:

  • 科学写作 - 图表遵循图形最佳实践
  • 科学可视化 - 共享调色板和样式
  • LaTeX海报 - 为海报演示生成图表
  • 研究基金申请 - 为申请书生成方法论图表
  • 同行评审 - 评估图表的清晰度和可访问性

快速参考检查清单

在提交图表前,请验证:

阅读审核日志(这是唯一自动化的检查)

  • <name>_review_log.json 存在且最终迭代中 "reviewed" 为 true
  • "final_score" 是实数,非 null,且达到你的文档类型阈值
  • 阅读 "critique" —— 即使分数合格,审核者也列出了剩余问题
  • 如果生成了多个版本,比较 _v1 和 _v2 并保留更好的一个

自行查看图像

  • 所有标签拼写正确 —— 图像模型会拼错文本,且此处没有自动化检查能发现
  • 无重叠或裁剪的文本
  • 所有箭头连接了它们本应连接的元素
  • 科学内容准确无误

...

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

相关技能