Communitygithub.com

科學示意圖與圖表

使用 Nano Banana 2 AI 與 Gemini 3.6 Flash 智慧迭代精煉,建立符合出版標準的科學圖表。根據文件類型自動設定品質門檻,專精於神經網路架構、流程圖、生物路徑與複雜科學視覺化。

科學示意圖與圖表 是什麼?

此技能專為需要高品質科學圖表的研究人員與開發者設計,利用 Nano Banana 2 AI 模型進行圖表生成,並透過 Gemini 3.6 Flash 進行自動化品質審查。其核心優勢在於「智慧迭代」機制:系統僅在審查分數低於文件類型對應的品質門檻時才會重新生成圖表,從而節省 API 呼叫次數與時間。支援多種文件類型(如期刊、會議論文、海報),並對應不同的品質門檻(期刊要求最高 8.5/10)。使用者只需用自然語言描述圖表,AI 便能自動產生符合科學出版標準的 PNG 圖像,並儲存於 `figures/` 資料夾。此技能適用於多種平台(如 Claude Code, Cursor, Codex),並提供詳細的提示詞最佳實踐與疑難排解指南。注意:輸出僅為 PNG 格式,無向量路徑或 DPI 控制,若期刊要求 PDF 或 300 dpi TIFF,需自行轉換。

相容平台~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 會根據文件類型門檻審查品質
  • 智慧迭代:僅在品質低於門檻時才重新生成
  • 數分鐘內即可產出可供發表的檔案
  • 無需程式碼、範本或手動繪圖

按文件類型設定的品質門檻:

文件類型門檻值說明
journal8.5/10Nature、Science 等同儕審查期刊
conference8.0/10會議論文
thesis8.0/10學位論文
grant8.0/10計劃書
preprint7.5/10arXiv、bioRxiv 等預印本
report7.5/10技術報告
poster7.0/10學術海報
presentation6.5/10簡報、演講
default7.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 "從 EGFR 到基因轉錄的 MAPK 訊息傳遞路徑" -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" 中說明原因。執行時會印出 審查無法使用——圖片已保留,品質未經驗證。請將該圖片視為未經檢查,自行檢視;重新執行一次是值得的,因為此類失敗通常是暫時性的。

設定

設定你的 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 欄位:審查者通常會指出它看到的遺漏

標籤中的文字錯誤,或圖片編號直接嵌入圖片中

  • 提示詞已禁止「圖 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 執行以檢視請求和完整錯誤內容

資源與參考資料

詳細參考資料

載入下列檔案以取得特定主題的完整資訊:

  • references/iterative_refinement.md - 生成-審查-精煉循環、Python API、每個命令列選項、提示詞工程指導,以及四個實作範例
  • references/best_practices.md - 編寫提示詞和判斷結果時可參考的出版標準與可及性指南

外部資源

出版標準

與其他技能的整合

此技能可與以下技能協同使用:

  • 科學寫作 - 圖表遵循圖形最佳實務
  • 科學視覺化 - 共享色板和樣式
  • LaTeX 海報 - 為海報展示生成圖表
  • 研究計劃書 - 為提案生成方法學圖表
  • 同儕審查 - 評估圖表的清晰度和可及性

快速參考檢查清單

在提交圖表之前,請確認:

閱讀審查記錄檔(這是唯一可用的自動化檢查)

  • <name>_review_log.json 存在,且最終迭代的 "reviewed" 為 true
  • "final_score" 是實際數字(非 null),且達到你文件類型的門檻
  • 閱讀 "critique"——即使分數通過,審查者仍會列出其剩餘問題
  • 如果生成了多個版本,請比較 _v1 和 _v2,保留較佳者

自行查看圖片

  • 每個標籤拼寫正確——圖片模型會拼錯文字,且此處沒有自動化檢查能發現
  • 沒有重疊或裁剪的文字
  • 所有箭頭都連接至應連接的元素
  • 科學內容正確,例如路徑圖中正確的分子名稱
  • 整體佈局清晰無擁擠

檢查格式與解析度

  • 輸出為 PNG 格式;若期刊要求 PDF/EPS/TIFF,已在下游轉換
  • 若已轉換,以最終列印尺寸檢查結果(例如,在 100% 縮放下檢查 300 dpi TIFF)
  • 所有顏色皆可區分(可考慮使用灰階列印測試)

此技能不包含自動化後處理。上述檢查清單是你品質控管的程序。

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.

相關技能