figure-generation — Claude Code skill: what it does, how to install
Builds publication-ready scientific plots through query expansion, code execution, and visual verification. Helps researchers format charts for papers.
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a claude-codeWhat figure-generation does
The skill generates academic figures using matplotlib and seaborn across three stages. It turns a prompt into detailed specifications, writes a Python script, and runs it locally. If execution throws an error or fails to produce an image, the agent catches the traceback and retries up to 4 times.
Every run exports both a 300 DPI PNG preview and a vector PDF for final document assembly. The tool also prints a ready-to-use \begin{figure} LaTeX snippet. Pre-built templates from scripts/figure_template.py include formats such as heatmaps, radar plots, ablation graphs, and training curves.
A working Python environment is strictly required on your machine. The skill enforces paper publication standards automatically: labels remain at 8pt or larger, palettes avoid red-green confusion, and standard matplotlib titles are swapped for LaTeX captions.
What it helps with
- create vector PDF plots matching academic paper standards
- fix matplotlib script execution errors within 4 retries
- generate accessible figures using colorblind-safe palettes
- produce LaTeX figure snippets alongside rendered charts
Example prompts for the agent
- Generate an ablation plot using results from results/ablation.csv
- Create a training curve in vector PDF format for a conference paper
- Plot an attention heatmap from attention_weights.npy with colorblind-friendly colors
How to install figure-generation
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a claude-code2Manually: put the files in place
~/.claude/skills/figure-generation/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/figure-generation/
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a codex2Manually: put the files in place
.agents/skills/figure-generation/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a cursor2Manually: put the files in place
.cursor/skills/figure-generation/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install lingzhi227/agent-research-skills figure-generation2Manually: put the files in place
.github/skills/figure-generation/SKILL.md1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a gemini-cli2Platform CLI
gemini skills install https://github.com/lingzhi227/agent-research-skills --path skills/figure-generationManually: put the files in place
.devin/skills/figure-generation/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about figure-generation
How to install figure-generation in Claude Code?
Run npx skills add lingzhi227/agent-research-skills --skill figure-generation -a claude-code in your terminal.
What does the figure-generation skill do?
It translates plot requests into executable matplotlib or seaborn code, tests it locally, and refines the visual output across up to 4 retries.
What data inputs and output formats does it handle?
It processes CSV, JSON, NPY, and PKL files. Outputs include 300 DPI PNG previews, vector PDFs, and LaTeX figure code.