Create publication-quality scientific diagrams using Nano Banana 2 AI with smart iterative refinement. Uses Gemini 3.1 Pro Preview for quality review. Only regenerates if quality is below threshold for your document type. Specialized in neural network architectures, system diagrams, flowcharts, biological pathways, and complex scientific visualizations.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Create publication-quality scientific diagrams using Nano Banana 2 AI with smart iterative refinement. Uses Gemini 3.1 Pro Preview for quality review. Only regenerates if quality is below threshold for your document type. Specialized in neural network architectures, system diagrams, flowcharts, biological pathways, and complex scientific visualizations.
allowed-tools
Read Write Edit Bash
license
MIT license
required_environment_variables
[{"name":"OPENROUTER_API_KEY","prompt":"OpenRouter API key for the skill's LLM-powered steps.","required_for":"optional features"}]
metadata
{"version":"1.1","skill-author":"K-Dense Inc.","openclaw":{"primaryEnv":"OPENROUTER_API_KEY","envVars":[{"name":"OPENROUTER_API_KEY","required":false,"description":"OpenRouter API key for the skill's LLM-powered steps."}]}}
Scientific Schematics and Diagrams
Overview
Scientific schematics and diagrams transform complex concepts into clear visual representations for publication. This skill uses Nano Banana 2 AI for diagram generation with Gemini 3.1 Pro Preview quality review.
"CONSORT flowchart showing participant flow from screening (n=500) through randomization to final analysis"
"Transformer neural network architecture with encoder stack on left, decoder stack on right, showing multi-head attention and cross-attention connections"
Layout and Composition (0-2 points) - Logical flow, balanced, no overlaps
Professional Appearance (0-2 points) - Publication-ready quality
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)
Decision Point: Continue or Stop?
If Score...
Action
>= threshold
STOP - Quality is good enough for this document type
< threshold
Continue to next iteration with improved prompt
Example:
For a poster (threshold 7.0): Score of 7.5 โ DONE after 1 iteration!
For a journal (threshold 8.5): Score of 7.5 โ Continue improving
Subsequent Iterations (Only If Needed)
If quality is below threshold, the system:
Extracts specific issues from Gemini 3.1 Pro Preview's review
Enhances the prompt with improvement instructions
Regenerates with Nano Banana 2
Reviews again with Gemini 3.1 Pro Preview
Repeats until threshold met or max iterations reached
Review Log
All iterations are saved with a JSON review log that includes early-stop information:
# 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
Prompt Engineering Tips
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"
โ "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"
AI Generation Examples
Example 1: CONSORT Flowchart
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
Example 2: Neural Network Architecture
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
Example 3: Biological Pathway
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
Example 4: System Architecture
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
Command-Line Usage
The main entry point for generating scientific schematics:
Note: The Nano Banana 2 AI generation system includes automatic quality review in its iterative refinement process. Each iteration is evaluated for scientific accuracy, clarity, and accessibility.
Best Practices Summary
Design Principles
Clarity over complexity - Simplify, remove unnecessary elements
Consistent styling - Use templates and style files
Colorblind accessibility - Use Okabe-Ito palette, redundant encoding
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.