altair/SKILL.md
Guide and best practices for creating data visualizations using Altair in Python. Always use this over matplotlib or seaborn.
npx skillsauth add jswortz/my-skills altairInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when tasked with generating charts, graphs, and plots using Python. Altair is a declarative statistical visualization library for Python, based on Vega and Vega-Lite. Our environment relies on Altair instead of Matplotlib and Seaborn for all new plots.
Ensure altair and vl-convert-python are available locally via uv.
import altair as alt
import pandas as pd
Altair expects data in a Pandas DataFrame, preferably in long format (melted).
import pandas as pd
import altair as alt
# 1. Prepare Data
df = pd.DataFrame({
'Epoch': [1, 2, 3],
'Metric A': [0.5, 0.6, 0.7],
'Metric B': [0.4, 0.5, 0.9]
})
# 2. Melt Data
df_melt = df.melt('Epoch', var_name='Metric', value_name='Score')
# 3. Create Base Chart
base = alt.Chart(df_melt).encode(
x=alt.X('Epoch:Q', title='Generation (Epoch)', axis=alt.Axis(tickMinStep=1))
)
# 4. Create Line Marks
lines = base.mark_line(point=True).encode(
y=alt.Y('Score:Q', title='Evaluation Score', scale=alt.Scale(domain=[0, 1.0])),
color=alt.Color('Metric:N', scale=alt.Scale(
domain=['Metric A', 'Metric B'],
range=['#4A90E2', '#F5A623']
)),
tooltip=['Epoch', 'Metric', 'Score']
)
# 5. Add Properties and Config
chart = lines.properties(
title="Evolution Performance",
width=700,
height=400
).configure_title(
fontSize=14
)
# 6. Save Chart
chart.save("output.png")
.html (Interactive web page).png (Requires vl-convert-python).svg (Requires vl-convert-python).json (Vega-Lite spec)mark_circle(size=60)mark_bar()mark_area()alt.layer(chart1, chart2).resolve_scale(y='independent')
Note: To resolve dual axis you simply create 2 independent charts and use alt.layer(c1, c2).resolve_scale(y='independent').threshold = alt.Chart(pd.DataFrame({'y': [0.70]})).mark_rule(color='red', strokeDash=[5,5]).encode(y='y:Q')
chart = alt.layer(lines, threshold)
matplotlib or seaborn unless specifically requested. Altair handles complex legends and multi-series plots in a cleaner declarative way.alt.data_transformers.disable_max_rows() with caution, or aggregate the dataframe using Pandas before passing to Altair.scale=alt.Scale(scheme='set2') (or other vega schemes) or precise hex arrays range=['#ff0000', '#00ff00'].research
Constant-Time Analyzer (ct-analyzer)
testing
--- name: condition-based-waiting description: -- name: Condition-Based Waiting description: Replace arbitrary timeouts with condition polling for reliable async tests when_to_use: when tests have ... --- -- name: Condition-Based Waiting description: Replace arbitrary timeouts with condition polling for reliable async tests when_to_use: when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior version: 1.1.0 languages: all --- # Condition-Based Waiting ## Overvi
testing
--- name: collision-zone-thinking description: -- name: Collision-Zone Thinking description: Force unrelated concepts together to discover emergent properties - "What if we treated X like Y?" when_... --- -- name: Collision-Zone Thinking description: Force unrelated concepts together to discover emergent properties - "What if we treated X like Y?" when_to_use: when conventional approaches feel inadequate and you need breakthrough innovation by forcing unrelated concepts together version: 1.1.0
documentation
--- name: canvas-design description: -- name: canvas-design description: Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the... --- -- name: canvas-design description: Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid