name: extract-figures
description: Extract and document figures from papers with detailed descriptions for AI reproducibility
argument-hint: [method-name]
allowed-tools: Read, Glob, Grep, Write, AskUserQuestion
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-figures-23description: 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 reproducibility8argument-hint: [method-name]9allowed-tools: Read, Glob, Grep, Write, AskUserQuestion10---1112# Extract Figures Skill1314This 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.1516## Prerequisites1718Before running this skill:191. `concept.md` must exist (from `/read-paper`)202. Main paper PDF must be available2122## Workflow2324### Step 1: Locate the Paper2526Find the main paper PDF:27```bash28# Check for PDF in knowledge base29ls knowledge_base/<method>/*.pdf3031# Or check concept.md for paper location32grep -i "pdf\|paper" knowledge_base/<method>/concept.md33```3435### Step 2: Read and Analyze Figures3637Read the paper PDF and for each figure, extract:38391. **Figure identifier** (Figure 1, Figure 2a, etc.)402. **Figure type** (density plot, heatmap, UMAP, scatter plot, bar chart, box plot, workflow diagram, etc.)413. **Axes definitions**:42 - X-axis: variable, units, scale (linear/log)43 - Y-axis: variable, units, scale44 - Color axis (if applicable): what it represents454. **Data shown**:46 - What data/samples are plotted47 - Number of conditions/groups48 - Any subsetting or filtering applied495. **Visual elements**:50 - Color scheme (categorical palette, gradient, specific colors if notable)51 - Annotations (arrows, labels, statistical indicators)52 - Panel layout (if multi-panel)536. **Scientific objective**: What question does this figure answer?547. **Key findings**: What conclusion should the reader draw?5556### Step 3: Document Figure Details5758Scientific figures typically contain multiple panels (A, B, C, D...) that together tell a story. Document at two levels:59601. **Figure level**: Overall narrative and how panels connect612. **Panel level**: Detailed specifications for each panel6263#### Template for Multi-Panel Figures6465```markdown66### Figure X: [Overall Figure Title]6768**Panel Layout:** [rows × cols] or [custom arrangement description]6970**Narrative:** [How do the panels flow together? What story does this figure tell?]7172---7374#### Panel A: [Panel Title]7576**Type:** [density plot | heatmap | UMAP | scatter | bar | box | line | workflow | other]7778**Axes:**79- X-axis: [variable name] ([units]) - [scale type]80- Y-axis: [variable name] ([units]) - [scale type]81- Color: [what color represents] - [palette type/specific colors]8283**Data:**84- Source: [what data is being visualized]85- Samples/conditions: [number and description]86- Filtering: [any data subsetting]8788**Visual Elements:**89- [Legends, annotations, reference lines, error bars, etc.]9091**Message:** [What does this specific panel show?]9293---9495#### Panel B: [Panel Title]9697**Type:** [...]9899[Continue for each panel...]100101---102103**Figure Objective:** [What scientific question does the complete figure address?]104105**Key Findings:** [What should the reader conclude from this figure as a whole?]106107**Reproduction Notes:** [Algorithms, parameters, thresholds, software used]108```109110#### Template for Single-Panel Figures111112```markdown113### Figure X: [Descriptive Title]114115**Type:** [density plot | heatmap | UMAP | scatter | bar | box | line | workflow | other]116117**Axes:**118- X-axis: [variable name] ([units]) - [scale type]119- Y-axis: [variable name] ([units]) - [scale type]120- Color: [what color represents] - [palette type]121122**Data:**123- Source: [what data is being visualized]124- Samples/conditions: [number and description]125- Filtering: [any data subsetting]126127**Visual Elements:**128- [List key visual features: legends, annotations, reference lines, etc.]129130**Objective:** [What scientific question does this figure address?]131132**Key Findings:** [What should the reader conclude from this figure?]133134**Reproduction Notes:** [Any specific details needed to recreate: algorithms, parameters, thresholds]135```136137#### Panel Relationship Patterns138139Common ways panels relate to each other (non-exhaustive — name additional patterns as you encounter them):140141| Pattern | Description | Example |142|---------|-------------|---------|143| **Sequential** | A→B→C shows a process | Raw data → Processing → Result |144| **Comparative** | Same visualization, different conditions | Method A vs Method B vs Method C |145| **Zoom** | Overview then detail | Full dataset → Subset → Single sample |146| **Multi-metric** | Same data, different measurements | Accuracy, Precision, Recall |147| **Before/After** | Pre- and post-processing | Unnormalized vs Normalized |148| **Temporal** | Same entity over time | Cells profiled at multiple timepoints |149| **Hierarchical** | Broad classification → progressive detail | All cells → cluster → subset markers |150| **Correlation** | Pairwise relationships | Correlation matrix, pairwise scatter |151| **Network** | Entities + relationships | Cell-cell communication, gene regulatory |152153### Step 4: Categorize Figures154155Group figures by their purpose:156157| Category | Description | Typical Figure Types |158|----------|-------------|---------------------|159| **Workflow** | Method overview/pipeline | Flow diagrams, schematics |160| **Demonstration** | Show the method working | Before/after comparisons, density plots |161| **Benchmarking** | Compare to other methods | Bar charts, box plots, heatmaps |162| **Validation** | Ground truth comparison | Scatter plots, confusion matrices |163| **Application** | Real-world use cases | UMAPs, heatmaps, biological results |164165### Step 5: Create figures.md166167Generate `knowledge_base/<method>/figures.md`:168169### Step 6: Verify and Refine170171Re-read the generated `figures.md` and perform an editorial review:172173#### Completeness Check174- [ ] All main figures documented (check paper for total figure count)175- [ ] All panels within each figure documented (A, B, C, D...)176- [ ] Figure Summary table covers all figures177- [ ] Panel Index table covers all panels178- [ ] Every panel has: type, axes, data, visual elements, message179180#### Accuracy Check181- [ ] Figure/panel numbers match the paper exactly182- [ ] Axis labels and units are accurate183- [ ] Data sources described match what's shown184- [ ] Color descriptions match actual figure colors185- [ ] Statistical annotations (p-values, significance) are correct186187#### Reproducibility Check188- [ ] Could an AI recreate this figure from the description alone?189- [ ] All algorithms/parameters mentioned in reproduction notes190- [ ] Data filtering/subsetting criteria are explicit191- [ ] Software packages/versions noted where relevant192193#### Flow and Clarity194- [ ] Narrative flow between panels is clear and accurate195- [ ] Panel relationship pattern is correctly identified (sequential, comparative, etc.)196- [ ] Scientific objectives are clearly stated197- [ ] Key findings align with paper's conclusions198199#### Efficiency Improvements200- Consolidate repetitive panel descriptions where appropriate201- Ensure figure summaries are concise (1-2 sentences)202- Remove filler phrases from panel messages203- Standardize terminology across all panel descriptions (use consistent axis names, etc.)204205#### Cross-Reference Validation206- [ ] Figure categories align with content207- [ ] Panel types match the Figure Type Reference table208- [ ] References to method concepts align with `concept.md`209210Make corrections directly to the file, then proceed to generate output:211212```markdown213---214name: <method>215paper: <paper reference>216total_main_figures: <count>217total_panels: <count>218last_analyzed: <date>219---220221# <Method> - Figure Documentation222223## Overview224225### Figure Summary226227| Figure | Panels | Category | Overall Message |228|--------|--------|----------|-----------------|229| Fig 1 | A-D | Workflow | Method overview and pipeline |230| Fig 2 | A-F | Demonstration | Batch effect before/after |231| Fig 3 | A-C | Benchmarking | Comparison with other methods |232| ... | ... | ... | ... |233234### Panel Index235236| Panel | Type | What It Shows |237|-------|------|---------------|238| Fig 1A | workflow diagram | Input data and preprocessing |239| Fig 1B | density plot | Peak detection illustration |240| Fig 1C | line plot | Warping function visualization |241| Fig 1D | density plot | Normalized output |242| Fig 2A | ridge plot | Raw ADT distributions by sample |243| Fig 2B | ridge plot | Normalized distributions |244| ... | ... | ... |245246## Main Figures247248### Figure 1: Method Overview and Workflow249250**Panel Layout:** 2×2 grid (A-D)251252**Narrative:** Panel A introduces the input data format, B shows the peak detection step,253C illustrates the warping function alignment, and D shows the final normalized output.254Together they walk through the complete ADTnorm pipeline.255256---257258#### Panel A: Input Data Structure259[Detailed panel description...]260261#### Panel B: Peak Detection262[Detailed panel description...]263264[Continue for each panel...]265266---267268**Figure Objective:** Provide a complete visual overview of the ADTnorm method.269270**Key Findings:** ADTnorm transforms variable ADT distributions into aligned, normalized profiles.271272---273274### Figure 2: [Title]275[Detailed description using multi-panel template]276277...278279## Supplementary Figures (Key)280281[Only include supplementary figures that add significant information not captured in main figures]282283---284285*Generated by `/extract-figures` skill on <date>*286```287288## Figure Type Reference289290Common figure types in bioinformatics papers:291292| Type | Description | Key Elements to Document |293|------|-------------|-------------------------|294| **Density/Ridge plot** | Distribution of values | Variable, grouping, bandwidth |295| **Heatmap** | Matrix visualization | Row/col variables, clustering, color scale |296| **UMAP/t-SNE** | Dimensionality reduction | Perplexity/n_neighbors, color mapping |297| **Scatter plot** | Two variables | Both axes, point coloring, trend lines |298| **Box/Violin plot** | Distribution comparison | Groups, statistical tests shown |299| **Bar chart** | Categorical comparisons | Categories, error bars, significance |300| **Line plot** | Trends over continuous variable | X variable, multiple lines meaning |301| **Workflow diagram** | Method pipeline | Steps, decision points, inputs/outputs |302| **Sankey/Alluvial** | Flow between categories | Source/target, flow width meaning |303304## Output305306Creates:307- `knowledge_base/<method>/figures.md` - Comprehensive figure documentation308309### Folder Structure310```311knowledge_base/<method>/312├── concept.md # From /read-paper313├── theory.md # From /understand-theory314├── code.md # From /learn-code315├── figures.md # From /extract-figures (this skill)316├── repo/ # Cloned repository317└── scripts/ # Key scripts318```319320## Usage Examples321322```323/extract-figures ADTnorm324/extract-figures Seurat325/extract-figures scanpy326```327328## Tips329330- Main figures prioritized over supplementary (main figures tell the story)331- Focus on figures that demonstrate the method's contribution332- Include enough detail that someone could recreate the figure with different data333- Note any statistical methods shown (p-values, confidence intervals)334- Document color choices if they convey meaning (e.g., red=high, blue=low)335336### Multi-Panel Figure Tips337338- Always document the **narrative flow** between panels (how they connect)339- Identify the **panel relationship pattern** (sequential, comparative, zoom, etc.)340- Each panel should have its own complete specification341- Note shared elements (legends, color scales) that apply across panels342- If panels share axes or scales, document this explicitly343- Panels often have implicit left-to-right or top-to-bottom reading order