Awesome-Agent-Skills-for-Empirical-Research figures-gallery
Generates an HTML gallery of all project figures with captions and source notebooks. Use when reviewing figures.
install
source · Clone the upstream repo
git clone https://github.com/brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/29-quarcs-lab-project20XXy/dot-claude/skills/figures-gallery" ~/.claude/skills/brycewang-stanford-awesome-agent-skills-for-empirical-research-figures-gallery && rm -rf "$T"
manifest:
skills/29-quarcs-lab-project20XXy/dot-claude/skills/figures-gallery/SKILL.mdsource content
Generate Figures Gallery
Create an HTML gallery page displaying all project figures with their captions and source notebooks.
Steps
-
Scan
for all image files:images/- Supported formats:
,.png
,.jpg
,.jpeg
,.svg.pdf - Record each file's name, path, and modification date
- Supported formats:
-
Scan all registered notebooks (from
) for cells with_quarto.yml
labels:fig-- Extract the cell label (e.g.,
,fig-sample
)fig-event-study - Extract the caption from
or#| fig-cap:
directives*| fig-cap: - Record the source notebook path
- Extract the cell label (e.g.,
-
Generate an HTML gallery page with:
- A title and generation timestamp
- For each figure from
:images/- Image thumbnail (or placeholder for PDFs)
- Filename as caption
- File size and dimensions (if determinable)
- For each figure from notebooks:
- The cell label
- The caption (from cell directive)
- The source notebook name
- The embed shortcode:
{{< embed notebooks/<name>.ipynb#<label> >}}
- Simple CSS styling for a grid layout
-
Save the gallery to
(the_manuscript/figures-gallery.html
directory is gitignored, so this output won't be committed)._manuscript/ -
Report:
- File path to the gallery
- Count of figures from
images/ - Count of figure cells from notebooks
- Command to open:
open _manuscript/figures-gallery.html
Error handling
- If
does not exist or is empty, note it and continue with notebook figures.images/ - If no notebooks have
labeled cells, note it and continue withfig-
files.images/ - If both sources are empty, report "No figures found in the project."