scientific-schematics by davila7/claude-code-templates
npx skills add https://github.com/davila7/claude-code-templates --skill scientific-schematics科学示意图和图表将复杂概念转化为清晰的视觉呈现,用于发表。此技能使用 Nano Banana Pro AI 生成图表,并由 Gemini 3 Pro 进行质量审核。
工作原理:
按文档类型的质量阈值:
| 文档类型 | 阈值 | 描述 |
|---|---|---|
| journal | 8.5/10 | Nature、Science、同行评审期刊 |
| conference | 8.0/10 | 会议论文 |
| thesis | 8.0/10 | 学位论文 |
| grant | 8.0/10 | 资助申请 |
| preprint | 7.5/10 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| arXiv、bioRxiv 等 |
| report | 7.5/10 | 技术报告 |
| poster | 7.0/10 | 学术海报 |
| presentation | 6.5/10 | 幻灯片、演讲 |
| default | 7.5/10 | 通用目的 |
只需描述您想要的内容,Nano Banana Pro 就会创建它。 所有图表都存储在 figures/ 子文件夹中,并在论文/海报中引用。
只需描述即可创建任何科学图表。Nano Banana Pro 通过智能迭代自动处理一切:
# 为期刊论文生成(最高质量阈值: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
幕后过程:
智能迭代优势:
输出:版本化图像以及包含质量分数、批评和提前停止信息的详细审核日志。
设置您的 OpenRouter API 密钥:
export OPENROUTER_API_KEY='your_api_key_here'
获取 API 密钥:https://openrouter.ai/keys
科学图表的有效提示:
✓ 好的提示(具体、详细):
✗ 避免模糊提示:
需要包含的关键元素:
科学质量指南(自动应用):
此技能应在以下情况下使用:
只需用自然语言描述您的图表。 Nano Banana Pro 会自动生成:
python scripts/generate_schematic.py "您的图表描述" -o output.png
就这样! AI 处理:
适用于所有图表类型:
无需编码、无需模板、无需手动绘图。
AI 生成系统使用智能迭代 - 仅当质量低于您文档类型的阈值时才重新生成:
┌─────────────────────────────────────────────────────┐
│ 1. 使用 Nano Banana Pro 生成图像 │
│ ↓ │
│ 2. 使用 Gemini 3 Pro 审核质量 │
│ ↓ │
│ 3. 分数 >= 阈值? │
│ 是 → 完成!(提前停止) │
│ 否 → 改进提示,转到步骤 1 │
│ ↓ │
│ 4. 重复直到质量达标或达到最大迭代次数 │
└─────────────────────────────────────────────────────┘
提示构建:
科学图表指南 + 用户请求
输出: diagram_v1.png
Gemini 3 Pro 从以下方面评估图表:
示例审核输出:
分数:8.0
优点:
- 从上到下的清晰流程
- 所有阶段都正确标记
- 专业排版
问题:
- 参与者计数略小
- 排除框有轻微重叠
判定:可接受(对于海报,阈值 7.0)
| 如果分数... | 操作 |
|---|
= 阈值 | 停止 - 质量对此文档类型足够好
< 阈值 | 使用改进的提示继续下一次迭代
示例:
如果质量低于阈值,系统会:
所有迭代都保存为 JSON 审核日志,包含提前停止信息:
{
"user_prompt": "CONSORT 参与者流程图...",
"doc_type": "poster",
"quality_threshold": 7.0,
"iterations": [
{
"iteration": 1,
"image_path": "figures/consort_v1.png",
"score": 7.5,
"needs_improvement": false,
"critique": "分数:7.5\n优点:..."
}
],
"final_score": 7.5,
"early_stop": true,
"early_stop_reason": "质量分数 7.5 满足海报的阈值 7.0"
}
注意: 使用智能迭代,如果质量提前达标,您可能只看到 1 次迭代而不是完整的 2 次!
from scripts.generate_schematic_ai import ScientificSchematicGenerator
# 初始化生成器
generator = ScientificSchematicGenerator(
api_key="your_openrouter_key",
verbose=True
)
# 使用迭代优化生成(最多 2 次迭代)
results = generator.generate_iterative(
user_prompt="Transformer 架构图",
output_path="figures/transformer.png",
iterations=2
)
# 访问结果
print(f"最终分数:{results['final_score']}/10")
print(f"最终图像:{results['final_image']}")
# 审核各个迭代
for iteration in results['iterations']:
print(f"迭代 {iteration['iteration']}:{iteration['score']}/10")
print(f"批评:{iteration['critique']}")
# 基本用法(默认阈值 7.5/10)
python scripts/generate_schematic.py "图表描述" -o output.png
# 指定文档类型以使用适当的质量阈值
python scripts/generate_schematic.py "图表" -o out.png --doc-type journal # 8.5/10
python scripts/generate_schematic.py "图表" -o out.png --doc-type conference # 8.0/10
python scripts/generate_schematic.py "图表" -o out.png --doc-type poster # 7.0/10
python scripts/generate_schematic.py "图表" -o out.png --doc-type presentation # 6.5/10
# 自定义最大迭代次数(1-2)
python scripts/generate_schematic.py "复杂图表" -o diagram.png --iterations 2
# 详细输出(查看所有 API 调用和审核)
python scripts/generate_schematic.py "流程图" -o flow.png -v
# 通过标志提供 API 密钥
python scripts/generate_schematic.py "图表" -o out.png --api-key "sk-or-v1-..."
# 组合选项
python scripts/generate_schematic.py "神经网络" -o nn.png --doc-type journal --iterations 2 -v
1. 具体说明布局:
✓ "垂直流向、从上到下的流程图"
✓ "左侧为编码器、右侧为解码器的架构图"
✓ "顺时针流向的圆形通路图"
2. 包含定量细节:
✓ "神经网络,输入层(784 个节点),隐藏层(128 个节点),输出层(10 个节点)"
✓ "流程图显示 n=500 筛选,n=150 排除,n=350 随机分组"
✓ "电路包含 1kΩ 电阻器、10µF 电容器、5V 电源"
3. 指定视觉样式:
✓ "简洁线条的极简主义框图"
✓ "包含蛋白质结构的详细生物通路图"
✓ "使用工程符号的技术原理图"
4. 请求特定标签:
✓ "用激活/抑制标记所有箭头"
✓ "在每个框中包含层维度"
✓ "用时间戳显示时间进程"
5. 提及颜色要求:
✓ "使用色盲友好颜色"
✓ "灰度兼容设计"
✓ "按功能颜色编码:蓝色表示输入,绿色表示处理,红色表示输出"
python scripts/generate_schematic.py \
"随机对照试验的 CONSORT 参与者流程图。 \
顶部从'评估资格(n=500)'开始。 \
显示'排除(n=150)'及原因:年龄<18(n=80),拒绝(n=50),其他(n=20)。 \
然后'随机分组(n=350)'分为两组: \
'治疗组(n=175)'和'对照组(n=175)'。 \
每组显示'失访'(n=15 和 n=10)。 \
以'分析'(n=160 和 n=165)结束。 \
过程步骤用蓝色框,排除用橙色,最终分析用绿色。" \
-o figures/consort.png
python scripts/generate_schematic.py \
"Transformer 编码器-解码器架构图。 \
左侧:编码器堆栈,包含输入嵌入、位置编码、 \
多头自注意力、相加与归一化、前馈网络、相加与归一化。 \
右侧:解码器堆栈,包含输出嵌入、位置编码、 \
掩码自注意力、相加与归一化、交叉注意力(接收来自编码器)、 \
相加与归一化、前馈网络、相加与归一化、线性层和 softmax。 \
用虚线显示从编码器到解码器的交叉注意力连接。 \
编码器用浅蓝色,解码器用浅红色。 \
清晰标记所有组件。" \
-o figures/transformer.png --iterations 2
python scripts/generate_schematic.py \
"MAPK 信号通路图。 \
从细胞膜(顶部)的 EGFR 受体开始。 \
向下箭头到 RAS(标记 GTP)。 \
箭头到 RAF 激酶。 \
箭头到 MEK 激酶。 \
箭头到 ERK 激酶。 \
最后箭头到细胞核,显示基因转录。 \
每个箭头标记'磷酸化'或'激活'。 \
蛋白质用圆角矩形,每种用不同颜色。 \
顶部包含膜边界线。" \
-o figures/mapk_pathway.png
python scripts/generate_schematic.py \
"物联网系统架构框图。 \
底层:传感器(温度、湿度、运动)用绿色框。 \
中间层:微控制器(ESP32)用蓝色框。 \
连接到 WiFi 模块(橙色框)和显示器(紫色框)。 \
顶层:云服务器(灰色框)连接到移动应用(浅蓝色框)。 \
显示所有组件之间的数据流箭头。 \
用协议标记连接:I2C、UART、WiFi、HTTPS。" \
-o figures/iot_architecture.png
生成科学示意图的主要入口点:
# 基本用法
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 Pro AI 生成系统在其迭代优化过程中包含自动质量审核。每次迭代都会评估科学准确性、清晰度和可访问性。
\includegraphics{}问题:文本或元素重叠
--iterations 2 以获得更好的优化问题:元素连接不当
问题:导出质量差
--iterations 2问题:生成后元素重叠
--iterations 2 以获得更好的优化问题:误报重叠检测
detect_overlaps(image_path, threshold=0.98)问题:生成的图像质量低
--iterations 2问题:色盲模拟显示对比度差
问题:检测到高严重性重叠
问题:视觉报告生成失败
Image.open(path).verify()问题:灰度下颜色无法区分
verify_accessibility(image_path)问题:打印时文本太小
validate_resolution(image_path)问题:可访问性检查持续失败
加载这些文件以获取特定主题的全面信息:
references/diagram_types.md - 科学图表类型目录及示例references/best_practices.md - 发表标准和可访问性指南Python 库
发表标准
此技能与以下技能协同工作:
提交图表前,验证:
run_quality_checks() 并获得 PASS 状态quality_reports/ 目录中\ref{} 指向正确的图表)# 必需
export OPENROUTER_API_KEY='your_api_key_here'
# 获取密钥:https://openrouter.ai/keys
最简单的用法:
python scripts/generate_schematic.py "您的图表描述" -o output.png
使用此技能创建清晰、可访问、符合发表质量的图表,以有效传达复杂的科学概念。AI 驱动的工作流与迭代优化确保图表符合专业标准。
每周安装次数
296
仓库
GitHub 星标
22.6K
首次出现
Jan 21, 2026
安全审计
安装于
opencode240
gemini-cli227
claude-code225
codex208
cursor198
github-copilot187
Scientific schematics and diagrams transform complex concepts into clear visual representations for publication. This skill uses Nano Banana Pro AI for diagram generation with Gemini 3 Pro quality review.
How it works:
Quality Thresholds by Document Type:
| Document Type | Threshold | Description |
|---|---|---|
| journal | 8.5/10 | Nature, Science, peer-reviewed journals |
| conference | 8.0/10 | Conference papers |
| thesis | 8.0/10 | Dissertations, theses |
| grant | 8.0/10 | Grant proposals |
| preprint | 7.5/10 | arXiv, bioRxiv, etc. |
| report | 7.5/10 | Technical reports |
| poster | 7.0/10 | Academic posters |
| presentation | 6.5/10 | Slides, talks |
| default | 7.5/10 | General purpose |
Simply describe what you want, and Nano Banana Pro creates it. All diagrams are stored in the figures/ subfolder and referenced in papers/posters.
Create any scientific diagram by simply describing it. Nano Banana Pro handles everything automatically with smart iteration :
# Generate for journal paper (highest quality threshold: 8.5/10)
python scripts/generate_schematic.py "CONSORT participant flow diagram with 500 screened, 150 excluded, 350 randomized" -o figures/consort.png --doc-type journal
# Generate for presentation (lower threshold: 6.5/10 - faster)
python scripts/generate_schematic.py "Transformer encoder-decoder architecture showing multi-head attention" -o figures/transformer.png --doc-type presentation
# Generate for poster (moderate threshold: 7.0/10)
python scripts/generate_schematic.py "MAPK signaling pathway from EGFR to gene transcription" -o figures/mapk_pathway.png --doc-type poster
# Custom max iterations (max 2)
python scripts/generate_schematic.py "Complex circuit diagram with op-amp, resistors, and capacitors" -o figures/circuit.png --iterations 2 --doc-type journal
What happens behind the scenes:
Smart Iteration Benefits:
Output : Versioned images plus a detailed review log with quality scores, critiques, and early-stop information.
Set your OpenRouter API key:
export OPENROUTER_API_KEY='your_api_key_here'
Get an API key at: https://openrouter.ai/keys
Effective Prompts for Scientific Diagrams:
✓ Good prompts (specific, detailed):
✗ Avoid vague prompts :
Key elements to include:
Scientific Quality Guidelines (automatically applied):
This skill should be used when:
Simply describe your diagram in natural language. Nano Banana Pro generates it automatically:
python scripts/generate_schematic.py "your diagram description" -o output.png
That's it! The AI handles:
Works for all diagram types:
No coding, no templates, no manual drawing required.
The AI generation system uses smart iteration - it only regenerates if quality is below the threshold for your document type:
┌─────────────────────────────────────────────────────┐
│ 1. Generate image with Nano Banana Pro │
│ ↓ │
│ 2. Review quality with Gemini 3 Pro │
│ ↓ │
│ 3. Score >= threshold? │
│ YES → DONE! (early stop) │
│ NO → Improve prompt, go to step 1 │
│ ↓ │
│ 4. Repeat until quality met OR max iterations │
└─────────────────────────────────────────────────────┘
Prompt Construction:
Scientific diagram guidelines + User request
Output: diagram_v1.png
Gemini 3 Pro evaluates the diagram on:
Example Review Output:
SCORE: 8.0
STRENGTHS:
- Clear flow from top to bottom
- All phases properly labeled
- Professional typography
ISSUES:
- Participant counts slightly small
- Minor overlap on exclusion box
VERDICT: ACCEPTABLE (for poster, threshold 7.0)
| If Score... | Action |
|---|
= threshold | STOP - Quality is good enough for this document type
< threshold | Continue to next iteration with improved prompt
Example:
If quality is below threshold, the system:
All iterations are saved with a JSON review log that includes early-stop information:
{
"user_prompt": "CONSORT participant flow diagram...",
"doc_type": "poster",
"quality_threshold": 7.0,
"iterations": [
{
"iteration": 1,
"image_path": "figures/consort_v1.png",
"score": 7.5,
"needs_improvement": false,
"critique": "SCORE: 7.5\nSTRENGTHS:..."
}
],
"final_score": 7.5,
"early_stop": true,
"early_stop_reason": "Quality score 7.5 meets threshold 7.0 for poster"
}
Note: With smart iteration, you may see only 1 iteration instead of the full 2 if quality is achieved early!
from scripts.generate_schematic_ai import ScientificSchematicGenerator
# Initialize generator
generator = ScientificSchematicGenerator(
api_key="your_openrouter_key",
verbose=True
)
# Generate with iterative refinement (max 2 iterations)
results = generator.generate_iterative(
user_prompt="Transformer architecture diagram",
output_path="figures/transformer.png",
iterations=2
)
# Access results
print(f"Final score: {results['final_score']}/10")
print(f"Final image: {results['final_image']}")
# Review individual iterations
for iteration in results['iterations']:
print(f"Iteration {iteration['iteration']}: {iteration['score']}/10")
print(f"Critique: {iteration['critique']}")
# Basic usage (default threshold 7.5/10)
python scripts/generate_schematic.py "diagram description" -o output.png
# Specify document type for appropriate quality threshold
python scripts/generate_schematic.py "diagram" -o out.png --doc-type journal # 8.5/10
python scripts/generate_schematic.py "diagram" -o out.png --doc-type conference # 8.0/10
python scripts/generate_schematic.py "diagram" -o out.png --doc-type poster # 7.0/10
python scripts/generate_schematic.py "diagram" -o out.png --doc-type presentation # 6.5/10
# Custom max iterations (1-2)
python scripts/generate_schematic.py "complex diagram" -o diagram.png --iterations 2
# Verbose output (see all API calls and reviews)
python scripts/generate_schematic.py "flowchart" -o flow.png -v
# Provide API key via flag
python scripts/generate_schematic.py "diagram" -o out.png --api-key "sk-or-v1-..."
# Combine options
python scripts/generate_schematic.py "neural network" -o nn.png --doc-type journal --iterations 2 -v
1. Be Specific About Layout:
✓ "Flowchart with vertical flow, top to bottom"
✓ "Architecture diagram with encoder on left, decoder on right"
✓ "Circular pathway diagram with clockwise flow"
2. Include Quantitative Details:
✓ "Neural network with input layer (784 nodes), hidden layer (128 nodes), output (10 nodes)"
✓ "Flowchart showing n=500 screened, n=150 excluded, n=350 randomized"
✓ "Circuit with 1kΩ resistor, 10µF capacitor, 5V source"
3. Specify Visual Style:
✓ "Minimalist block diagram with clean lines"
✓ "Detailed biological pathway with protein structures"
✓ "Technical schematic with engineering notation"
4. Request Specific Labels:
✓ "Label all arrows with activation/inhibition"
✓ "Include layer dimensions in each box"
✓ "Show time progression with timestamps"
5. Mention Color Requirements:
✓ "Use colorblind-friendly colors"
✓ "Grayscale-compatible design"
✓ "Color-code by function: blue for input, green for processing, red for output"
python scripts/generate_schematic.py \
"CONSORT participant flow diagram for randomized controlled trial. \
Start with 'Assessed for eligibility (n=500)' at top. \
Show 'Excluded (n=150)' with reasons: age<18 (n=80), declined (n=50), other (n=20). \
Then 'Randomized (n=350)' splits into two arms: \
'Treatment group (n=175)' and 'Control group (n=175)'. \
Each arm shows 'Lost to follow-up' (n=15 and n=10). \
End with 'Analyzed' (n=160 and n=165). \
Use blue boxes for process steps, orange for exclusion, green for final analysis." \
-o figures/consort.png
python scripts/generate_schematic.py \
"Transformer encoder-decoder architecture diagram. \
Left side: Encoder stack with input embedding, positional encoding, \
multi-head self-attention, add & norm, feed-forward, add & norm. \
Right side: Decoder stack with output embedding, positional encoding, \
masked self-attention, add & norm, cross-attention (receiving from encoder), \
add & norm, feed-forward, add & norm, linear & softmax. \
Show cross-attention connection from encoder to decoder with dashed line. \
Use light blue for encoder, light red for decoder. \
Label all components clearly." \
-o figures/transformer.png --iterations 2
python scripts/generate_schematic.py \
"MAPK signaling pathway diagram. \
Start with EGFR receptor at cell membrane (top). \
Arrow down to RAS (with GTP label). \
Arrow to RAF kinase. \
Arrow to MEK kinase. \
Arrow to ERK kinase. \
Final arrow to nucleus showing gene transcription. \
Label each arrow with 'phosphorylation' or 'activation'. \
Use rounded rectangles for proteins, different colors for each. \
Include membrane boundary line at top." \
-o figures/mapk_pathway.png
python scripts/generate_schematic.py \
"IoT system architecture block diagram. \
Bottom layer: Sensors (temperature, humidity, motion) in green boxes. \
Middle layer: Microcontroller (ESP32) in blue box. \
Connections to WiFi module (orange box) and Display (purple box). \
Top layer: Cloud server (gray box) connected to mobile app (light blue box). \
Show data flow arrows between all components. \
Label connections with protocols: I2C, UART, WiFi, HTTPS." \
-o figures/iot_architecture.png
The main entry point for generating scientific schematics:
# Basic usage
python scripts/generate_schematic.py "diagram description" -o output.png
# Custom iterations (max 2)
python scripts/generate_schematic.py "complex diagram" -o diagram.png --iterations 2
# Verbose mode
python scripts/generate_schematic.py "diagram" -o out.png -v
Note: The Nano Banana Pro AI generation system includes automatic quality review in its iterative refinement process. Each iteration is evaluated for scientific accuracy, clarity, and accessibility.
\includegraphics{} for generated imagesProblem : Overlapping text or elements
--iterations 2 for better refinementProblem : Elements not connecting properly
Problem : Export quality poor
--iterations 2Problem : Elements overlap after generation
--iterations 2 for better refinementProblem : False positive overlap detection
detect_overlaps(image_path, threshold=0.98)Problem : Generated image quality is low
--iterations 2Problem : Colorblind simulation shows poor contrast
Problem : High-severity overlaps detected
Problem : Visual report generation fails
Image.open(path).verify()Problem : Colors indistinguishable in grayscale
verify_accessibility(image_path)Problem : Text too small when printed
validate_resolution(image_path)Problem : Accessibility checks consistently fail
Load these files for comprehensive information on specific topics:
references/diagram_types.md - Catalog of scientific diagram types with examplesreferences/best_practices.md - Publication standards and accessibility guidelinesPython Libraries
Publication Standards
This skill works synergistically with:
Before submitting diagrams, verify:
run_quality_checks() and achieved PASS statusquality_reports/ directory\ref{} points to correct figure)# Required
export OPENROUTER_API_KEY='your_api_key_here'
# Get key at: https://openrouter.ai/keys
Simplest possible usage:
python scripts/generate_schematic.py "your diagram description" -o output.png
Use this skill to create clear, accessible, publication-quality diagrams that effectively communicate complex scientific concepts. The AI-powered workflow with iterative refinement ensures diagrams meet professional standards.
Weekly Installs
296
Repository
GitHub Stars
22.6K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
opencode240
gemini-cli227
claude-code225
codex208
cursor198
github-copilot187
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
41,800 周安装