foryourhealth111-pixel/Vibe-Skills / bundled/skills/scientific-schematics
scientific-schematics
UnverifiedCreate publication-quality scientific diagrams using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 23.2 KB |
| references/QUICK_REFERENCE.md | markdown | 4.7 KB |
| references/README.md | markdown | 8.5 KB |
| references/best_practices.md | markdown | 15.5 KB |
| scripts/example_usage.sh | script | 3.0 KB |
| scripts/generate_schematic.py | script | 4.9 KB |
| scripts/generate_schematic_ai.py | script | 32.4 KB |
references/QUICK_REFERENCE.md
View on GitHub# 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 stacks" \
-o transformer.png
```
### Biological Pathway
```bash
python scripts/generate_schematic.py \
"MAPK pathway: EGFR → RAS → RAF → MEK → ERK" \
-o mapk.png
```
### Circuit Diagram
```bash
python scripts/generate_schematic.py \
"Op-amp circuit with 1kΩ resistor and 10µF capacitor" \
-o circuit.png
```
## Command Options
| Option | Description | Example |
|--------|-------------|---------|
| `-o, --output` | Output file path | `-o figures/diagram.png` |
| `--iterations N` | Number of refinements (1-2) | `--iterations 2` |
| `-v, --verbose` | Show detailed output | `-v` |
| `--api-key KEY` | Provide API key | `--api-key sk-or-v1-...` |
## Prompt Tips
### ✓ Good Prompts (Specific)
- "CONSORT flowchart with screening (n=500), exclusion (n=150), randomization (n=350)"
- "Transformer architecture: encoder on left with 6 layers, decoder on right, cross-attention connections"
- "MAPK signaling: receptor → RAS → RAF → MEK → ERK → nucleus, label each phosphorylation"
### ✗ Avoid (Too Vague)
- "Make a flowchart"
- "Neural network"
- "Pathway diagram"
## Output Files
For input `diagram.png`, you get:
- `diagram_v1.png` - First iteration
- `diagram_v2.png` - Second iteration
- `diagram_v3.png` - Final iteration
- `diagram.png` - Copy of final
- `diagram_review_log.json` - Quality scores and critiques
## Review Log
```json
{
"iterations": [
{
"iteration": 1,
"score": 7.0,
"critique": "Good start. Font too small..."
},
{
"iteration": 2,
"score": 8.5,
"critique": "Much improved. Minor spacing issues..."
},
{
"iteration": 3,
"score": 9.5,
"critique": "Excellent. Publication ready."
}
],
"final_score": 9.5
}
```
## Python API
```python
from scripts.generate_schematic_ai import ScientificSchematicGenerator
# Initialize
gen = ScientificSchematicGenerator(api_key="your_key")
# Generate
results = gen.generate_iterative(
user_prompt="diagram description",
output_path="output.png",
iterations=2
)
# Check quality
print(f"Score: {results['final_score']}/10")
```
## Troubleshooting
### API Key Not Found
```bash
# Check if set
echo $OPENROUTER_API_KEY
# Set it
export OPENROUTER_API_KEY='your_key'
```
### Import Error
```bash
# Install requests
pip install requests
```
### Low Quality Score
- Make prompt more specific
- Include layout details (left-to-right, top-to-bottom)
- Specify label requirements
- Increase iterations: `--iterations 2`
## Testing
```bash
# Verify installation
python test_ai_generation.py
# Should show: "6/6 tests passed"
```
## Cost
Typical cost per diagram (max 2 iterations):
- Simple (1 iteration): $0.05-0.15
- Complex (2 iterations): $0.10-0.30
## How Nano Banana Pro Works
**Simply describe your diagram in natural language:**
- ✓ No coding required
- ✓ No templates needed
- ✓ No manual drawing
- ✓ Automatic quality review
- ✓ Publication-ready output
- ✓ Works for any diagram type
**Just describe what you want, and it's generated automatically.**
## Getting Help
```bash
# Show help
python scripts/generate_schematic.py --help
# Verbose mode for debugging
python scripts/generate_schematic.py "diagram" -o out.png -v
```
## Quick Start Checklist
- [ ] Set `OPENROUTER_API_KEY` environment variable
- [ ] Run `python test_ai_generation.py` (should pass 6/6)
- [ ] Try: `python scripts/generate_schematic.py "test diagram" -o test.png`
- [ ] Review output files (test_v1.png, v2, v3, review_log.json)
- [ ] Read SKILL.md for detailed documentation
- [ ] Check README.md for examples
## Resources
- Full documentation: `SKILL.md`
- Detailed guide: `README.md`
- Implementation details: `IMPLEMENTATION_SUMMARY.md`
- Example script: `example_usage.sh`
- Get API key: https://openrouter.ai/keys
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |