paper-illustration skill
Generate publication-quality AI illustrations for academic papers using Gemini image generation. Creates architecture diagrams, method illustrations with Codex-supervised iterative refinement loop. Use when user says \"生成图表\", \"画架构图\", \"AI绘图\", \"paper illustration\", \"generate diagram\", or needs visual figures for papers.
Is the paper-illustration skill safe?
Clean: nothing in its files matched our rules. We read 1 file in the folder on 2026-09-28.
No findings.
Install the paper-illustration skill
A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.
git clone --depth 1 https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep.git /tmp/Auto-claude-code-research-in-sleep mkdir -p ~/.claude/skills cp -r /tmp/Auto-claude-code-research-in-sleep/skills/skills-codex/paper-illustration ~/.claude/skills/paper-illustration
In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub
The instructions your agent would load
SKILL.md as published, without the frontmatter. Read it on GitHub
Paper Illustration: Multi-Stage Codex-Supervised Figure Generation
Generate publication-quality illustrations using a multi-stage workflow with Codex as the STRICT supervisor/reviewer.
Core Design Philosophy
┌──────────────────────────────────────────────────────────────────────────┐
│ MULTI-STAGE ITERATIVE WORKFLOW │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ User Request │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Codex │ ◄─── Step 1: Parse request, create initial prompt │
│ │ (Planner) │ │
│ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Gemini │ ◄─── Step 2: Optimize layout description │
│ │ (gemini-3-pro)│ - Refine component pConstants
- IMAGEMODEL = gemini-3-pro-image-preview** — Paperbanana (Nano Banana Pro) for image rendering
- REASONINGMODEL = gemini-3-pro-preview** — Gemini for layout optimization and style checking
- MAXITERATIONS = 5** — Maximum refinement rounds
- TARGETSCORE = 9** — Minimum acceptable score (1-10) — RAISED FOR QUALITY
- OUTPUTDIR = figures/aigenerated/ — Output directory
- APIKEYENV = GEMINIAPIKEY — Environment variable
CVPR/ICLR/NeurIPS Top-Tier Conference Style Guide
What "CVPR Style" Actually Means:
Visual Standards
- Clean white background — No decorative patterns or gradients (unless subtle)
- Sans-serif fonts — Arial, Helvetica, or Computer Modern; minimum 14pt
- Subtle color palette — Not rainbow colors; use 3-5 coordinated colors
- Print-friendly — Must be readable in grayscale (many reviewers print papers)
- Professional borders — Thin (2-3px), solid colors, not flashy
Layout Standards
- Horizontal flow — Left-to-right is the standard for pipelines
- Clear grouping — Use subtle background boxes to group related modules
- Consistent sizing — Similar components should have similar sizes
- Balanced whitespace — Not cramped, not sparse
Arrow Standards (MOST CRITICAL)
- Thick strokes — 4-6px minimum (thin arrows disappear when printed)
- Clear arrowheads — Large, filled triangular heads
- Dark colors — Black or dark gray (#333333); avoid colored arrows
- Labeled — Every arrow should indicate what data flows through it
- No crossings — Reorganize layout to avoid arrow crossings
- CORRECT DIRECTION — Arrows must point to the RIGHT target!
Visual Appeal (科研风格 - Professional Academic Style)
目标:既不保守也不花哨,找到平衡点
✅ 应该有的视觉元素:
- Subtle gradient fills — 淡雅的渐变填充(同色系从浅到深),不是炫彩
- Rounded corners — 圆角矩形(6-10px radius),现代感但不夸张
- Clear visual hierarchy — 通过大小、颜色深浅区分层次
- Consistent color coding — 统一的配色方案(3-4种主色)
- Internal structure — 大模块内部显示子组件(如Encoder内部的layer结构)
- Professional typography — 清晰的标签,适当的字号层次
✅ 配色建议(学术专业):
- Inputs: 柔和的绿色系 (#10B981 / #34D399)
- Encoders: 专业的蓝色系 (#2563EB / #3B82F6)
- Fusion: 优雅的紫色系 (#7C3AED / #8B5CF6)
- Outputs: 温暖的橙色系 (#EA580C / #F97316)
- Arrows: 黑色或深灰 (#333333 / #1F2937)
- Background: 纯白 (#FFFFFF),不要花纹
❌ 要避免的过度装饰:
- ❌ Rainbow color schemes (彩虹配色)
- ❌ Heavy drop shadows (重阴影效果)
- ❌ 3D effects / perspective (3D透视)
- ❌ Excessive gradients (夸张的多色渐变)
- ❌ Clip art / cartoon icons (卡通图标)
- ❌ Decorative patterns in background (背景花纹)
- ❌ Glowing effects (发光效果)
- ❌ Too many small icons (过多小图标)
✓ 理想的视觉效果:
- 一眼看上去专业、清晰
- 有适度的视觉吸引力,但不抢眼
- 符合CVPR/NeurIPS论文的审美标准
- 打印友好(灰度模式下也能清晰辨认)
- 像精心设计的学术图表,而不是PPT模板
What to AVOID (CRITICAL)
- ❌ Rainbow color schemes (too many colors)
- ❌ Thin, hairline arrows (arrows must be THICK)
- ❌ Unlabeled connections
- ❌ Plain boring rectangles (add some visual interest)
- ❌ Over-decorated with shadows/glows/icons (too flashy)
- ❌ Small text that's unreadable when printed
- ❌ WRONG arrow directions — This is UNACCEPTABLE!
Scope
Not for: Statistical plots (use /paper-figure), photo-realistic images
Workflow: MUST EXECUTE ALL STEPS
Step 0: Pre-flight Check
# Check API key
if [ -z "$GEMINI_API_KEY" ]; then
echo "ERROR: GEMINI_API_KEY not set"
echo "Get your key from: https://aistudio.google.com/app/apikey"
echo "Set it: export GEMINI_API_KEY='your-key'"
exit 1
fi
# Create output directory
mkdir -p figures/ai_generatedStep 1: Codex Plans the Figure (YOU ARE HERE)
CRITICAL: Codex must first analyze the user's request and create a detailed prompt.
Parse the input: $ARGUMENTS
Codex's task:
- Understand what figure the user wants
- Identify all components, connections, data flow
- Create a detailed, structured prompt for Gemini
- Include style requirements AND visual appeal requirements
Prompt Template for Codex to generate:
Create a PROFESSIONAL, VISUALLY APPEALING publication-quality academic diagram following CVPR/ICLR/NeurIPS standards.
## Visual Style: 科研风格 (Academic Professional Style)
### 目标:平衡 — 既不保守也不花哨
#### DO (应该有):
- **Subtle gradients** — 同色系淡雅渐变(如 #2563EB → #3B82F6),不是多色炫彩
- **Rounded corners** — 圆角矩形(6-10px),现代感
- **Clear visual hierarchy** — 通过大小、深浅区分层次
- **Internal structure** — 大模块内显示子组件结构
- **Consistent color coding** — 统一的3-4色方案
- **Professional polish** — 精致但不夸张
#### DON'T (不要有):
- ❌ Rainbow/multi-color gradients (彩虹渐变)
- ❌ Heavy drop shadows (重阴影)
- ❌ 3D effects / perspective (3D效果)
- ❌ Glowing effects (发光效果)
- ❌ Excessive decorative icons (过多装饰图标)
- ❌ Plain boring rectangles (完全平淡的方块)
#### 理想效果:
像顶会论文中精心设计的架构图 — 专业、清晰、有适度的视觉吸引力
## Figure Type
[Architecture Diagram / Pipeline / Comparison / etc.]
## Components to Include (BE SPECIFIC ABOUT CONTENT)
1. [Component 1]:
- Label: "[exact text]"
- Sub-label: "[smaller text below]"
- Position: [left/center/right, top/middle/bottom]
- Style: [border color, fill, internal structure]
2. [Component 2]: ...
## Layout
- Direction: [left-to-right / top-to-bottom]
- Spacing: [tight / normal / loose]
- Grouping: [how componentsStep 2: Gemini Layout Optimization (gemini-3-pro)
Codex sends the initial prompt to Gemini (gemini-3-pro) for layout optimization.
#!/bin/bash
# Step 2: Optimize layout using Gemini gemini-3-pro
# This step refines component positioning and spacing
set -e
OUTPUT_DIR="figures/ai_generated"
mkdir -p "$OUTPUT_DIR"
API_KEY="${GEMINI_API_KEY}"
URL="https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent?key=$API_KEY"
# The initial prompt from Codex
INITIAL_PROMPT='[Codex fills in the detailed prompt here]'
# Layout optimization request
LAYOUT_REQUEST="You are an expert in academic figure layout design for CVPR/NeurIPS papers.
Analyze this figure request and provide an OPTIMIZED LAYOUT DESCRIPTION:
$INITIAL_PROMPT
Provide:
1. **Optimized Component Positions**: Exact positions (left/center/right, top/middle/bottom) for each component
2. **Spacing Recommendations**: Specific spacing between components
3. **Grouping Strategy**: Which components should be visually grouped together
4. **Arrow Routing**: Optimal paths for arrows to avoid crossings
5. **Visual Hierarchy**: Size recommendations for main vs sub-components
Output a DETAILED layout specification that will be used for rendering."
# Build JSON payload
python3 << PYTHON
import json
payload = {
"contents": [{"partStep 3: Gemini Style Verification (gemini-3-pro)
Codex sends the optimized layout to Gemini for CVPR/NeurIPS style verification.
#!/bin/bash
# Step 3: Verify and enhance style compliance using Gemini gemini-3-pro
API_KEY="${GEMINI_API_KEY}"
URL="https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent?key=$API_KEY"
# Read layout from previous step
LAYOUT=$(cat figures/ai_generated/layout_description.txt)
# Style verification request
STYLE_REQUEST="You are a CVPR/NeurIPS paper figure reviewer specializing in visual standards.
Review and ENHANCE this figure specification for top-tier conference compliance:
$LAYOUT
Ensure compliance with:
1. **Color Palette**: Use professional academic colors (green for inputs, blue for encoders, purple for fusion, orange for outputs)
2. **Arrow Standards**: Thick (5-6px), black/dark gray, clear arrowheads, all labeled
3. **Font Standards**: Sans-serif, minimum 14pt, readable in print
4. **Visual Appeal (科研风格)**:
- ✅ Subtle same-color gradients, rounded corners (6-10px), internal structure visible
- ❌ NO heavy shadows, NO glowing effects, NO rainbow gradients
Output an ENHANCED figure specification with explicit style instructions for rendering."
# Build JSON payload
python3 << PYTHON
import json
payload = {
"contents": [{"pStep 4: Paperbanana Image Rendering (gemini-3-pro-image-preview)
Codex sends the optimized, style-verified specification to Paperbanana for rendering.
#!/bin/bash
# Step 4: Render image using Paperbanana (gemini-3-pro-image-preview)
# Internal codename: Nano Banana Pro
# Use DIRECT connection (no proxy) - proxy causes SSL errors
set -e
OUTPUT_DIR="figures/ai_generated"
mkdir -p "$OUTPUT_DIR"
API_KEY="${GEMINI_API_KEY}"
URL="https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:generateContent?key=$API_KEY"
# Read the style-enhanced specification from previous step
STYLE_SPEC=$(cat figures/ai_generated/style_spec.txt)
# Add rendering instructions
RENDER_PROMPT="Render a publication-quality academic diagram based on this specification:
$STYLE_SPEC
RENDERING REQUIREMENTS:
- Output a clean, professional diagram suitable for CVPR/NeurIPS submission
- Use vector-quality rendering with sharp edges and clear text
- Ensure all elements are properly aligned and spaced
- The diagram should be immediately understandable at a glance"
# Build JSON payload using Python for proper escaping
python3 << PYTHON
import json
payload = {
"contents": [{"parts": [{"text": '''$RENDER_PROMPT'''}]}],
"generationConfig": {"responseModalities": ["TEXT", "IMAGE"]}
}
with open("/tmp/gemini_request.json", "w") as f:
Step 5: Codex STRICT Visual Review & Scoring (MANDATORY)
Codex MUST read the generated image and perform a STRICT review:
- Visual Analysis: What does the image show in detail?
- Strengths: What's good about it?
- STRICT Verification: Check EVERY item below
- Score: Rate 1-10 (10 = perfect) — BE STRICT!
STRICT Review Template:
## Codex's STRICT Review of Figure v{N}
### What I See
[Describe the generated image in DETAIL - every block, every arrow]
### Strengths
- [Strength 1]
- [Strength 2]
### ═══════════════════════════════════════════════════════════════
### STRICT VERIFICATION CHECKLIST (ALL must pass for score ≥ 9)
### ═══════════════════════════════════════════════════════════════
#### A. Arrow Correctness Verification (CRITICAL - any failure = score ≤ 6)
Check EACH arrow:
- [ ] Arrow 1: [Source] → [Target] — Does it point to the CORRECT target?
- [ ] Arrow 2: [Source] → [Target] — Does it point to the CORRECT target?
- [ ] Arrow 3: [Source] → [Target] — Does it point to the CORRECT target?
- [ ] Arrow 4: [Source] → [Target] — Does it point to the CORRECT target?
- [ ] Arrow 5: [Source] → [Target] — Does it point to the CORRECT target?
- [ ] Arrow 6: [Source] → [Target] — Does it point to the CORRECT target?
#### B. Block Content Verification (any failure = score ≤ 7)
Check EACH block:
- [ ] Block 1 "[Name]": Has correct label? Has sub-label? Content correct?
- [ ] Block 2 "[Name]": Has correct label? Has sub-label? Content correct?
- [ ] Block 3 "[Name]": Has correct label? Has sub-label? ConMore skills from wanshuiyin/Auto-claude-code-research-in-sleep
- Aablation-plannerUse when main results pass result-to-claim (claim_supported=yes or partial) and ablation studies are needed for paper submission.
- Aablation-plannerUse when main results pass result-to-claim (`claim_supported = yes` or `partial`) and ablation studies are needed for paper submission. A secondary Codex agent designs ablations from a reviewer's perspective; the local executor reviews feasibility and implements.
- AalphaxivQuick single-paper lookup via AlphaXiv LLM-optimized summaries with tiered source fallback. Use when user says "explain this paper", "summarize paper", pastes an arXiv/AlphaXiv URL, or provides a bare arXiv ID for quick understanding - not for broad literature search.
- AalphaxivQuick single-paper lookup via AlphaXiv LLM-optimized summaries with tiered source fallback. Use when user says "explain this paper", "summarize paper", pastes an arXiv/AlphaXiv URL, or provides a bare arXiv ID for quick understanding - not for broad literature search.
- Aanalyze-resultsAnalyze ML experiment results, compute statistics, generate comparison tables and insights. Use when user says "analyze results", "compare", or needs to interpret experimental data.
- Aanalyze-resultsAnalyze ML experiment results, compute statistics, generate comparison tables and insights. Use when user says \"analyze results\", \"compare\", or needs to interpret experimental data.
- AarxivSearch, download, and summarize academic papers from arXiv. Use when user says "search arxiv", "download paper", "fetch arxiv", "arxiv search", "get paper pdf", or wants to find and save papers from arXiv to the local paper library.
- AarxivSearch, download, and summarize academic papers from arXiv. Use when user says \"search arxiv\", \"download paper\", \"fetch arxiv\", \"arxiv search\", \"get paper pdf\", or wants to find and save papers from arXiv to the local paper library.
- Aauto-paper-improvement-loopAutonomously improve a generated paper via GPT-6-Astra xhigh review → implement fixes → recompile, for 2 rounds. Use when user says \"改论文\", \"improve paper\", \"论文润色循环\", \"auto improve\", or wants to iteratively polish a generated paper.
- Aauto-paper-improvement-loopAutonomously improve a generated paper via Claude review through claude-review MCP → implement fixes → recompile, for 2 rounds. Use when user says \"改论文\", \"improve paper\", \"论文润色循环\", \"auto improve\", or wants to iteratively polish a generated paper.
- Aauto-paper-improvement-loopAutonomously improve a generated paper via Gemini review through gemini-review MCP → implement fixes → recompile, for 2 rounds. Use when user says \"改论文\", \"improve paper\", \"论文润色循环\", \"auto improve\", or wants to iteratively polish a generated paper.
- Aauto-paper-improvement-loopAutonomously improve a generated paper via GPT-6-Astra xhigh review → implement fixes → recompile, for 2 rounds. Use when user says \"改论文\", \"improve paper\", \"论文润色循环\", \"auto improve\", or wants to iteratively polish a generated paper.