← ClaudeAtlas

matplotlib-render-reviewlisted

Render-Review-Refine workflow for matplotlib charts. Visual feedback loop using Claude Code's multimodal Read tool.
Pirat83/claude-code-skills · ★ 2 · Code & Development · score 78
Install: claude install-skill Pirat83/claude-code-skills
# Matplotlib Render-Review-Refine Workflow Claude Code is multimodal -- it can see rendered PNGs via the `Read` tool. Use this to close a visual feedback loop: generate chart code, render to PNG, Read the PNG, review what you see, and iterate. --- ## Section 1: Render-Review-Refine Workflow Every chart task follows one of two workflows. Both end with visual verification. ### Workflow A -- New Chart from Scratch 1. **Write** chart code as a standalone `.py` script that: - Reads the `CHART_OUTPUT` env var for the output path (`os.environ.get("CHART_OUTPUT", "/tmp/chart_review.png")`) - Uses OOP Figure API: `Figure()` + `FigureCanvasAgg(fig)` + `fig.savefig()` - Constructs minimal test data inline OR imports from the project 2. **Render** via the harness: ```bash python ${CLAUDE_SKILL_DIR}/scripts/render_review.py /tmp/my_chart.py --output /tmp/my_chart.png ``` 3. **Read the PNG** with the `Read` tool to visually inspect the result. 4. **Apply** the Self-Review Checklist (Section 2). 5. **Fix and re-render** if issues found (max 2 additional cycles). 6. **Integrate** the chart code into the target module. Clean up temp files. ### Workflow B -- Modify Existing Chart Code 1. **Read** the existing rendering function in the target module. 2. **Make** the change directly in the target file. 3. **Write** a minimal test harness script to `/tmp/` that imports the modified code and renders a representative case with realistic data. 4. **Render** via the