Figures Gallery
Documentsfigures-galleryFigures Gallery is an Agent Skill for documents published in the brycewang-stanford/Auto-Empirical-Research-Skills repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Generates an HTML gallery of all project figures with captions and source notebooks. Use when reviewing figures.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills/blob/HEAD/skills/29-quarcs-lab-project20XXy/dot-claude/skills/figures-gallery/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/figures-gallery, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Generate Figures Gallery
Create an HTML gallery page displaying all project figures with their captions and source notebooks.
Steps
-
Scan
images/for all image files:- Supported formats:
.png,.jpg,.jpeg,.svg,.pdf - Record each file's name, path, and modification date
- Supported formats:
-
Scan all registered notebooks (from
_quarto.yml) for cells withfig-labels:- Extract the cell label (e.g.,
fig-sample,fig-event-study) - Extract the caption from
#| fig-cap:or*| fig-cap:directives - 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
_manuscript/figures-gallery.html(the_manuscript/directory is gitignored, so this output won't be committed). -
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
images/does not exist or is empty, note it and continue with notebook figures. - If no notebooks have
fig-labeled cells, note it and continue withimages/files. - If both sources are empty, report "No figures found in the project."