Claude Code Skills · 论文 · 图表绘制

paper-illustration

用 Gemini 的图像生成能力配合 Claude 的审校迭代,构造一个多阶段工作流来生成学术论文的图表。专注于架构图和方法示意图,经过布局优化和风格验证环节来保证配色、间距与排版符合 CVPR 或 NeurIPS 的标准。适合在撰写论文需要生成图表但不想手动反复调整的场景。

Generate publication-quality AI illustrations for academic papers using Gemini image generation. Creates architecture diagrams, method illustrations with Claude-supervised iterative refinement loop. Use when user says "生成图表", "画架构图", "AI绘图", "paper illustration", "generate diagram", or needs visual figures for papers.

Repo
Chanw-research/claude-code-paper-writing
Slug
paper-illustration

SKILL.md

Paper Illustration: Multi-Stage Claude-Supervised Figure Generation

Generate publication-quality illustrations using a multi-stage workflow with Claude as the STRICT supervisor/reviewer.

Core Design Philosophy

┌──────────────────────────────────────────────────────────────────────────┐
│                    MULTI-STAGE ITERATIVE WORKFLOW                        │
├──────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│   User Request                                                           │
│       │                                                                  │
│       ▼                                                                  │
│   ┌─────────────┐                                                        │
│   │   Claude    │ ◄─── Step 1: Parse request, create initial prompt     │
│   │  (Planner)  │                                                        │
│   └──────┬──────┘                                                        │
│          │                                                               │
│          ▼                                                               │
│   ┌─────────────┐                                                        │
│   │   Gemini    │ ◄─── Step 2: Optimize layout description               │
│   │ (gemini-3-pro)│      - Refine component positioning                    │
│   │  Layout     │      - Optimize spacing and grouping                   │
│   └──────┬──────┘                                                        │
│          │                                                               │
│          ▼                                                               │
│   ┌─────────────┐                                                        │
│   │   Gemini    │ ◄─── Step 3: CVPR/NeurIPS style verification          │
│   │ (gemini-3-pro)│      - Check color palette compliance                  │
│   │  Style      │      - Verify arrow and font standards                 │
│   └──────┬──────┘                                                        │
│          │                                                               │
│          ▼                                                               │
│   ┌─────────────┐                                                        │
│   │ Paperbanana │ ◄─── Step 4: Render final image                       │
│   │ (gemini-3-  │      - High-quality image generation                   │
│   │ pro-image)  │      - Internal codename: Nano Banana Pro              │
│   └──────┬──────┘                                                        │
│          │                                                               │
│          ▼                                                               │
│   ┌─────────────┐                                                        │
│   │   Claude    │ ◄─── Step 5: STRICT visual review + SCORE (1-10)      │
│   │  (Reviewer) │      - Verify EVERY arrow direction                    │
│   │   STRICT!   │      - Verify EVERY block content                      │
│   └──────┬──────┘      - Verify aesthetics & visual appeal               │
│          │                                                               │
│          ▼                                                               │
│   Score ≥ 9? ──YES──► Accept & Output                                    │
│          │                                                               │
│          NO                                                              │
│          │                                                               │
│          ▼                                                               │
│   Generate SPECIFIC improvement feedback ──► Loop back to Step 2        │
│                                                                          │
└──────────────────────────────────────────────────────────────────────────┘

Constants

  • IMAGE_MODEL = gemini-3-pro-image-preview — Paperbanana (Nano Banana Pro) for image rendering
  • REASONING_MODEL = gemini-3-pro-preview — Gemini for layout optimization and style checking
  • MAX_ITERATIONS = 5 — Maximum refinement rounds
  • TARGET_SCORE = 9 — Minimum acceptable score (1-10) — RAISED FOR QUALITY
  • OUTPUT_DIR = figures/ai_generated/ — Output directory
  • API_KEY_ENV = GEMINI_API_KEY — Environment variable

Optional: Style reference (— style-ref: <source>, opt-in)

Lets the user steer structural figure conventions (caption length, panel-count distribution, figure-to-table ratio in the parent paper) toward a reference paper. Default OFF — when the user does not pass — style-ref, do nothing differently from before.

Only when — style-ref: <source> appears in $ARGUMENTS, run the helper FIRST, before generating prompts:

if [ ! -f tools/extract_paper_style.py ]; then
  echo "error: tools/extract_paper_style.py not found — re-run 'bash tools/install_aris.sh' to refresh the '.aris/tools' symlink (added in #174), or copy the helper manually from the ARIS repo" >&2
  exit 1
fi
CACHE=$(python3 tools/extract_paper_style.py --source "<source>")
case $? in
  0) ;;                                       # use $CACHE/style_profile.md as structural guidance
  2) echo "warning: style-ref skipped (missing optional dep)" >&2 ;;
  3) echo "error: --style-ref source failed; aborting illustration" >&2 ; exit 1 ;;
  *) echo "error: helper failed unexpectedly; aborting illustration" >&2 ; exit 1 ;;
esac

Sources accepted: local TeX dir / file, local PDF, arXiv id, http(s) URL. Overleaf URLs/IDs are rejected — clone via /overleaf-sync setup <id> first and pass the local clone path.

Strict rules (full contract in tools/extract_paper_style.py docstring):

  • Use style_profile.md to align caption length and figure density with the reference paper. The CVPR/ICLR/NeurIPS visual standards above still take precedence — --style-ref only refines length-and-density tendencies, never image content.
  • Never copy figure content, color palettes, or specific design elements from anything reachable through the cache. The visual design comes from the user's prompt, not the reference.
  • Never pass — style-ref (or the cache contents) to the Claude vision-checker / Gemini reasoning-checker sub-agents when they score the generated image — the image must be judged on its own merits.

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

同一分类的其他项