| name | paper-illustration-image2 |
| description | Generate publication-quality academic illustrations through a local Codex app-server bridge that uses Codex native image generation. This is a separate experimental alternative to `paper-illustration`, intended for Claude Code users who want a GPT-image-style renderer without modifying the original skill. |
| argument-hint | [description-or-method-file] |
| allowed-tools | Bash(*), Read, Write, Edit, Grep, Glob, WebSearch, mcp__codex-image2__generate, mcp__codex-image2__generate_start, mcp__codex-image2__generate_status, spawn_agent, send_input |
Paper Illustration Image2
Generate publication-quality paper figures using Claude as the planner/reviewer
and a local Codex app-server MCP bridge as the raster renderer.
Core Design Philosophy
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MULTI-STAGE ITERATIVE WORKFLOW โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ User Request โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโ โ
โ โ Claude โ โโโโ Step 1: Parse request, create initial prompt โ
โ โ (Planner) โ - Extract components, labels, and data flow โ
โ โ โ - Write a paper-ready figure brief โ
โ โโโโโโโโฌโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโ โ
โ โClaude/Codex โ โโโโ Step 2: Optimize layout description โ
โ โ Layout โ - Refine component positioning โ
โ โ Review โ - Optimize spacing and grouping โ
โ โโโโโโโโฌโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโ โ
โ โClaude/Codex โ โโโโ Step 3: CVPR/NeurIPS style verification โ
โ โ Style โ - Check palette, arrows, and label standards โ
โ โ Check โ - Tighten the prompt before rendering โ
โ โโโโโโโโฌโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโ โ
โ โ codex-image2โ โโโโ Step 4: Native image generation via bridge โ
โ โ MCP bridge โ - Call generate_start / generate_status โ
โ โ + app-serverโ - Accept only native imageGeneration output โ
โ โโโโโโโโฌโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโ โ
โ โ Claude โ โโโโ Step 5: STRICT visual review + SCORE (1-10) โ
โ โ (Reviewer) โ - Verify logic, labels, arrows, and aesthetics โ
โ โ STRICT! โ - Reject unclear or non-paper-ready figures โ
โ โโโโโโโโฌโโโโโโโ โ
โ โ โ
โ โผ โ
โ Score โฅ 9? โโYESโโโบ Accept & Output โ
โ โ โ
โ NO โ
โ โ โ
โ โผ โ
โ Generate SPECIFIC improvement feedback โโโบ Loop back to Step 2 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Constants
-
RENDERER = codex-image2 โ Native image generation bridge exposed through local Codex app-server
-
OPTIONAL_TEXT_CRITIC = spawn_agent โ Optional text-only second opinion for layout/style checks
-
MAX_ITERATIONS = 5 โ Maximum refinement rounds
-
TARGET_SCORE = 9 โ Minimum acceptable score (1-10)
-
OUTPUT_DIR = figures/ai_generated/ โ Output directory
-
TEXT_LANGUAGE = English โ Default figure text language unless the user requests otherwise
-
NATIVE_IMAGE_REQUIREMENT = strict โ Accept only native imageGeneration output; reject shell/Python fallbacks
-
IMAGE2_HELPER โ canonical name paper_illustration_image2.py, resolved
per shared-references/integration-contract.md ยง2
(Policy A โ skill-local gate). Phase 3.2 (Arch C) moved the canonical
implementation into skills/paper-illustration-image2/scripts/;
tools/paper_illustration_image2.py remains as an os.execv shim so
legacy resolver layers keep working without a re-install. Resolve via the
Codex-side chain:
IMAGE2_HELPER=""
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)" || exit 1
if [ -z "${ARIS_REPO:-}" ] && [ -f .aris/installed-skills-codex.txt ]; then
ARIS_REPO=$(awk -F'\t' '$1=="repo_root"{print $2; exit}' .aris/installed-skills-codex.txt 2>/dev/null) || true
fi
[ -f ".agents/skills/paper-illustration-image2/scripts/paper_illustration_image2.py" ] && IMAGE2_HELPER=".agents/skills/paper-illustration-image2/scripts/paper_illustration_image2.py"
[ -z "$IMAGE2_HELPER" ] && [ -n "${ARIS_REPO:-}" ] && [ -f "$ARIS_REPO/skills/paper-illustration-image2/scripts/paper_illustration_image2.py" ] && IMAGE2_HELPER="$ARIS_REPO/skills/paper-illustration-image2/scripts/paper_illustration_image2.py"
[ -z "$IMAGE2_HELPER" ] && [ -n "${ARIS_REPO:-}" ] && [ -f "$ARIS_REPO/tools/paper_illustration_image2.py" ] && IMAGE2_HELPER="$ARIS_REPO/tools/paper_illustration_image2.py"
[ -z "$IMAGE2_HELPER" ] && [ -f tools/paper_illustration_image2.py ] && IMAGE2_HELPER="tools/paper_illustration_image2.py"
[ -z "$IMAGE2_HELPER" ] && [ -f ~/.codex/skills/paper-illustration-image2/scripts/paper_illustration_image2.py ] && IMAGE2_HELPER="$HOME/.codex/skills/paper-illustration-image2/scripts/paper_illustration_image2.py"
[ -z "$IMAGE2_HELPER" ] && {
echo "ERROR: paper_illustration_image2.py not resolved at .agents/skills/, \$ARIS_REPO/skills/, \$ARIS_REPO/tools/, tools/, or ~/.codex/skills/." >&2
echo " /paper-illustration-image2 cannot proceed. Fix: rerun install_aris_codex.sh, export ARIS_REPO, or copy the canonical skill into ~/.codex/skills/." >&2
exit 1
}
All invocations below use python3 "$IMAGE2_HELPER" <subcommand>.
CVPR/ICLR/NeurIPS Top-Tier Conference Style Guide
What "CVPR Style" Actually Means:
Visual Standards
- Clean white background โ No decorative patterns or gradients unless extremely subtle
- Sans-serif fonts โ Arial, Helvetica, or similarly clean paper-friendly typography
- Subtle color palette โ Use 3-5 coordinated colors, not rainbow colors
- Print-friendly โ Must remain understandable in grayscale
- Professional borders โ Thin to medium, clean, and consistent
Layout Standards
- Horizontal flow โ Left-to-right is the default for pipelines
- Clear grouping โ Use spacing or subtle grouping boxes for related modules
- Consistent sizing โ Similar components should have similar sizes
- Balanced whitespace โ Avoid both cramped and overly sparse layouts
Arrow Standards (MOST CRITICAL)
- Thick strokes โ Arrows must remain visible after paper scaling
- Clear arrowheads โ Large, unmistakable arrowheads
- Dark colors โ Prefer black or dark gray arrows
- Labeled โ Important arrows should show what flows through them
- No crossings โ Reorganize the figure to avoid crossings where possible
- CORRECT DIRECTION โ Arrows must point to the right target
Visual Appeal (Academic Professional Style)
็ฎๆ ๏ผๆขไธไฟๅฎไนไธ่ฑๅจ๏ผๆพๅฐๅนณ่กก็น
โ
Should have
- Subtle gradients โ Gentle same-family gradients are acceptable
- Rounded corners โ Modern but restrained rounded blocks
- Clear hierarchy โ Main modules larger, secondary modules smaller
- Consistent color coding โ Stable mapping between module types and colors
- Professional typography โ Clean labels with readable size hierarchy
โ Avoid
- โ Rainbow gradients
- โ Heavy drop shadows
- โ 3D perspective effects
- โ Glowing effects
- โ Decorative clip-art icons
- โ Slide-deck styling that feels flashy rather than paper-ready
โ Ideal effect
- Looks intentional, professional, and immediately readable
- Has moderate visual appeal without becoming decorative
- Feels appropriate for a top-tier conference paper figure
- Survives PDF scaling and grayscale printing
What to AVOID (CRITICAL)
- โ Thin, hairline arrows
- โ Unlabeled or ambiguous connections
- โ Tiny unreadable text
- โ Flat, boring box soup with no hierarchy
- โ Over-decorated figures with shadows/glows/icons
- โ Wrong arrow directions
Scope
| Figure Type | Quality | Examples |
|---|
| Architecture diagrams | Excellent | Model architecture, pipeline, encoder-decoder |
| Method illustrations | Excellent | Conceptual diagrams, algorithm flowcharts |
| Conceptual figures | Good | Comparison diagrams, taxonomy trees |
Not for: Statistical plots (use /paper-figure), deterministic vector topology figures (prefer /figure-spec), photo-realistic scenes
Workflow: MUST EXECUTE ALL STEPS
Step 0: Pre-flight Check
Render this checklist explicitly before starting:
๐ paper-illustration-image2 integration checklist:
[ ] 1. python3 "$IMAGE2_HELPER" preflight --workspace <cwd> --json-out figures/ai_generated/preflight.json
[ ] 2. Confirm preflight JSON says ok=true before rendering
[ ] 3. Render via mcp__codex-image2__generate_start + generate_status
[ ] 4. Finalize via python3 "$IMAGE2_HELPER" finalize --workspace <cwd> --best-image <best_png>
[ ] 5. Verify artifacts via python3 "$IMAGE2_HELPER" verify --workspace <cwd> --json-out figures/ai_generated/verify.json
- Create
figures/ai_generated/ if it does not exist.
- Confirm the request is suitable for a raster illustration:
- architecture diagram
- conceptual method figure
- workflow illustration
- Prefer English figure text unless the user asked otherwise.
- Run:
python3 "$IMAGE2_HELPER" preflight \
--workspace <cwd> \
--json-out figures/ai_generated/preflight.json
- If preflight is not
ok=true, stop and say so clearly.
Step 1: Claude Plans the Figure
Turn the user request into a fully specified image prompt. Include:
- figure type
- exact modules / stages
- flow direction
- labels to show
- data-flow arrows
- style constraints
- what to avoid
When the input is a method note or a paper section, summarize it first into a
clean figure brief before writing the final image prompt.
Step 2: Layout Optimization
This step is required. Before rendering, refine the prompt into a concrete
layout plan:
- exact module order
- spacing and grouping
- relative module prominence
- arrow routing and likely collision points
If spawn_agent is available, you may ask it for a short second-opinion
layout critique here, but Claude should still complete this step even without
Codex.
Use Codex layout critique for:
- missing components
- confusing layout
- weak flow hierarchy
- likely arrow-direction ambiguity or clutter
Step 3: Style Verification
This step is also required. Check the prompt against the intended paper style
before rendering:
- palette is restrained and academic
- arrows are thick, dark, and readable
- labels are concise and in English unless requested otherwise
- the figure will read clearly in grayscale / print
- no glow, rainbow gradient, or slide-deck decoration slips in
If spawn_agent is available, you may ask it for a short text-only
style audit, but do not block on it.
Step 4: Generate Through the Bridge
Call mcp__codex-image2__generate_start with:
prompt: the final image prompt
cwd: current project root or paper workspace
outputPath: figures/ai_generated/figure_v1.png
system: a short instruction like Academic paper figure. Prefer crisp English labels.
timeoutSeconds: a bounded render timeout such as 180
Then call mcp__codex-image2__generate_status with bounded waits until:
done=true and status=completed, or
done=true and status=failed
If generation fails, report the bridge error directly instead of hiding it.
Step 5: Review the Output
Review the generated image with a strict checklist:
- are all major components present?
- is the logical flow obvious?
- are labels readable?
- do arrows point the right way?
- does the figure look paper-ready rather than like a slide?
Score it from 1-10.
Step 6: Refine if Needed
If score < 9, write a targeted refinement prompt:
- say exactly what was wrong
- say what to preserve
- regenerate to
figure_v2.png, figure_v3.png, etc.
Keep refinement feedback concrete:
Increase spacing between genome scan and scoring modules
Make the off-target branch thinner and secondary
Use cleaner English labels: "Candidate sgRNA library", not "sgRNA library 23 bp"
Step 7: Finalize And Verify
When accepted:
- run the canonical helper to promote the best image to
figure_final.png
- let the helper write
latex_include.tex
- let the helper write
review_log.json
- run helper verification before claiming success
python3 "$IMAGE2_HELPER" finalize \
--workspace <cwd> \
--best-image figures/ai_generated/figure_vN.png \
--score 9 \
--review-summary "Accepted after strict review; labels and arrows are paper-ready."
python3 "$IMAGE2_HELPER" verify \
--workspace <cwd> \
--json-out figures/ai_generated/verify.json
Suggested LaTeX:
\begin{figure*}[t]
\centering
\includegraphics[width=0.95\textwidth]{figures/ai_generated/figure_final.png}
\caption{[Replace with a paper-ready caption].}
\label{fig:[replace-me]}
\end{figure*}
Key Rules
- Never skip Step 2 or Step 3; layout and style checks are required.
- Never skip the final visual review.
- Never accept a figure that is logically wrong just because it looks attractive.
- Use the
codex-image2 bridge only for native image generation.
- If the bridge says native image generation is unavailable, surface that honestly.
- Reject any shell/Python/manual bitmap fallback masquerading as image generation.
- Keep figure text in English unless the user requested another language.
- Prefer 1-3 strong refinement rounds over many shallow ones.
- Use specific, actionable refinement feedback instead of vague comments.
- Review arrow direction, label clarity, and visual hierarchy every round.
- Accept only figures that look paper-ready, not slide-ready.
- Always use
tools/paper_illustration_image2.py finalize to emit the final artifacts.
- Always use
tools/paper_illustration_image2.py verify before claiming success.
Repair Path
If rendering succeeded but final artifacts were skipped, repair the integration explicitly:
python3 "$IMAGE2_HELPER" finalize \
--workspace <cwd> \
--best-image figures/ai_generated/figure_vN.png
python3 "$IMAGE2_HELPER" verify \
--workspace <cwd> \
--json-out figures/ai_generated/verify.json
Output Structure
figures/ai_generated/
โโโ preflight.json # Helper preflight receipt
โโโ figure_v1.png # Iteration 1
โโโ figure_v2.png # Iteration 2
โโโ figure_v3.png # Iteration 3
โโโ figure_final.png # Accepted version (copy of best, score โฅ 9)
โโโ latex_include.tex # LaTeX snippet
โโโ review_log.json # Review notes and refinement history
โโโ verify.json # Helper verification diagnostic
Model Summary
| Stage | Agent / Tool | Purpose |
|---|
| Step 0 | python3 "$IMAGE2_HELPER" preflight | Observable activation predicate and preflight receipt |
| Step 1 | Claude | Parse request and create the initial figure prompt |
| Step 2 | Claude (+ optional Codex critique) | Refine layout, grouping, spacing, and arrow routing |
| Step 3 | Claude (+ optional Codex critique) | Verify academic visual style before rendering |
| Step 4 | mcp__codex-image2__generate_start + generate_status | Native raster image generation through Codex app-server |
| Step 5 | Claude | Strict visual review and scoring |
| Step 7 | python3 "$IMAGE2_HELPER" finalize + verify | Emit canonical artifacts and external verification receipt |