From research-skills
Create data visualizations, design figures, and plot analysis results. Specialized for observational cosmology (spectra, covariances, posteriors, sky maps) but capable of creative/expressive output for outreach. Use when: plotting data, designing figures for papers/talks, visualizing uncertainty, creating publication-quality graphics, or any task involving matplotlib/seaborn/plotly. Triggers on: "plot", "figure", "visualize", "chart", "graph", "histogram", "scatter", "heatmap", "contour", "power spectrum", "corner plot", or any request to create or improve data graphics.
npx claudepluginhub cailmdaley/skills --plugin research-skillsThis skill uses the workspace's default tool permissions.
Decision framework for translating data into effective visual form. Synthesizes Bertin, Cleveland, Tufte, Cairo, Wilke, and Knaflic — optimized for scientific work with cosmology-specific conventions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Decision framework for translating data into effective visual form. Synthesizes Bertin, Cleveland, Tufte, Cairo, Wilke, and Knaflic — optimized for scientific work with cosmology-specific conventions.
Before plotting, establish two dimensions:
Identify what you're visualizing:
| Data Type | Description | Likely Forms |
|---|---|---|
| Amounts | Values across categories | Bar, dot plot, heatmap |
| Distributions | Spread/shape of values | Histogram, KDE, violin, ridgeline |
| X-Y Relationships | Continuous variables | Scatter, line, confidence bands |
| Uncertainty | Error on measurements | Error bars, bands, gradient ribbons |
| Proportions | Parts of whole | Stacked bar, pie (rarely) |
| Spatial/Maps | Geographic or sky data | Mollweide, healpix, choropleth |
| Correlations | Variable relationships | Covariance matrix, triangle plot |
Determine the venue—this switches the entire rule set:
Mode A: Analytical/Paper
Mode B: Presentation/Outreach
Route from data to visualization form:
For each variable, classify:
Check for uncertainty: Is there error on mean (discrete bars) or intrinsic spread (continuous band)?
Match importance to perceptual accuracy:
| Rank | Encoding | Use For |
|---|---|---|
| 1 | Position on common scale | Primary comparisons, precise values |
| 2 | Position on non-aligned scales | Secondary comparisons |
| 3 | Length | Bar charts (amounts only) |
| 4 | Angle/Slope | Avoid for precise reading |
| 5 | Area | Gestalt impressions, bubble charts |
| 6 | Color saturation | Tertiary encoding, density |
Rule: If precise comparison is needed, use position. If gestalt impression is needed, use color/area.
Consult viz-catalog.md for the specific form. Key mappings:
| You Have | Consider |
|---|---|
| Spectrum (continuous x, continuous y, uncertainty) | Line + confidence band, residual subplot |
| Correlation/covariance matrix | Heatmap, diverging colormap, white at zero |
| Parameter posteriors | Triangle plot, ridgeline, violin |
| Comparison across groups | Small multiples > overlay when groups > 4 |
| Time series | Line, banking to 45 degrees |
| Amounts across categories | Dot plot (Cleveland) > bar chart |
If Mode A (Paper):
If Mode B (Outreach):
These conventions override general principles for domain consistency:
Brief rules from perceptual science:
These "pop out" in <250ms—use for key distinctions:
If your main finding should be visible at a glance, encode it preattentively.
Humans hold ~4 chunks in working memory:
Never rely on color alone:
After generating the plot, inspect against:
Squint at the figure. What stands out? If it's not your main finding, you have:
For each element, ask: "Does this earn its ink?"
Two elements create emergent visual artifacts (the space between). Check:
Verify with simulation (viridis is designed for CVD safety). Test: Would the message survive grayscale printing?
Consult as needed:
Library preference: Use seaborn over raw matplotlib when possible. Seaborn provides cleaner defaults and better statistical visualization primitives.
| Mistake | Fix |
|---|---|
| Jet/rainbow colormap | Use forestdawn (diverging) or mako/rocket (sequential) |
| >5 colors in legend | Small multiples or direct labeling |
| Dual y-axes | Two separate plots or faceting |
| 3D effects | Never. Use 2D with color/facets |
| Pie charts for comparison | Dot plot or bar chart |
| Bar chart not starting at zero | Start at zero (length encoding) or use dot plot |
| Truncated axis exaggerating effect | Show full range or use log scale |
| Heavy matplotlib defaults | Apply decluttering checklist |