zhihaoairobotic/clawphd/diagram-gen
Claude Code and agent skill by zhihaoairobotic/clawphd
- community
Checking that the SKILL.md file is still in the repository.
Generate publication-quality academic diagrams and plots from paper methodology text using optimize_input, plan_diagram, generate_image, and critique_image tools.
Install
npx vskill@latest install zhihaoairobotic/clawphd/diagram-genSKILL.md
Academic Diagram Generation
Generate NeurIPS-quality methodology diagrams or statistical plots from paper text.
Available Tools
| Tool | Purpose | |
|---|---|---|
optimize_input | Pre-process methodology text and caption (optional, improves quality) | |
plan_diagram | Full planning pipeline: retrieve references → visual ICL → plan → style | |
search_references | Browse reference diagrams independently (lightweight alternative to plan_diagram) | |
generate_image | Render a diagram or plot from a description | |
critique_image | Evaluate and get revision feedback on a generated image |
Workflow
Follow these steps in order:
Step 0 — Optimize Inputs (optional)
Call optimize_input with the raw methodology text and figure caption. This:
- Structures the methodology into diagram-ready format (components, flows, groupings)
- Sharpens a vague caption into a precise visual specification
Recommended for long or complex methodology text, or vague captions. Use the optimized outputs as inputs to plan_diagram.
Step 1 — Plan
Call plan_diagram with the methodology text, figure caption, and diagram type. This single tool call:
- Retrieves the most relevant reference examples from the curated set using a specialized retriever prompt
- Loads their images and passes them to the VLM for visual in-context learning
- Generates a comprehensive textual description using a dedicated planner prompt
- Refines the description with NeurIPS-quality aesthetic guidelines via a stylist prompt
- Recommends an aspect ratio based on content structure
You receive back an optimized, publication-ready description and a recommended aspect ratio.
Do NOT attempt to write the diagram description yourself. The plan_diagram tool produces significantly better descriptions because it uses reference images and dedicated prompts.
Step 2 — Generate
Call generate_image with the description returned by plan_diagram.
- For methodology diagrams:
diagram_type="methodology"(default) - For statistical plots:
diagram_type="statistical_plot"and includeraw_data - Pass the
aspect_ratiorecommended byplan_diagram(e.g.,"16:9","4:3")
Step 3 — Critique & Refine (max 3 rounds)
Call critique_image with the generated image, the description, source text, and caption.
- If
needs_revisionistrue: use therevised_descriptionfrom the critique, then go back to Step 2. - If
needs_revisionisfalse: the image is publication-ready. Done.
Repeat at most 3 total iterations.
Aspect Ratios
Supported: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9
Guidelines:
- Wide (16:9, 21:9): Left-to-right pipelines, sequential flows, encoder-decoder architectures
- Tall (2:3, 9:16): Top-to-bottom hierarchies, deep stacks, vertical tree structures
- Square-ish (1:1, 4:3, 3:4): Balanced architectures, grid layouts, multi-panel diagrams
Example Interaction
Important Notes
- Always call `plan_diagram` first — it handles retrieval, planning, and styling in one step with visual in-context learning from real reference diagrams.
- Never use hex codes, pixel dimensions, or CSS values in descriptions — they render as garbled text in generated images.
- Never fall back to matplotlib or LaTeX for methodology diagrams — always use the image generation model via
generate_image. - For statistical plots,
generate_imagewill automatically generate and execute matplotlib code. - Pass
user_feedbacktocritique_imageif the user has specific comments about the generated image.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclawphd/skills/diagram-gen/SKILL.md
Popularity
- Repository stars
- 157
- Repository forks
- 11
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zhihaoairobotic/clawphd/diagram-gen)