An AI image generation Skill for the STEM (science, technology, engineering, mathematics) domain, focused on generatingresearch diagrams, teaching illustrations, technical architecture diagramsand other conceptual images, covering 6 major disciplines: biomedicine, chemistry, physics, engineering, and mathematics.
When to use
- The user wants to generate research diagrams, mechanism diagrams, flowcharts, workflow posters, teaching illustrations, academic figures, technical architecture diagrams
- The user provides a topic/paper/concept/data and expects an image (not limited to "research", including popular science, teaching, product technical diagrams)
- Discipline keyword triggers: signaling pathway, pathway, mechanism, cell structure, anatomy, experimental workflow, workflow, plasmid, plasmid, machine learning, neural network, mechanics, circuits, chemical structure, mathematical concepts, infographic, poster, cross-section, exploded view
Not applicable
- Real experimental data figures (scatter/bar/line charts, academic integrity) → refuse and suggest using GraphPad/Origin/Python matplotlib
- Photorealistic (portrait/landscape/product photography) → use a general image generation skill
- Creative illustration/cartoon characters → use a general image generation skill
Image generation configuration
Reuse scripts/generate_image.py, automatically compatible with the OpenAI synchronous API and the apimart.ai asynchronous API.
.env fields:
| Field | Required | Description |
|---|---|---|
IMG_BASE_URL |
Yes | API root URL |
IMG_MODEL |
Yes | Image model |
IMG_API_KEY |
Yes | API key |
Template:.env.example(including STEM recommended parameter descriptions).
Recommended sizes
| Use | Aspect ratio | Resolution |
|---|---|---|
| Journal single-column figure | 4:3 | 2K |
| Journal double-column figure | 16:9 | 2K |
| Vertical mechanism diagram (signaling pathway/tree) | 3:4 | 2K |
| Academic poster (A0/A1) | 2:3 | 2K |
| PPT/slide illustration | 16:9 | 2K |
| Square schematic diagram | 1:1 | 2K |
| Long workflow banner | 21:9 | 2K |
Core workflow (Brief / Prompt mode, 10 steps)
- Collect minimal input: discipline, chart type, target audience, key terminology list, size/aspect ratio, language
- Match scenario template(24, see references/templates/)
- Select variant:
academic/textbook/infographic/3d-render - Apply discipline hints(the template's
category_tips) - Apply STEM Prompt iron rules(see below)
- Assemble the 9-section Prompt(see below)
- Apply Campaign Style Lock(multi-image tasks)
- Self-check(see QA checklist)
- Output visual brief(in Chinese, including Prompt + invocation method)
- If the user explicitly requests image generation → call
scripts/generate_image.py
Minimal input
At least include:
- Discipline: life sciences/medicine/chemistry/physics/engineering/mathematics
- Chart type: template ID (e.g.
signaling-pathway、experimental-workflow) - Target audience: K-12 / High School / University / Graduate / Peer Researcher / Public Science Communication
- Key Terminology List: Terms that must be presented accurately, such as protein names, compounds, formulas, etc.
- Dimensions/Ratio: See the table above
- Language: Chinese / English / Bilingual
General Prompt Structure (9 Sections)
- Type: Diagram type (scientific mechanism diagram / data infographic / system architecture / ...)
- Subject: Theme (specific content)
- Layout: Layout (top-to-bottom / left-to-right / 2x2 grid / radial / ...)
- Style: Style (flat vector / textbook illustration / 3D render / infographic / ...)
- Color scheme: Use hex codes (
#2563eb、#10b981, etc.) - Labels: Fonts (Chinese: SimHei/Microsoft YaHei; English: Arial/Helvetica; use standard gene symbols for protein names; Latin names of anatomical terms in italics)
- Quality:4K / publication-ready / journal style
- Constraints: No fabrication, no incorrect directions, must include key elements
- Background:white / dark / gradient / transparent
STEM Prompt Iron Rules (10 Rules,Mandatory)
- Colors Use Hex Codes:
#10b981activation,#ef4444inhibition,#3b82f6membrane proteins,#2563ebmain data color - Directions Explicitly Stated:
top-to-bottom vertical cascade、left-to-right horizontal flow、clockwise/counter-clockwise - Fonts Explicitly Specified: Chinese: SimHei/Microsoft YaHei bold; English: Arial/Helvetica
- Terminology Standardized: Use
MAPK/ERKnot "cell signaling"; useB-form DNAnot "DNA"; Latin names of anatomical terms in italics in parentheses - Resolution and Ratio: Journal figures 4K, PPT 2K; single column 4:3, double column 16:9, vertical mechanism diagram 3:4
- Negative List: No fabricated data/validation/interactions/pathway branches; no incorrect arrow directions
- Annotation Conventions: activation solid line, inhibition dashed line (T-shaped); phosphorylation with red circle P; significance
*/**/***corresponds to p<0.05/0.01/0.001 - Chinese-English Mixed Typesetting:
线粒体 (Mitochondria), English in parentheses when Chinese is primary; harmonize font sizes for Chinese and English - Multi-Panel Numbering: A/B/C/D bold in the upper-left corner of each panel
- Journal Compliance: Do not use AI to generate real experimental data figures (scatter/bar/line); conceptual diagrams only
Two-Stage Workflow (Complex Tasks)
Architect Stage (LLM Analysis)
Output [VISUAL SCHEMA]:
LAYOUT: 2x2 grid of 4 panels
PANEL A: [Top-left] Experimental workflow (5 steps)
PANEL B: [Top-right] Representative Western blot image
PANEL C: [Bottom-left] Quantification bar chart
PANEL D: [Bottom-right] Mechanism diagram
COLOR: Blue #2563eb primary, gray #6b7280 secondary
PANEL LABELS: A/B/C/D bold top-left
SHARED: Scale bar, statistical markers */**
Renderer Stage (LLM to Prompt)
Translate the Schema into a 9-section Prompt, apply the iron rules, and generate the final image-generation Prompt.
⚠️ Capability Boundaries (Important: When Not to Use This Skill)
AI image generation models (gpt-image-2, DALL-E, Midjourney, Stable Diffusion, etc.) arepattern matchers, not geometry engines. They can render images that "look right," butcannot guarantee:
- Parallel lines are truly parallel, right angles are truly 90°
- Triangles are truly congruent (side lengths exactly equal)
- Geometric relationships strictly correspond to formulas
- Formulas/text have no spelling errors
✅ AI image generationis suitable(recommended to use this Skill)
- Conceptual diagrams, flowcharts, infographics
- Signaling pathways, cell structures (annotations accurate is sufficient; geometry need not be precise)
- Mechanical structure cross-sectional view (visual clarity is sufficient)
- Posters, covers, teaching illustrations
- Stylized, decorative, instructional diagrams
❌ AI image generationNot suitable(Must be generated with code or drawn manually)
- Rigorous mathematical proof diagrams(e.g., Pythagorean theorem, Euclidean geometry proofs, vector/matrix diagrams)
- Coordinate plots, function graphs(coordinate systems, parabolas, sine curves, etc.)
- Precise construction diagrams(e.g., inscribed polygons in circles, angle bisectors, similar triangle proofs)
- Circuit diagrams, chemical structure formulas (precise bond lengths/angles)— unless they are instructional schematic diagrams
- Data charts (bar charts/line charts/heatmaps)— must use code tools such as matplotlib/plotly
🛠️ Correct approach for rigorous geometry/math diagrams
Use scripts/generate_geometry.py(based on matplotlib), or:
- matplotlib +
matplotlib.patches: precisely draw polygons, angle markers, area fills - TikZ / pgfplots(LaTeX): academic paper-level mathematical diagrams
- GeoGebra: interactive geometry
- Asymptote: precise geometric programming
- desmos.com / Wolfram Alpha: function graphs
Judgment principle: If the diagram requires "geometric correctness" to convey information (mathematical proofs, precise data charts, coordinate transformations) → it must be generated with code. If the diagram only needs to "visually convey" a concept (process, mechanism, structure) → AI image generation can be used.
Scenario template system
24 templates are located in references/templates/, numbered by scenario:
| # | Template ID | Scenario |
|---|---|---|
| 01 | signaling-pathway | Signaling pathway/molecular mechanism diagram |
| 02 | experimental-workflow | Experimental workflow/technical roadmap |
| 03 | cell-structure | Cell/anatomical structure diagram |
| 04 | data-infographic | Data visualization infographic |
| 05 | academic-poster | Bilingual academic poster |
| 06 | concept-infographic | Conceptual educational infographic |
| 07 | timeline | History of science timeline |
| 08 | comparison-matrix | Comparison matrix |
| 09 | cross-section | Cross-section/cutaway view |
| 10 | hub-spoke | Hub-and-spoke diagram |
| 11 | hierarchical-tree | Hierarchical tree/classification tree |
| 12 | cyclic-flow | Cyclic flowchart |
| 13 | multi-panel-figure | Multi-panel figure (Figure 1A-F) |
| 14 | plasmid-map | Plasmid map/molecular structure diagram |
| 15 | machine-mechanism | Mechanical/engineering schematic |
| 16 | physics-schematic | Physics principle schematic |
| 17 | chemistry-structure | Chemical structure/reaction mechanism |
| 18 | math-concept | Mathematical concept visualization |
| 19 | graphical-abstract | Paper graphical abstract |
| 20 | lab-safety | Laboratory safety/operating procedures |
| 21 | educational-poster | Teaching poster (K-12/higher education) |
| 22 | step-by-step | Step-by-step instruction diagram |
| 23 | architecture-diagram | System/algorithm architecture diagram |
| 24 | bilingual-diagram | Chinese-English bilingual general-purpose diagram |
Fields for each template:id / name / keywords / trigger_phrases / prompt_template / defaults / variants / category_tips / examples / accuracy_tips / supports_image_reference。
Discipline adaptation
| Discipline | Recommended template | Key tips |
|---|---|---|
| Life sciences | 01/03/12/14 | Cross-reference KEGG/UniProt; phosphorylation markers; double-membrane structure |
| Medicine | 03/05/09/19 | Latin anatomical terminology; MOA cascade; clinical labels |
| Chemistry | 14/17 | Reaction conditions labeled on arrows; CPK color scheme; IUPAC nomenclature |
| Physics | 09/15/16 | Vector arrows with units; right-hand rule; P-V diagram |
| Engineering | 13/15/23 | Exploded view with part numbers; ISO standard; tolerance annotation |
| Math/CS | 11/18/23 | LaTeX typesetting; algorithm flow; network topology |
Campaign Style Lock (multi-image tasks,mandatory)
An entire paper's Figures, a series of teaching cards, and a textbook illustration set must be locked to:
- Fixed color palette: 2-3 primary colors + 1 accent color, all hex
- Unified fonts: one Chinese font + one English font
- Unified arrows/lines: consistent line width, color, and endpoints
- Unified background: pure white
#FFFFFFor light gray#F8FAFC - Unified annotation boxes: rounded rectangles, semi-transparent white background
- No drift: do not change primary colors, fonts, or line widths because of new images
Multi-subfigure composition rules
- Labels A/B/C/D in bold placed at the top-left corner of each subfigure
- Unified style across subfigures (fonts/line widths/color scheme)
- Shared axes and scale bars
- Consistent statistical markers (*/**/*** corresponding to p<0.05/0.01/0.001)
- Compound numbering and molecular weight labels consistent across subfigures
Journal compliance and academic integrity (mandatory)
Allowed (conceptual schematics)
- Signaling pathways, mechanism diagrams, flowcharts, architecture diagrams
- Cell/anatomy/chemical structure schematics
- Teaching illustrations, conceptual infographics, posters
- Theoretical model schematics, working principle diagrams
Prohibited (academic misconduct)
- Using AI to generate statistical charts of real experimental data: scatter plots, bar charts, line charts, box plots
- Fabricated protein interactions, pathway branches
- Fabricated Western blot bands, PCR gel images, microscopy images (real images should be provided)
- Fabricated certifications, ratings, sales figures, reviews (same for e-commerce)
- Fabricated chemical reaction mechanisms, electron transfer directions
→ If the user requests it,refuse and suggest using GraphPad/Origin/Python matplotlib/seaborn。
Direct image generation rules
When the user explicitly requests "generate an image/render/generate":
- Use
scripts/generate_image.pyto call the API - Command example:
# 从 Prompt 文件生图 python scripts/generate_image.py --prompt-file ./prompt.txt --size 3:4 --resolution 2k # 从 stdin/字符串生图 python scripts/generate_image.py --prompt "..." --size 16:9 --resolution 2k # 参考图生图(图生图) python scripts/generate_image.py --prompt "..." --image ./reference.png --size 1:1 - Before generating the image, confirm with the user:discipline, template ID, variant, size, style
QA self-check checklist (mandatory)
- Terminology accuracy (against authoritative standards such as KEGG/UniProt/IUPAC/ISO)
- Correct direction/arrows (activation solid line, inhibition dashed T-bar, phosphorylation red circle P)
- Correct scale and hierarchy (organelle size, tree hierarchy)
- Colors meet colorblind-friendly standards (avoid pure red-green contrast)
- Accurate Chinese character strokes (check at 200% zoom)
- No fabricated experimental data/certifications/interactions
- Consistent multi-subfigure numbering (A/B/C/D)
- The 10 iron rules of the STEM Prompt have been applied
- Matched to the correct scenario template
- Campaign Style Lock applied for multi-image tasks
- Appropriate size and resolution selected
- Discipline applied
category_tips
Common pitfalls and safeguards
| Pitfall | Safeguard |
|---|---|
| Incorrect protein name | Mandatory cross-check against KEGG/UniProt; use standard gene symbols |
| Incorrect arrow direction | Prompt explicitly declares top-to-bottom / left-to-right |
| Fabricated anatomical structures | Label "not for clinical decision-making"; use generic schematics |
| Garish/unprofessional color scheme | Mandatory hex codes; colorblind-friendly; no more than 3 primary colors |
| Garbled/missing strokes in Chinese characters | Specify SimHei/Microsoft YaHei; zoom in to 200% to verify |
| Fabricated data charts | Mandatory use of real data tools; AI limited to conceptual diagrams |
| Style drift across the whole set of images | Mandatory Campaign Style Lock |
| Fabricated pathway branches | Strictly based on reference papers/databases; label citations |
| Incorrect chemical/reaction pathways | Reaction pathways must be verified against authoritative textbooks/literature (e.g., Clayden's Organic Chemistry, March's Advanced Organic Chemistry); when writing prompts, the LLM must not piece together reactions by intuition; users need to label citation sources |
| The model renders topic A as topic B | Add at the top of the prompt "PURE [discipline] illustration ONLY. NO [other discipline]. NO [other image type]." (e.g., PURE CHEMISTRY ONLY. NO biology, NO cells.) |
| Cross-disciplinary confusion of reactions/pathways(e.g., aspirin associated with cell biology) | Explicitly list the full names of key compounds (acetylsalicylic acid) and the usage scenario (antiplatelet); repeat at the end of the prompt "only molecular structures, no biological context" |
| Blurry rendering of structural formulas/small text | In asynchronous mode use --resolution 4k; the prompt requires bold high-contrast labels at 24pt+ |
| 🚨 AI image generation cannot guarantee mathematical/geometric precision | Geometric proof diagrams, coordinate graphs, and precise construction diagrams must be generated with scripts/generate_geometry.py or code tools such as matplotlib/TikZ/GeoGebra. AI image generation can only be used for conceptual diagrams where "looking right is enough." This is the most critical limitation of the Skill. |
Output format (Chinese)
Use the following structure when outputting to the user:
**【视觉简报】**
**学科**:生命科学(细胞信号通路)
**模板**:signaling-pathway
**变体**:academic(Nature 期刊风格)
**尺寸/分辨率**:3:4 / 2K
**目标受众**:研究生
**核心元素**:
- 脂双层 + RTK 受体(跨膜)
- RAS-RAF-MEK-ERK 级联
- 核内转录因子激活
- 磷酸化用红圈 P 标记
**配色**:
- 激活 #10b981
- 抑制 #ef4444
- 膜蛋白 #3b82f6
**Prompt**(英文,可直接用于生图):
[Scientific signaling pathway diagram, ... 完整 Prompt]
**调用方式**(如需生图):
python scripts/generate_image.py --prompt-file ./prompt.txt --size 3:4 --resolution 2k
Relationship with ecom-details-image
This Skill reuses the image generation script of ecom-details-image (unified OpenAI/apimart interface), extends beyond the e-commerce image scenario with 24 STEM scenario templates, and enforces higher requirements for academic integrity and scientific accuracy.