Publication Chart Skill
Goal
Use this skill to turn research results into publication-grade figures and tables.
Primary production stack:
pubfig>=0.3.0 JSON CLI for figures
pubtab for publication tables
Default delivery chain:
- identify the scientific communication goal,
- decide figure / table / mixed deliverable,
- choose the strongest representation,
- route to
pubfig, pubtab, or both,
- generate a runnable route,
- export paper-ready assets,
- run publication QA,
- propose revisions when needed.
Use this skill when
Trigger this skill for requests like:
- “make a publication-quality figure”
- “choose the right chart for these results”
- “turn these results into a paper-ready figure”
- “make a benchmark / ablation / calibration / forest / heatmap / scatter / line / bar figure”
- “make a benchmark / appendix / ablation table from Excel”
- “convert this Excel table into publication-ready LaTeX”
- “prepare one summary figure plus one companion table for the results section”
- “review and improve this scientific figure/table”
- “I already have a weak chart / screenshot / draft plot — make it publication-ready”
- “export panels for a paper figure”
Do not use this skill for
Do not use this skill when the task is mainly:
- manuscript prose writing,
- statistical testing without artifact design,
- raw exploratory analysis with no publication deliverable,
- Figma-first layout work before the figure or table content is solid.
Composite assembly is a secondary branch. Do not escalate ordinary figure tasks into panel/Figma workflows by default.
Primary contract
Inputs
Expect some combination of:
- the scientific communication goal,
- available data shape,
- venue or style constraints,
- whether the artifact is a figure, table, or mixed deliverable,
- optional assets such as code, spreadsheets,
.tex, screenshots, or draft plots,
- whether the task is first-draft generation, publication-ready export, or review/revision.
Minimum useful outputs
A strong response should provide:
- the recommended artifact form,
- the recommended
pubfig CLI / pubtab route,
- a minimal runnable JSON spec, CLI command, or code snippet,
- explicit output filenames and formats,
- a publication QA summary,
- a revision plan when the current artifact is weak.
Default workflow
0. Probe environment and task state
Before generating anything, identify:
- whether
pubfig>=0.3.0 or pubtab is available,
- whether the user already has code, spreadsheets,
.tex, screenshots, or draft plots,
- whether the deliverable is fresh generation or revision,
- whether the result needs visual pattern perception, exact value lookup, or both.
Keep this step light. Prefer the bundled helper script when runnable execution matters.
If a required dependency is missing, install it into the active environment first. The canonical pip commands are:
python -m pip install --upgrade "pubfig>=0.3.0"
python -m pip install --upgrade pubtab
When the bundled helper script is available, it is still the preferred route:
python3 scripts/ensure_publication_tooling.py --require pubfig --json
python3 scripts/ensure_publication_tooling.py --require pubtab --json
After installation:
- re-check availability,
- continue with the runnable workflow if install succeeds,
- otherwise degrade to a design/specification answer instead of failing.
For uv-managed and other fallback variants, see references/execution-and-verification.md.
1. Classify the task
Classify along these axes:
- artifact type — figure / table / mixed deliverable
- maturity — exploratory draft / publication-ready generation / revision
- structure — single panel / multi-panel / figure-plus-table package
- evidence mode — pattern perception / exact lookup / both
Do not jump into plotting before the communication target is clear.
2. Choose the representation
Choose the representation from the scientific claim, not from visual novelty.
Useful families:
- comparison — grouped scatter, bar, line comparison, benchmark summary, companion table
- ablation — grouped comparison, dumbbell, paired comparison, compact table
- distribution — box, violin, raincloud, histogram, density, ECDF, QQ
- relationship — scatter, bubble, contour2d, hexbin
- trend — line, area
- evaluation / diagnostic — calibration, ROC, PR, Bland–Altman, forest plot, volcano
- composition / hierarchy — UpSet, stacked ratio, donut, radial hierarchy, circular grouped or stacked bars
- table — benchmark table, ablation table, dataset summary, appendix table, error breakdown
Avoid weak defaults:
- avoid pie/donut when a bar or table communicates exact comparison better,
- avoid radar unless the claim is genuinely low-cardinality and profile-like,
- avoid 3D, decorative gradients, and style-only complexity,
- avoid forcing exact-value heavy results into a figure when a table is stronger.
For detailed task-to-chart rules, read references/chart-selection.md.
3. Map to the toolchain
Default mapping:
- Figures →
pubfig>=0.3.0 JSON CLI by default
- Tables →
pubtab
- Mixed deliverables → use both, with distinct communication roles
Route rules:
- prefer the
pubfig JSON CLI for agent-generated figures,
- use
pubfig Python API only when the user is explicitly working in a notebook/script or needs unsupported custom logic,
- prefer
pubtab CLI for file-driven table workflows,
- keep figure and table responsibilities separate in mixed requests,
- treat panel export / composite assembly as optional downstream work.
For exact route selection and verification behavior, see:
references/workflow.md
references/execution-and-verification.md
references/pubfig-recipes.md
references/pubtab-recipes.md
4. Generate the smallest runnable artifact
Prefer the smallest production-ready route first:
- for figures: one
figure.spec.json plus pubfig validate-spec and pubfig render,
- for tables: one
pubtab route that produces a previewable .tex or rendered preview,
- for mixed requests: one figure route plus one table route, clearly separated.
Keep filenames and export formats explicit.
For figure-specific export patterns such as save_figure, batch_export, and export_panels, use references/pubfig-recipes.md.
5. Define the delivery contract
For every response, make these explicit when possible:
- the scientific claim the artifact supports,
- which artifact type was chosen and why,
- which part is handled by
pubfig and which by pubtab,
- output filenames and formats,
- whether the artifact is draft / final / revision,
- what still needs user-provided data or manuscript context.
6. Run publication QA
After generation, check:
- title and legend density,
- axis labels and units,
- category ordering and baseline clarity,
- color accessibility and grayscale robustness,
- font and line-weight consistency,
- caption readiness,
- readability after downscaling,
- panel consistency for multi-panel exports,
- venue-fit issues such as width, crowding, or over-annotation.
The QA output must be concrete. Name the actual issue and the actual fix.
For a fuller checklist, see references/publication-qa-checklist.md.
7. Revise when the result is weak
Typical revisions include:
- switching chart family,
- removing chartjunk,
- reordering categories,
- moving exact values into a table,
- splitting a crowded panel,
- simplifying or strengthening the caption,
- changing export width,
- converting the deliverable from figure-first to table-first.
Missing dependency behavior
If pubfig>=0.3.0 or pubtab is unavailable:
- do not fail immediately,
- try the bundled install/probe route first,
- report the dependency state clearly,
- continue with the runnable workflow after a successful install,
- otherwise provide a design/specification answer with pseudocode or draft commands,
- still preserve artifact choice, QA, and revision guidance.
All concrete probe/install commands live in references/execution-and-verification.md.
Output style rules
- Prefer direct, implementation-usable outputs.
- Briefly explain why this figure or table form is appropriate, then give the route.
- When execution matters, include a short environment status block.
- Say explicitly when a table is stronger than a figure.
- Say explicitly when a figure is stronger than a table.
- When both are needed, assign them different roles.
- Keep revision guidance actionable and falsifiable.
Recommended response shape
A strong response usually has 6 parts:
- Artifact decision — figure / table / paired deliverable, and why
- Tool route —
pubfig>=0.3.0 JSON CLI, pubtab, or both
- Minimal implementation — runnable JSON spec, CLI, or code
- Export plan — filenames, formats, width/backend/preview choices
- Publication QA — what to verify before paper submission
- Revision plan — what to change if the current artifact is weak
Resources
Load these as needed:
references/workflow.md — decision order, delivery contract, figure/table split rules
references/chart-selection.md — task-to-chart mapping and anti-patterns
references/execution-and-verification.md — environment probing, install behavior, runnable verification
scripts/ensure_publication_tooling.py — bundled probe + auto-install helper for pubfig>=0.3.0 / pubtab
references/pubfig-recipes.md — agent-first JSON CLI figure specs and export patterns
references/pubtab-recipes.md — shortest useful table routes and backend guidance
references/source-guides/pubfig-architecture.md — package layout and figure-generation boundaries from source
references/source-guides/pubfig-api-map.md — stable public pubfig surface and chart-family map from __init__.py
references/source-guides/pubfig-export-flow.md — figure export, publication sizing, and panel-export flow from source
references/source-guides/pubtab-architecture.md — package layout and forward/reverse conversion architecture from source
references/source-guides/pubtab-cli-api-flow.md — CLI-to-API control flow and batch/sheet behavior from source
references/source-guides/pubtab-backend-and-preview.md — backend/theme split and preview compile pipeline from source
references/publication-qa-checklist.md — figure/table QA checklist
references/composite-assembly.md — optional multi-panel and Figma branch
For prompt-shaped examples, see examples/.
1---2name: publication-chart-skill3description: This skill should be used when the user asks for a publication-quality scientific figure or table, wants help choosing the right chart for results, needs a paper-ready pubfig>=0.3.0 CLI or pubtab workflow, wants a figure + companion table for a results section, wants an Excel sheet turned into publication-ready LaTeX, or wants an existing scientific figure/table reviewed and upgraded.4---56# Publication Chart Skill78## Goal910Use this skill to turn research results into **publication-grade figures and tables**.1112Primary production stack:1314- **`pubfig>=0.3.0` JSON CLI** for figures15- **`pubtab`** for publication tables1617Default delivery chain:18191. identify the scientific communication goal,202. decide figure / table / mixed deliverable,213. choose the strongest representation,224. route to `pubfig`, `pubtab`, or both,235. generate a runnable route,246. export paper-ready assets,257. run publication QA,268. propose revisions when needed.2728## Use this skill when2930Trigger this skill for requests like:3132- “make a publication-quality figure”33- “choose the right chart for these results”34- “turn these results into a paper-ready figure”35- “make a benchmark / ablation / calibration / forest / heatmap / scatter / line / bar figure”36- “make a benchmark / appendix / ablation table from Excel”37- “convert this Excel table into publication-ready LaTeX”38- “prepare one summary figure plus one companion table for the results section”39- “review and improve this scientific figure/table”40- “I already have a weak chart / screenshot / draft plot — make it publication-ready”41- “export panels for a paper figure”4243## Do not use this skill for4445Do **not** use this skill when the task is mainly:4647- manuscript prose writing,48- statistical testing without artifact design,49- raw exploratory analysis with no publication deliverable,50- Figma-first layout work before the figure or table content is solid.5152Composite assembly is a **secondary branch**. Do not escalate ordinary figure tasks into panel/Figma workflows by default.5354## Primary contract5556### Inputs5758Expect some combination of:5960- the scientific communication goal,61- available data shape,62- venue or style constraints,63- whether the artifact is a figure, table, or mixed deliverable,64- optional assets such as code, spreadsheets, `.tex`, screenshots, or draft plots,65- whether the task is first-draft generation, publication-ready export, or review/revision.6667### Minimum useful outputs6869A strong response should provide:7071- the recommended artifact form,72- the recommended `pubfig` CLI / `pubtab` route,73- a minimal runnable JSON spec, CLI command, or code snippet,74- explicit output filenames and formats,75- a publication QA summary,76- a revision plan when the current artifact is weak.7778## Default workflow7980### 0. Probe environment and task state8182Before generating anything, identify:8384- whether `pubfig>=0.3.0` or `pubtab` is available,85- whether the user already has code, spreadsheets, `.tex`, screenshots, or draft plots,86- whether the deliverable is fresh generation or revision,87- whether the result needs visual pattern perception, exact value lookup, or both.8889Keep this step light. Prefer the bundled helper script when runnable execution matters.9091If a required dependency is missing, install it into the active environment first. The canonical pip commands are:9293- `python -m pip install --upgrade "pubfig>=0.3.0"`94- `python -m pip install --upgrade pubtab`9596When the bundled helper script is available, it is still the preferred route:9798- `python3 scripts/ensure_publication_tooling.py --require pubfig --json`99- `python3 scripts/ensure_publication_tooling.py --require pubtab --json`100101After installation:102103- re-check availability,104- continue with the runnable workflow if install succeeds,105- otherwise degrade to a design/specification answer instead of failing.106107For `uv`-managed and other fallback variants, see `references/execution-and-verification.md`.108109### 1. Classify the task110111Classify along these axes:112113- **artifact type** — figure / table / mixed deliverable114- **maturity** — exploratory draft / publication-ready generation / revision115- **structure** — single panel / multi-panel / figure-plus-table package116- **evidence mode** — pattern perception / exact lookup / both117118Do not jump into plotting before the communication target is clear.119120### 2. Choose the representation121122Choose the representation from the scientific claim, not from visual novelty.123124Useful families:125126- **comparison** — grouped scatter, bar, line comparison, benchmark summary, companion table127- **ablation** — grouped comparison, dumbbell, paired comparison, compact table128- **distribution** — box, violin, raincloud, histogram, density, ECDF, QQ129- **relationship** — scatter, bubble, contour2d, hexbin130- **trend** — line, area131- **evaluation / diagnostic** — calibration, ROC, PR, Bland–Altman, forest plot, volcano132- **composition / hierarchy** — UpSet, stacked ratio, donut, radial hierarchy, circular grouped or stacked bars133- **table** — benchmark table, ablation table, dataset summary, appendix table, error breakdown134135Avoid weak defaults:136137- avoid pie/donut when a bar or table communicates exact comparison better,138- avoid radar unless the claim is genuinely low-cardinality and profile-like,139- avoid 3D, decorative gradients, and style-only complexity,140- avoid forcing exact-value heavy results into a figure when a table is stronger.141142For detailed task-to-chart rules, read `references/chart-selection.md`.143144### 3. Map to the toolchain145146Default mapping:147148- **Figures** → `pubfig>=0.3.0` JSON CLI by default149- **Tables** → `pubtab`150- **Mixed deliverables** → use both, with distinct communication roles151152Route rules:153154- prefer the `pubfig` JSON CLI for agent-generated figures,155- use `pubfig` Python API only when the user is explicitly working in a notebook/script or needs unsupported custom logic,156- prefer `pubtab` CLI for file-driven table workflows,157- keep figure and table responsibilities separate in mixed requests,158- treat panel export / composite assembly as optional downstream work.159160For exact route selection and verification behavior, see:161162- `references/workflow.md`163- `references/execution-and-verification.md`164- `references/pubfig-recipes.md`165- `references/pubtab-recipes.md`166167### 4. Generate the smallest runnable artifact168169Prefer the smallest production-ready route first:170171- for figures: one `figure.spec.json` plus `pubfig validate-spec` and `pubfig render`,172- for tables: one `pubtab` route that produces a previewable `.tex` or rendered preview,173- for mixed requests: one figure route plus one table route, clearly separated.174175Keep filenames and export formats explicit.176177For figure-specific export patterns such as `save_figure`, `batch_export`, and `export_panels`, use `references/pubfig-recipes.md`.178179### 5. Define the delivery contract180181For every response, make these explicit when possible:182183- the scientific claim the artifact supports,184- which artifact type was chosen and why,185- which part is handled by `pubfig` and which by `pubtab`,186- output filenames and formats,187- whether the artifact is draft / final / revision,188- what still needs user-provided data or manuscript context.189190### 6. Run publication QA191192After generation, check:193194- title and legend density,195- axis labels and units,196- category ordering and baseline clarity,197- color accessibility and grayscale robustness,198- font and line-weight consistency,199- caption readiness,200- readability after downscaling,201- panel consistency for multi-panel exports,202- venue-fit issues such as width, crowding, or over-annotation.203204The QA output must be concrete. Name the actual issue and the actual fix.205206For a fuller checklist, see `references/publication-qa-checklist.md`.207208### 7. Revise when the result is weak209210Typical revisions include:211212- switching chart family,213- removing chartjunk,214- reordering categories,215- moving exact values into a table,216- splitting a crowded panel,217- simplifying or strengthening the caption,218- changing export width,219- converting the deliverable from figure-first to table-first.220221## Missing dependency behavior222223If `pubfig>=0.3.0` or `pubtab` is unavailable:224225- do not fail immediately,226- try the bundled install/probe route first,227- report the dependency state clearly,228- continue with the runnable workflow after a successful install,229- otherwise provide a design/specification answer with pseudocode or draft commands,230- still preserve artifact choice, QA, and revision guidance.231232All concrete probe/install commands live in `references/execution-and-verification.md`.233234## Output style rules235236- Prefer direct, implementation-usable outputs.237- Briefly explain **why** this figure or table form is appropriate, then give the route.238- When execution matters, include a short environment status block.239- Say explicitly when a table is stronger than a figure.240- Say explicitly when a figure is stronger than a table.241- When both are needed, assign them different roles.242- Keep revision guidance actionable and falsifiable.243244## Recommended response shape245246A strong response usually has 6 parts:2472481. **Artifact decision** — figure / table / paired deliverable, and why2492. **Tool route** — `pubfig>=0.3.0` JSON CLI, `pubtab`, or both2503. **Minimal implementation** — runnable JSON spec, CLI, or code2514. **Export plan** — filenames, formats, width/backend/preview choices2525. **Publication QA** — what to verify before paper submission2536. **Revision plan** — what to change if the current artifact is weak254255## Resources256257Load these as needed:258259- `references/workflow.md` — decision order, delivery contract, figure/table split rules260- `references/chart-selection.md` — task-to-chart mapping and anti-patterns261- `references/execution-and-verification.md` — environment probing, install behavior, runnable verification262- `scripts/ensure_publication_tooling.py` — bundled probe + auto-install helper for `pubfig>=0.3.0` / `pubtab`263- `references/pubfig-recipes.md` — agent-first JSON CLI figure specs and export patterns264- `references/pubtab-recipes.md` — shortest useful table routes and backend guidance265- `references/source-guides/pubfig-architecture.md` — package layout and figure-generation boundaries from source266- `references/source-guides/pubfig-api-map.md` — stable public pubfig surface and chart-family map from `__init__.py`267- `references/source-guides/pubfig-export-flow.md` — figure export, publication sizing, and panel-export flow from source268- `references/source-guides/pubtab-architecture.md` — package layout and forward/reverse conversion architecture from source269- `references/source-guides/pubtab-cli-api-flow.md` — CLI-to-API control flow and batch/sheet behavior from source270- `references/source-guides/pubtab-backend-and-preview.md` — backend/theme split and preview compile pipeline from source271- `references/publication-qa-checklist.md` — figure/table QA checklist272- `references/composite-assembly.md` — optional multi-panel and Figma branch273274For prompt-shaped examples, see `examples/`.