name: extract-figures
description: "Extract and document figures from papers with detailed descriptions for AI reproducibility"
Codex Adapter
This adapter is generated from skills/extract-figures/SKILL.md. Edit the source Claude skill, then run python3 scripts/sync_codex_skills.py to refresh the Codex mirror.
Preserve the shared workflow contract: knowledge_base/, projects/<name>/literature/, fitness_summary.md, analysis_plan.md, audit files, and progress files remain the expected outputs.
Claude-to-Codex Term Map
/skill-name examples mean $skill-name or explicit plugin/skill invocation in Codex.
Task / TaskOutput mean delegated/fresh-agent execution when available; otherwise run phases sequentially and verify files.
AskUserQuestion means ask the user directly when required.
WebFetch / WebSearch mean Codex web/search tools when available.
Source Skill Instructions
Extract Figures Skill
This skill analyzes figures from scientific papers and creates detailed documentation that would allow an AI agent to recreate them. Focus is on main paper figures which tell the core story.
Prerequisites
Before running this skill:
concept.md must exist (from /read-paper)
- Main paper PDF must be available
Workflow
Step 1: Locate the Paper
Find the main paper PDF:
# Check for PDF in knowledge base
ls knowledge_base/<method>/*.pdf
# Or check concept.md for paper location
grep -i "pdf\|paper" knowledge_base/<method>/concept.md
Step 2: Read and Analyze Figures
Read the paper PDF and for each figure, extract:
- Figure identifier (Figure 1, Figure 2a, etc.)
- Figure type (density plot, heatmap, UMAP, scatter plot, bar chart, box plot, workflow diagram, etc.)
- Axes definitions:
- X-axis: variable, units, scale (linear/log)
- Y-axis: variable, units, scale
- Color axis (if applicable): what it represents
- Data shown:
- What data/samples are plotted
- Number of conditions/groups
- Any subsetting or filtering applied
- Visual elements:
- Color scheme (categorical palette, gradient, specific colors if notable)
- Annotations (arrows, labels, statistical indicators)
- Panel layout (if multi-panel)
- Scientific objective: What question does this figure answer?
- Key findings: What conclusion should the reader draw?
Step 3: Document Figure Details
Scientific figures typically contain multiple panels (A, B, C, D...) that together tell a story. Document at two levels:
- Figure level: Overall narrative and how panels connect
- Panel level: Detailed specifications for each panel
Template for Multi-Panel Figures
### Figure X: [Overall Figure Title]
**Panel Layout:** [rows × cols] or [custom arrangement description]
**Narrative:** [How do the panels flow together? What story does this figure tell?]
---
#### Panel A: [Panel Title]
**Type:** [density plot | heatmap | UMAP | scatter | bar | box | line | workflow | other]
**Axes:**
- X-axis: [variable name] ([units]) - [scale type]
- Y-axis: [variable name] ([units]) - [scale type]
- Color: [what color represents] - [palette type/specific colors]
**Data:**
- Source: [what data is being visualized]
- Samples/conditions: [number and description]
- Filtering: [any data subsetting]
**Visual Elements:**
- [Legends, annotations, reference lines, error bars, etc.]
**Message:** [What does this specific panel show?]
---
#### Panel B: [Panel Title]
**Type:** [...]
[Continue for each panel...]
---
**Figure Objective:** [What scientific question does the complete figure address?]
**Key Findings:** [What should the reader conclude from this figure as a whole?]
**Reproduction Notes:** [Algorithms, parameters, thresholds, software used]
Template for Single-Panel Figures
### Figure X: [Descriptive Title]
**Type:** [density plot | heatmap | UMAP | scatter | bar | box | line | workflow | other]
**Axes:**
- X-axis: [variable name] ([units]) - [scale type]
- Y-axis: [variable name] ([units]) - [scale type]
- Color: [what color represents] - [palette type]
**Data:**
- Source: [what data is being visualized]
- Samples/conditions: [number and description]
- Filtering: [any data subsetting]
**Visual Elements:**
- [List key visual features: legends, annotations, reference lines, etc.]
**Objective:** [What scientific question does this figure address?]
**Key Findings:** [What should the reader conclude from this figure?]
**Reproduction Notes:** [Any specific details needed to recreate: algorithms, parameters, thresholds]
Panel Relationship Patterns
Common ways panels relate to each other (non-exhaustive — name additional patterns as you encounter them):
| Pattern |
Description |
Example |
| Sequential |
A→B→C shows a process |
Raw data → Processing → Result |
| Comparative |
Same visualization, different conditions |
Method A vs Method B vs Method C |
| Zoom |
Overview then detail |
Full dataset → Subset → Single sample |
| Multi-metric |
Same data, different measurements |
Accuracy, Precision, Recall |
| Before/After |
Pre- and post-processing |
Unnormalized vs Normalized |
| Temporal |
Same entity over time |
Cells profiled at multiple timepoints |
| Hierarchical |
Broad classification → progressive detail |
All cells → cluster → subset markers |
| Correlation |
Pairwise relationships |
Correlation matrix, pairwise scatter |
| Network |
Entities + relationships |
Cell-cell communication, gene regulatory |
Step 4: Categorize Figures
Group figures by their purpose:
| Category |
Description |
Typical Figure Types |
| Workflow |
Method overview/pipeline |
Flow diagrams, schematics |
| Demonstration |
Show the method working |
Before/after comparisons, density plots |
| Benchmarking |
Compare to other methods |
Bar charts, box plots, heatmaps |
| Validation |
Ground truth comparison |
Scatter plots, confusion matrices |
| Application |
Real-world use cases |
UMAPs, heatmaps, biological results |
Step 5: Create figures.md
Generate knowledge_base/<method>/figures.md:
Step 6: Verify and Refine
Re-read the generated figures.md and perform an editorial review:
Completeness Check
Accuracy Check
Reproducibility Check
Flow and Clarity
Efficiency Improvements
- Consolidate repetitive panel descriptions where appropriate
- Ensure figure summaries are concise (1-2 sentences)
- Remove filler phrases from panel messages
- Standardize terminology across all panel descriptions (use consistent axis names, etc.)
Cross-Reference Validation
Make corrections directly to the file, then proceed to generate output:
---
name: <method>
paper: <paper reference>
total_main_figures: <count>
total_panels: <count>
last_analyzed: <date>
---
# <Method> - Figure Documentation
## Overview
### Figure Summary
| Figure | Panels | Category | Overall Message |
|--------|--------|----------|-----------------|
| Fig 1 | A-D | Workflow | Method overview and pipeline |
| Fig 2 | A-F | Demonstration | Batch effect before/after |
| Fig 3 | A-C | Benchmarking | Comparison with other methods |
| ... | ... | ... | ... |
### Panel Index
| Panel | Type | What It Shows |
|-------|------|---------------|
| Fig 1A | workflow diagram | Input data and preprocessing |
| Fig 1B | density plot | Peak detection illustration |
| Fig 1C | line plot | Warping function visualization |
| Fig 1D | density plot | Normalized output |
| Fig 2A | ridge plot | Raw ADT distributions by sample |
| Fig 2B | ridge plot | Normalized distributions |
| ... | ... | ... |
## Main Figures
### Figure 1: Method Overview and Workflow
**Panel Layout:** 2×2 grid (A-D)
**Narrative:** Panel A introduces the input data format, B shows the peak detection step,
C illustrates the warping function alignment, and D shows the final normalized output.
Together they walk through the complete ADTnorm pipeline.
---
#### Panel A: Input Data Structure
[Detailed panel description...]
#### Panel B: Peak Detection
[Detailed panel description...]
[Continue for each panel...]
---
**Figure Objective:** Provide a complete visual overview of the ADTnorm method.
**Key Findings:** ADTnorm transforms variable ADT distributions into aligned, normalized profiles.
---
### Figure 2: [Title]
[Detailed description using multi-panel template]
...
## Supplementary Figures (Key)
[Only include supplementary figures that add significant information not captured in main figures]
---
*Generated by `/extract-figures` skill on <date>*
Figure Type Reference
Common figure types in bioinformatics papers:
| Type |
Description |
Key Elements to Document |
| Density/Ridge plot |
Distribution of values |
Variable, grouping, bandwidth |
| Heatmap |
Matrix visualization |
Row/col variables, clustering, color scale |
| UMAP/t-SNE |
Dimensionality reduction |
Perplexity/n_neighbors, color mapping |
| Scatter plot |
Two variables |
Both axes, point coloring, trend lines |
| Box/Violin plot |
Distribution comparison |
Groups, statistical tests shown |
| Bar chart |
Categorical comparisons |
Categories, error bars, significance |
| Line plot |
Trends over continuous variable |
X variable, multiple lines meaning |
| Workflow diagram |
Method pipeline |
Steps, decision points, inputs/outputs |
| Sankey/Alluvial |
Flow between categories |
Source/target, flow width meaning |
Output
Creates:
knowledge_base/<method>/figures.md - Comprehensive figure documentation
Folder Structure
knowledge_base/<method>/
├── concept.md # From /read-paper
├── theory.md # From /understand-theory
├── code.md # From /learn-code
├── figures.md # From /extract-figures (this skill)
├── repo/ # Cloned repository
└── scripts/ # Key scripts
Usage Examples
/extract-figures ADTnorm
/extract-figures Seurat
/extract-figures scanpy
Tips
- Main figures prioritized over supplementary (main figures tell the story)
- Focus on figures that demonstrate the method's contribution
- Include enough detail that someone could recreate the figure with different data
- Note any statistical methods shown (p-values, confidence intervals)
- Document color choices if they convey meaning (e.g., red=high, blue=low)
Multi-Panel Figure Tips
- Always document the narrative flow between panels (how they connect)
- Identify the panel relationship pattern (sequential, comparative, zoom, etc.)
- Each panel should have its own complete specification
- Note shared elements (legends, color scales) that apply across panels
- If panels share axes or scales, document this explicitly
- Panels often have implicit left-to-right or top-to-bottom reading order
1---2name: extract-figures3description: Extract and document figures from papers with detailed descriptions for AI reproducibility4---5---6name: extract-figures7description: "Extract and document figures from papers with detailed descriptions for AI reproducibility"8---910# Codex Adapter1112This adapter is generated from `skills/extract-figures/SKILL.md`. Edit the source Claude skill, then run `python3 scripts/sync_codex_skills.py` to refresh the Codex mirror.1314Preserve the shared workflow contract: `knowledge_base/`, `projects/<name>/literature/`, `fitness_summary.md`, `analysis_plan.md`, audit files, and progress files remain the expected outputs.1516## Claude-to-Codex Term Map1718- `/skill-name` examples mean `$skill-name` or explicit plugin/skill invocation in Codex.19- `Task` / `TaskOutput` mean delegated/fresh-agent execution when available; otherwise run phases sequentially and verify files.20- `AskUserQuestion` means ask the user directly when required.21- `WebFetch` / `WebSearch` mean Codex web/search tools when available.2223## Source Skill Instructions2425# Extract Figures Skill2627This skill analyzes figures from scientific papers and creates detailed documentation that would allow an AI agent to recreate them. Focus is on main paper figures which tell the core story.2829## Prerequisites3031Before running this skill:321. `concept.md` must exist (from `/read-paper`)332. Main paper PDF must be available3435## Workflow3637### Step 1: Locate the Paper3839Find the main paper PDF:40```bash41# Check for PDF in knowledge base42ls knowledge_base/<method>/*.pdf4344# Or check concept.md for paper location45grep -i "pdf\|paper" knowledge_base/<method>/concept.md46```4748### Step 2: Read and Analyze Figures4950Read the paper PDF and for each figure, extract:51521. **Figure identifier** (Figure 1, Figure 2a, etc.)532. **Figure type** (density plot, heatmap, UMAP, scatter plot, bar chart, box plot, workflow diagram, etc.)543. **Axes definitions**:55 - X-axis: variable, units, scale (linear/log)56 - Y-axis: variable, units, scale57 - Color axis (if applicable): what it represents584. **Data shown**:59 - What data/samples are plotted60 - Number of conditions/groups61 - Any subsetting or filtering applied625. **Visual elements**:63 - Color scheme (categorical palette, gradient, specific colors if notable)64 - Annotations (arrows, labels, statistical indicators)65 - Panel layout (if multi-panel)666. **Scientific objective**: What question does this figure answer?677. **Key findings**: What conclusion should the reader draw?6869### Step 3: Document Figure Details7071Scientific figures typically contain multiple panels (A, B, C, D...) that together tell a story. Document at two levels:72731. **Figure level**: Overall narrative and how panels connect742. **Panel level**: Detailed specifications for each panel7576#### Template for Multi-Panel Figures7778```markdown79### Figure X: [Overall Figure Title]8081**Panel Layout:** [rows × cols] or [custom arrangement description]8283**Narrative:** [How do the panels flow together? What story does this figure tell?]8485---8687#### Panel A: [Panel Title]8889**Type:** [density plot | heatmap | UMAP | scatter | bar | box | line | workflow | other]9091**Axes:**92- X-axis: [variable name] ([units]) - [scale type]93- Y-axis: [variable name] ([units]) - [scale type]94- Color: [what color represents] - [palette type/specific colors]9596**Data:**97- Source: [what data is being visualized]98- Samples/conditions: [number and description]99- Filtering: [any data subsetting]100101**Visual Elements:**102- [Legends, annotations, reference lines, error bars, etc.]103104**Message:** [What does this specific panel show?]105106---107108#### Panel B: [Panel Title]109110**Type:** [...]111112[Continue for each panel...]113114---115116**Figure Objective:** [What scientific question does the complete figure address?]117118**Key Findings:** [What should the reader conclude from this figure as a whole?]119120**Reproduction Notes:** [Algorithms, parameters, thresholds, software used]121```122123#### Template for Single-Panel Figures124125```markdown126### Figure X: [Descriptive Title]127128**Type:** [density plot | heatmap | UMAP | scatter | bar | box | line | workflow | other]129130**Axes:**131- X-axis: [variable name] ([units]) - [scale type]132- Y-axis: [variable name] ([units]) - [scale type]133- Color: [what color represents] - [palette type]134135**Data:**136- Source: [what data is being visualized]137- Samples/conditions: [number and description]138- Filtering: [any data subsetting]139140**Visual Elements:**141- [List key visual features: legends, annotations, reference lines, etc.]142143**Objective:** [What scientific question does this figure address?]144145**Key Findings:** [What should the reader conclude from this figure?]146147**Reproduction Notes:** [Any specific details needed to recreate: algorithms, parameters, thresholds]148```149150#### Panel Relationship Patterns151152Common ways panels relate to each other (non-exhaustive — name additional patterns as you encounter them):153154| Pattern | Description | Example |155|---------|-------------|---------|156| **Sequential** | A→B→C shows a process | Raw data → Processing → Result |157| **Comparative** | Same visualization, different conditions | Method A vs Method B vs Method C |158| **Zoom** | Overview then detail | Full dataset → Subset → Single sample |159| **Multi-metric** | Same data, different measurements | Accuracy, Precision, Recall |160| **Before/After** | Pre- and post-processing | Unnormalized vs Normalized |161| **Temporal** | Same entity over time | Cells profiled at multiple timepoints |162| **Hierarchical** | Broad classification → progressive detail | All cells → cluster → subset markers |163| **Correlation** | Pairwise relationships | Correlation matrix, pairwise scatter |164| **Network** | Entities + relationships | Cell-cell communication, gene regulatory |165166### Step 4: Categorize Figures167168Group figures by their purpose:169170| Category | Description | Typical Figure Types |171|----------|-------------|---------------------|172| **Workflow** | Method overview/pipeline | Flow diagrams, schematics |173| **Demonstration** | Show the method working | Before/after comparisons, density plots |174| **Benchmarking** | Compare to other methods | Bar charts, box plots, heatmaps |175| **Validation** | Ground truth comparison | Scatter plots, confusion matrices |176| **Application** | Real-world use cases | UMAPs, heatmaps, biological results |177178### Step 5: Create figures.md179180Generate `knowledge_base/<method>/figures.md`:181182### Step 6: Verify and Refine183184Re-read the generated `figures.md` and perform an editorial review:185186#### Completeness Check187- [ ] All main figures documented (check paper for total figure count)188- [ ] All panels within each figure documented (A, B, C, D...)189- [ ] Figure Summary table covers all figures190- [ ] Panel Index table covers all panels191- [ ] Every panel has: type, axes, data, visual elements, message192193#### Accuracy Check194- [ ] Figure/panel numbers match the paper exactly195- [ ] Axis labels and units are accurate196- [ ] Data sources described match what's shown197- [ ] Color descriptions match actual figure colors198- [ ] Statistical annotations (p-values, significance) are correct199200#### Reproducibility Check201- [ ] Could an AI recreate this figure from the description alone?202- [ ] All algorithms/parameters mentioned in reproduction notes203- [ ] Data filtering/subsetting criteria are explicit204- [ ] Software packages/versions noted where relevant205206#### Flow and Clarity207- [ ] Narrative flow between panels is clear and accurate208- [ ] Panel relationship pattern is correctly identified (sequential, comparative, etc.)209- [ ] Scientific objectives are clearly stated210- [ ] Key findings align with paper's conclusions211212#### Efficiency Improvements213- Consolidate repetitive panel descriptions where appropriate214- Ensure figure summaries are concise (1-2 sentences)215- Remove filler phrases from panel messages216- Standardize terminology across all panel descriptions (use consistent axis names, etc.)217218#### Cross-Reference Validation219- [ ] Figure categories align with content220- [ ] Panel types match the Figure Type Reference table221- [ ] References to method concepts align with `concept.md`222223Make corrections directly to the file, then proceed to generate output:224225```markdown226---227name: <method>228paper: <paper reference>229total_main_figures: <count>230total_panels: <count>231last_analyzed: <date>232---233234# <Method> - Figure Documentation235236## Overview237238### Figure Summary239240| Figure | Panels | Category | Overall Message |241|--------|--------|----------|-----------------|242| Fig 1 | A-D | Workflow | Method overview and pipeline |243| Fig 2 | A-F | Demonstration | Batch effect before/after |244| Fig 3 | A-C | Benchmarking | Comparison with other methods |245| ... | ... | ... | ... |246247### Panel Index248249| Panel | Type | What It Shows |250|-------|------|---------------|251| Fig 1A | workflow diagram | Input data and preprocessing |252| Fig 1B | density plot | Peak detection illustration |253| Fig 1C | line plot | Warping function visualization |254| Fig 1D | density plot | Normalized output |255| Fig 2A | ridge plot | Raw ADT distributions by sample |256| Fig 2B | ridge plot | Normalized distributions |257| ... | ... | ... |258259## Main Figures260261### Figure 1: Method Overview and Workflow262263**Panel Layout:** 2×2 grid (A-D)264265**Narrative:** Panel A introduces the input data format, B shows the peak detection step,266C illustrates the warping function alignment, and D shows the final normalized output.267Together they walk through the complete ADTnorm pipeline.268269---270271#### Panel A: Input Data Structure272[Detailed panel description...]273274#### Panel B: Peak Detection275[Detailed panel description...]276277[Continue for each panel...]278279---280281**Figure Objective:** Provide a complete visual overview of the ADTnorm method.282283**Key Findings:** ADTnorm transforms variable ADT distributions into aligned, normalized profiles.284285---286287### Figure 2: [Title]288[Detailed description using multi-panel template]289290...291292## Supplementary Figures (Key)293294[Only include supplementary figures that add significant information not captured in main figures]295296---297298*Generated by `/extract-figures` skill on <date>*299```300301## Figure Type Reference302303Common figure types in bioinformatics papers:304305| Type | Description | Key Elements to Document |306|------|-------------|-------------------------|307| **Density/Ridge plot** | Distribution of values | Variable, grouping, bandwidth |308| **Heatmap** | Matrix visualization | Row/col variables, clustering, color scale |309| **UMAP/t-SNE** | Dimensionality reduction | Perplexity/n_neighbors, color mapping |310| **Scatter plot** | Two variables | Both axes, point coloring, trend lines |311| **Box/Violin plot** | Distribution comparison | Groups, statistical tests shown |312| **Bar chart** | Categorical comparisons | Categories, error bars, significance |313| **Line plot** | Trends over continuous variable | X variable, multiple lines meaning |314| **Workflow diagram** | Method pipeline | Steps, decision points, inputs/outputs |315| **Sankey/Alluvial** | Flow between categories | Source/target, flow width meaning |316317## Output318319Creates:320- `knowledge_base/<method>/figures.md` - Comprehensive figure documentation321322### Folder Structure323```324knowledge_base/<method>/325├── concept.md # From /read-paper326├── theory.md # From /understand-theory327├── code.md # From /learn-code328├── figures.md # From /extract-figures (this skill)329├── repo/ # Cloned repository330└── scripts/ # Key scripts331```332333## Usage Examples334335```336/extract-figures ADTnorm337/extract-figures Seurat338/extract-figures scanpy339```340341## Tips342343- Main figures prioritized over supplementary (main figures tell the story)344- Focus on figures that demonstrate the method's contribution345- Include enough detail that someone could recreate the figure with different data346- Note any statistical methods shown (p-values, confidence intervals)347- Document color choices if they convey meaning (e.g., red=high, blue=low)348349### Multi-Panel Figure Tips350351- Always document the **narrative flow** between panels (how they connect)352- Identify the **panel relationship pattern** (sequential, comparative, zoom, etc.)353- Each panel should have its own complete specification354- Note shared elements (legends, color scales) that apply across panels355- If panels share axes or scales, document this explicitly356- Panels often have implicit left-to-right or top-to-bottom reading order