Scientific Figure Analysis
A reusable AI skill for inspecting, extracting, interpreting, and comparing figures, charts, plots, diagrams, and panels in scientific articles—without losing the provenance or uncertainty behind an answer.
See the prompt that built itWhy build it
Scientific meaning is spread across panels, captions, nearby text, source data, and supplements. General-purpose agents often summarize the image but lose that evidence chain.
What changes
The workflow becomes repeatable and reviewable. Every value stays linked to its source, and every interpretation carries an honest statement of precision.
Skill architecture
One core skill, five nested specialists.
scientific-figure-analysis defines the shared evidence rules, source hierarchy, and quality standard. It then routes each request to the nested sub-skill built for that job.
- 01
Nested sub-skill · figure-reader
Read and segment the article
Inventory figures, captions, nearby mentions, and supplemental context.
- 02
Nested sub-skill · chart-extractor
Extract the evidence
Recover chart values from the best available source—not pixels by default.
- 03
Nested sub-skill · figure-interpreter
Interpret the science
Separate what the figure directly shows from the conclusion it supports.
- 04
Nested sub-skill · article-figure-indexer
Build the corpus
Store panels, values, claims, aliases, and quality flags for reuse.
- 05
Nested sub-skill · figure-corpus-qa
Answer across articles
Compare normalized evidence with figure-level provenance and confidence.
Design rules
Useful answers require more than visual recognition.
Use the best source
Prefer tables, supplements, printed values, and vector data before pixel digitization.
Preserve provenance
Keep every claim linked to article, page, figure, panel, crop, caption, and nearby text.
Name the uncertainty
Distinguish exact, table-derived, vector-derived, digitized, and visually inferred values.
Reusable example
The build prompt
This is the original prompt used to define the skill architecture, evidence rules, nested workflows, validation, and a real scientific test case.
What this work demonstrates
Applied AI workflow design, scientific data modeling, provenance-aware automation, and technical communication.
Show the full setup prompt
<prompt>
<task>
Create a new skill bundle for my AI coding agent called "scientific-figure-analysis",
stored wherever my harness loads skills from.
If you are running in Codex and no project-specific skill path is configured, use
"~/.codex/skills/" as the default install location. If you are running in another
harness, first inspect its conventions or ask me where skills should be installed.
Do not assume ".agents/skills/" unless this repository or harness explicitly uses it.
The job: help scientists quickly interpret figures, diagrams, charts, plots, and
figure panels in individual scientific articles and across groups of articles.
The skill should help an agent move from article PDF -> figure inventory -> panel
understanding -> chart/value extraction -> scientific interpretation -> reusable
corpus records -> cross-article visual question answering.
Structure it as a core skill plus nested sub-skills.
The core skill must include:
(1) trigger conditions: any request to inspect, explain, summarize, extract,
digitize, index, compare, or ask questions about figures, panels, charts,
plots, diagrams, captions, or visual evidence in scientific articles;
(2) evidence rules: treat figures as evidence objects, not isolated images;
preserve provenance from article -> page -> figure -> panel -> crop ->
caption -> nearby text -> extracted value -> interpretation;
(3) source hierarchy: prefer source tables, supplemental files, embedded vector
data, and printed values before pixel digitization;
(4) uncertainty rules: label values as exact, table-derived, vector-derived,
digitized, or visually inferred; never present digitized values as original
raw measurements;
(5) workflow routing: route to nested sub-skills based on task type and run them
in a sensible order for article-level and corpus-level requests;
(6) validation expectations: include a small metadata/content validator and at
least one worked example showing how the skill handles a multi-panel scientific
figure workflow.
Create nested sub-skills for:
1. figure-reader
- inventories figures in scientific PDFs;
- renders pages when visual layout matters;
- extracts captions and nearby in-text mentions;
- segments figures into panels when possible;
- classifies panel types such as xy_line, xy_scatter, bar_chart, heatmap,
3d_surface_or_fingerprint, chemical_structure, microscopy_or_image,
workflow_or_schematic, table_or_table_like, and mixed_or_unclear;
- outputs a structured figure inventory with crop paths and quality flags.
2. chart-extractor
- extracts quantitative evidence from chart panels only when needed;
- checks for tables, supplemental files, source data, or embedded vector data
before pixel digitization;
- supports simple 2D plots through calibration/digitization;
- supports dense 3D fingerprint or count-matrix plots by extracting named hit
trajectories, detectability, approximate bins, and background signal instead
of pretending every point can be reliably recovered from pixels;
- emits extraction records with method, provenance, uncertainty, and quality flags.
3. figure-interpreter
- explains what figures convey scientifically;
- combines panel crops, captions, nearby text, tables, and extraction records;
- separates direct evidence from interpretation;
- summarizes purpose, evidence, interpretation, importance, limits, and confidence.
4. article-figure-indexer
- stores article metadata, figures, panels, captions, crops, extracted values,
claims, aliases, and quality flags in a reusable local corpus format;
- provides a SQLite or DuckDB-style schema, plus JSON/JSONL interchange examples;
- keeps quantitative measurements separate from narrative claims.
5. figure-corpus-qa
- answers questions across many articles that require viewing or comparing
figures, chart values, captions, and extracted measurements;
- retrieves candidate panels, normalizes variables/units/aliases, prefers exact
values over approximate ones, and returns evidence tables with figure/panel
provenance and confidence labels.
Use this scientific example as the running test case:
A Chemical Science article about DNA-encoded chemical library selections contains
figures with chemical structures, serial dilution diagrams, and repeated 3D
sequencing "fingerprint" plots. Scientists need to understand at what library input
threshold validated hits remain distinguishable from background. Useful records
include library, target, hit code, input copies, detectability, approximate count or
color bin, background signal, linked affinity values such as KD, and whether the
evidence came from captions, nearby text, tables, source data, digitization, or
visual inference.
The skill bundle should include:
- SKILL.md for the core skill;
- nested sub-skill instruction files;
- references for schemas and architecture;
- compact examples for the running scientific article pattern;
- a setup or portability note explaining how to export the nested sub-skills as
standalone top-level skills if a harness does not support nested skill bundles;
- a lightweight validation test or checklist confirming trigger descriptions,
required files, and sub-skill routing.
Before writing files:
- inspect the current harness/project conventions for skills;
- if the install location is not discoverable, ask me where skills should be installed;
- avoid creating repo-local ".agents/skills/" unless that is actually the harness convention.
After writing the bundle:
- validate that every top-level SKILL.md has clear trigger-oriented frontmatter;
- validate that the core skill routes to every nested sub-skill;
- run the lightweight validation test/checklist;
- summarize the installed path, files created, and how to test the skill on a
scientific PDF.
</task>
</prompt>This is the first example in a growing collection of reusable, tested AI workflows.
Browse all AI skills