
Scientific Schematics
Generate publication-style scientific diagrams and flowcharts (e.g. CONSORT) from text prompts using an AI schematic script and OpenRouter.
Overview
scientific-schematics is an agent skill most often used in Build (also Validate, Ship) that AI-generates scientific diagrams such as CONSORT flowcharts into PNG figures via OpenRouter.
Install
npx skills add https://github.com/davila7/claude-code-templates --skill scientific-schematicsWhat is this skill?
- Python CLI generate_schematic.py turns natural-language layout descriptions into PNG figures
- Documented CONSORT participant flow example with eligibility, exclusion, and follow-up counts
- Requires OPENROUTER_API_KEY and Python 3.10+ with requests installed
- Writes iterative variants (v1, v2, v3) plus consort_example_review_log.json for review loops
- Example shell script demonstrates end-to-end figures/ output directory setup
- Example CONSORT flow uses n=500 assessed, n=350 randomized, and --iterations 2
- Outputs versioned PNGs plus consort_example_review_log.json
Adoption & trust: 780 installs on skills.sh; 27.8k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have precise study or system structure in words but lack time or tools to draw consistent scientific schematics by hand.
Who is it for?
Indie researchers, bio/health prototypes, and builders documenting experiments who already use OpenRouter and Python locally.
Skip if: Regulated submissions that mandate certified diagram software, offline-only workflows, or teams without API budget for image generation.
When should I use this skill?
User needs AI-generated scientific schematics, CONSORT flows, or publication figures via the bundled Python generator.
What do I get? / Deliverables
You run the schematic generator to produce reviewed PNG figures under figures/ with versioned outputs ready for docs, preprints, or validation packets.
- PNG schematic figures in figures/
- Optional multi-iteration variants and JSON review log
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Figures and methodology diagrams are build-time documentation artifacts that ship with research, product, or compliance narratives. Output lands in docs/figures for papers, readmes, and validation reports—not application runtime code.
Where it fits
Illustrate trial eligibility and arms while scoping a health-tech MVP for advisors.
Batch-generate neural or pathway schematics referenced in README and methods docs.
Attach CONSORT-style flows to internal review logs before external publication.
How it compares
Skill-packaged figure generator with iterative PNG outputs—not a general MCP drawing server or Figma integration.
Common Questions / FAQ
Who is scientific-schematics for?
Solo builders and small teams documenting scientific or clinical workflows who want agent-guided figure generation from text prompts.
When should I use scientific-schematics?
In Validate when you diagram study design for a landing proof, in Build when you author paper or product docs figures, and in Ship when you attach methodology schematics to review packets.
Is scientific-schematics safe to install?
It runs shell Python and calls OpenRouter with your API key—review the Security Audits panel on this Prism page, rotate keys, and inspect scripts before execution.
SKILL.md
READMESKILL.md - Scientific Schematics
#!/bin/bash # Example usage of AI-powered scientific schematic generation # # Prerequisites: # 1. Set OPENROUTER_API_KEY environment variable # 2. Ensure Python 3.10+ is installed # 3. Install requests: pip install requests set -e echo "==========================================" echo "Scientific Schematics - AI Generation" echo "Example Usage Demonstrations" echo "==========================================" echo "" # Check for API key if [ -z "$OPENROUTER_API_KEY" ]; then echo "❌ Error: OPENROUTER_API_KEY environment variable not set" echo "" echo "Get an API key at: https://openrouter.ai/keys" echo "Then set it with: export OPENROUTER_API_KEY='your_key'" exit 1 fi echo "✓ OPENROUTER_API_KEY is set" echo "" # Create output directory mkdir -p figures echo "✓ Created figures/ directory" echo "" # Example 1: Simple flowchart echo "Example 1: CONSORT Flowchart" echo "----------------------------" python scripts/generate_schematic.py \ "CONSORT participant flow diagram. Assessed for eligibility (n=500). Excluded (n=150) with reasons: age<18 (n=80), declined (n=50), other (n=20). Randomized (n=350) into Treatment (n=175) and Control (n=175). Lost to follow-up: 15 and 10. Final analysis: 160 and 165." \ -o figures/consort_example.png \ --iterations 2 echo "" echo "✓ Generated: figures/consort_example.png" echo " - Also created: consort_example_v1.png, v2.png, v3.png" echo " - Review log: consort_example_review_log.json" echo "" # Example 2: Neural network (shorter for demo) echo "Example 2: Simple Neural Network" echo "--------------------------------" python scripts/generate_schematic.py \ "Simple feedforward neural network diagram. Input layer with 4 nodes, hidden layer with 6 nodes, output layer with 2 nodes. Show all connections. Label layers clearly." \ -o figures/neural_net_example.png \ --iterations 2 echo "" echo "✓ Generated: figures/neural_net_example.png" echo "" # Example 3: Biological pathway (minimal) echo "Example 3: Signaling Pathway" echo "---------------------------" python scripts/generate_schematic.py \ "Simple signaling pathway: Receptor → Kinase A → Kinase B → Transcription Factor → Gene. Show arrows with 'activation' labels. Use different colors for each component." \ -o figures/pathway_example.png \ --iterations 2 echo "" echo "✓ Generated: figures/pathway_example.png" echo "" echo "==========================================" echo "All examples completed successfully!" echo "==========================================" echo "" echo "Generated files in figures/:" ls -lh figures/*example*.png 2>/dev/null || echo " (Files will appear after running with valid API key)" echo "" echo "Review the review_log.json files to see:" echo " - Quality scores for each iteration" echo " - Detailed critiques and suggestions" echo " - Improvement progression" echo "" echo "Next steps:" echo " 1. View the generated images" echo " 2. Review the quality scores in *_review_log.json" echo " 3. Try your own prompts!" echo "" # Scientific Schematics - Quick Reference **How it works:** Describe your diagram → Nano Banana Pro generates it automatically ## Setup (One-Time) ```bash # Get API key from https://openrouter.ai/keys export OPENROUTER_API_KEY='sk-or-v1-your_key_here' # Add to shell profile for persistence echo 'export OPENROUTER_API_KEY="sk-or-v1-your_key"' >> ~/.bashrc # or ~/.zshrc ``` ## Basic Usage ```bash # Describe your diagram, Nano Banana Pro creates it python scripts/generate_schematic.py "your diagram description" -o output.png # That's it! Automatic: # - Iterative refinement (3 rounds) # - Quality review and improvement # - Publication-ready output ``` ## Common Examples ### CONSORT Flowchart ```bash python scripts/generate_schematic.py \ "CONSORT flow: screened n=500, excluded n=150, randomized n=350" \ -o consort.png ``` ### Neural Network ```bash python scripts/generate_schematic.py \ "Transformer architecture with encoder and decoder st