From paperbanana-cc
Generate publication-quality academic diagrams and statistical plots from methodology text and caption. Multi-phase pipeline with reference retrieval, structured planning, venue-specific styling, and iterative critic refinement. Use this skill whenever the user wants to create academic figures, conference diagrams, methodology illustrations, architecture diagrams, or statistical plots for papers.
How this skill is triggered — by the user, by Claude, or both
Slash command
/paperbanana-cc:paperbananaThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Claude Code native pipeline for publication-quality academic diagrams and plots.
Claude Code native pipeline for publication-quality academic diagrams and plots. Claude Code acts as the thinking engine — analysis, planning, styling, and critique are all performed by you directly. Only image generation uses external APIs (OpenAI / Gemini) or manual web generation.
Pipeline: Input Enrichment -> Reference Retrieval -> Plan + Style + Generate -> Critic Loop
This skill uses two directory roots:
{PLUGIN_DIR} — where PaperBanana CC is installed (contains prompts/, style_guides/, data/). All pipeline resource files are read from here.{CWD} — the user's current working directory. Output artifacts are saved here.To find {PLUGIN_DIR}, run this search (checks multiple install locations):
PLUGIN_DIR=$(find ~/.claude/plugins -path '*/paperbanana*/prompts/context_enricher.md' 2>/dev/null | head -1 | xargs dirname | xargs dirname)
[ -z "$PLUGIN_DIR" ] && [ -f "./prompts/context_enricher.md" ] && PLUGIN_DIR="."
echo "PLUGIN_DIR=$PLUGIN_DIR"
If {PLUGIN_DIR} is empty, the plugin may not be installed correctly — ask the user to verify.
Shorthand used below:
{P}/prompts/... means {PLUGIN_DIR}/prompts/...{P}/style_guides/... means {PLUGIN_DIR}/style_guides/...{P}/data/... means {PLUGIN_DIR}/data/...output/... means {CWD}/output/... (user's project)ls {P}/data/references/diagram/ref.json {P}/data/references/plot/ref.json 2>/dev/null
If either file is missing, automatically run the download — do not ask the user:
uvx paperbanana-cc download --target "{P}/data/references"
This downloads ~300MB from HuggingFace on first run. Subsequent runs skip if data exists.
Generate a run ID (timestamp-based) and create the output directory in the user's current working directory:
output/{run_id}/
Save all artifacts to this directory throughout the pipeline.
Always runs. User confirmation required.
The user provides:
If a file path is given, Read the file. Save originals to output/{run_id}/input.md.
Read {P}/prompts/context_enricher.md and follow its instructions.
Apply the enricher to the methodology text, restructuring it along 7 axes:
Read {P}/prompts/caption_sharpener.md and follow its instructions.
Transform the caption into a detailed visual specification (under 150 words) covering:
Present the results side-by-side:
## Original Input
[methodology text]
[caption]
## Enriched
[enriched context — 7-axis structured]
[sharpened caption — 6-spec enhanced]
## Changes
[brief explanation of what was changed and why]
Ask: "Is this direction correct? Any modifications?"
output/{run_id}/enriched.mdRetrieves top-10 similar examples for few-shot guidance.
Based on the enriched input, determine whether this is a diagram or plot:
ref.json files are large (~4MB). Use a 2-stage approach to save context:
Stage 1: Python pre-filter — Narrow the candidate pool using keyword/category matching:
uvx paperbanana-cc filter-refs \
--ref-json "{P}/data/references/{type}/ref.json" \
--keywords "{keyword1},{keyword2},..." \
--limit 100
Stage 2: Semantic ranking — Read the ~50-100 pre-filtered candidates in context, then apply 2-axis matching semantically to select the final top-10.
Read {P}/prompts/retriever_system.md and follow its matching logic on the pre-filtered candidates.
Select top-10 references using 2-axis matching:
For Diagrams:
For Plots:
For each of the top-10, display:
{P}/data/references/{type}/images/)Use AskUserQuestion tool for selection:
question: "Which references do you want to use?"
options:
- "Use all 10"
- "Let me pick specific ones"
- "Re-search with different criteria"
If "Let me pick specific ones": ask which numbers (e.g., "1,3,5,7").
Save selection to output/{run_id}/references.json.
Three internal phases executed in sequence after user selects settings.
Use AskUserQuestion tool for each setting:
Venue:
question: "Which venue style?"
options:
- "NeurIPS (default)"
- "ICML"
- "ACL"
- "IEEE"
Generation method:
question: "How should the image be generated?"
options:
- "OpenAI API (gpt-image-1)"
- "Gemini API (Imagen 3)"
- "Manual (I'll generate from the prompt myself)"
Save to output/{run_id}/settings.json.
Read {P}/prompts/planner_system.md and follow its instructions.
Read the selected reference images (vision) as few-shot examples.
Generate a detailed 7-item structured plan:
Include RECOMMENDED_RATIO based on the generation method:
| Method | Supported Ratios |
|---|---|
| OpenAI | 1:1, 3:2, 2:3 |
| Gemini | 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9 |
| Manual | Any |
Save to output/{run_id}/plan.md.
Read {P}/prompts/stylist_system.md and follow its 6 instructions.
Load the venue-specific style guide:
{P}/style_guides/{venue}/diagram.md # for diagrams
{P}/style_guides/{venue}/plot.md # for plots
If the style guide file is missing, use the fallback guidelines embedded in the stylist prompt.
Apply styling rules to the plan. The 6 crucial rules:
Save to output/{run_id}/styled_plan.md.
Compose the final image generation prompt from the styled plan.
CRITICAL: Prepend role preamble and append text garbling prevention:
"You are an expert scientific diagram illustrator. Generate high-quality scientific diagrams based on the following description. Note that do not include figure titles in the image.
CRITICAL: All text labels in the diagram must be rendered in clear, readable English. Use the EXACT label names specified in the description. Do NOT generate garbled, misspelled, or non-English text."
Save prompt to output/{run_id}/prompt.md.
Always display the full prompt to the user.
If OpenAI API:
uvx paperbanana-cc generate \
--provider openai \
--prompt-file "{CWD}/output/{run_id}/prompt.md" \
--output "{CWD}/output/{run_id}/iter_1/image.png" \
--ratio "{recommended_ratio}"
If Gemini API:
uvx paperbanana-cc generate \
--provider gemini \
--prompt-file "{CWD}/output/{run_id}/prompt.md" \
--output "{CWD}/output/{run_id}/iter_1/image.png" \
--ratio "{recommended_ratio}"
If Manual: Display the prompt clearly and ask the user to:
Copy or move the user-provided image to output/{run_id}/iter_1/image.png.
Do NOT use image generation APIs. Instead:
python output/{run_id}/plot_code.pySave the generated image to output/{run_id}/iter_1/image.png.
Default: 3 iterations maximum. User can request more.
Read the critic prompt for the current type:
{P}/prompts/critic_diagram.md{P}/prompts/critic_plot.mdRead (vision) the generated image at output/{run_id}/iter_{N}/image.png.
Evaluate against these criteria:
Content:
Presentation:
Plot-specific:
If changes needed:
output/{run_id}/iter_{N}/critic.mdoutput/{run_id}/iter_{N+1}/prompt.mdIf no changes needed (or max iterations reached):
output/{run_id}/iter_{N}/critic.mdDisplay the final image and critic summary.
Use AskUserQuestion tool:
question: "Are you satisfied with the result?"
options:
- "Yes, looks good!"
- "No, I have feedback for refinement"
If "No": ask for specific feedback, then continue the critic loop.
When the pipeline completes, report:
Run ID: {run_id}
Type: diagram / plot
Venue: {venue}
Method: {method}
Iterations: {N}
Final image: output/{run_id}/iter_{N}/image.png
Prompt: output/{run_id}/prompt.md
All artifacts: output/{run_id}/
output/{run_id}/
input.md # Original methodology + caption
enriched.md # Phase 0: enriched context + sharpened caption
references.json # Phase 1: selected reference IDs + paths
settings.json # Phase 2: venue, method, ratio
plan.md # Phase 2: 7-item structured plan
styled_plan.md # Phase 3: style-applied plan
prompt.md # Final generation prompt
iter_1/
image.png # Generated image
prompt.md # Iteration prompt (includes prior critic)
critic.md # Critic evaluation
iter_2/
...
iter_3/
...
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub eunsanmountain/paperbanana-cc --plugin paperbanana-cc