{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/create-viz",
  "version": "1.0.0",
  "name": "create-viz",
  "description": "Create publication-quality visualizations with Python. Use when turning query results or a DataFrame into a chart, selecting the right chart type for a trend or comparison, generating a plot for a report or presentation, or needing an interactive chart with hover and zoom.",
  "system_prompt_fragment": "# /create-viz - Create Visualizations\n\n> If you see unfamiliar placeholders or need to check which tools are connected, see [CONNECTORS.md](../../CONNECTORS.md).\n\nCreate publication-quality data visualizations using Python. Generates charts from data with best practices for clarity, accuracy, and design.\n\n## Usage\n\n```\n/create-viz <data source> [chart type] [additional instructions]\n```\n\n## Workflow\n\n### 1. Understand the Request\n\nDetermine:\n\n- **Data source**: Query results, pasted data, CSV/Excel file, or data to be queried\n- **Chart type**: Explicitly requested or needs to be recommended\n- **Purpose**: Exploration, presentation, report, dashboard component\n- **Audience**: Technical team, executives, external stakeholders\n\n### 2. Get the Data\n\n**If data warehouse is connected and data needs querying:**\n1. Write and execute the query\n2. Load results into a pandas DataFrame\n\n**If data is pasted or uploaded:**\n1. Parse the data into a pandas DataFrame\n2. Clean and prepare as needed (type conversions, null handling)\n\n**If data is from a previous analysis in the conversation:**\n1. Reference the existing data\n\n### 3. Select Chart Type\n\nIf the user didn't specify a chart type, recommend one based on the data and question:\n\n| Data Relationship | Recommended Chart |\n|---|---|\n| Trend over time | Line chart |\n| Comparison across categories | Bar chart (horizontal if many categories) |\n| Part-to-whole composition | Stacked bar or area chart (avoid pie charts unless <6 categories) |\n| Distribution of values | Histogram or box plot |\n| Correlation between two variables | Scatter plot |\n| Two-variable comparison over time | Dual-axis line or grouped bar |\n| Geographic data | Choropleth map |\n| Ranking | Horizontal bar chart |\n| Flow or process | Sankey diagram |\n| Matrix of relationships | Heatmap |\n\nExplain the recommendation briefly if the user didn't specify.\n\n### 4. Generate the Visualization\n\nWrite Python code using one of these libraries based on the need:\n\n- **matplotlib + seaborn**: Best for static, publication-quality charts. Default choice.\n- **plotly**: Best for interactive charts or when the user requests interactivity.\n\n**Code requirements:**\n\n```python\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\n\n# Set professional style\nplt.style.use('seaborn-v0_8-whitegrid')\nsns.set_palette(\"husl\")\n\n# Create figure with appropriate size\nfig, ax = plt.subplots(figsize=(10, 6))\n\n# [chart-specific code]\n\n# Always include:\nax.set_title('Clear, Descriptive Title', fontsize=14, fontweight='bold')\nax.set_xlabel('X-Axis Label', fontsize=11)\nax.set_ylabel('Y-Axis Label', fontsize=11)\n\n# Format numbers appropriately\n# - Percentages: '45.2%' not '0.452'\n# - Currency: '$1.2M' not '1200000'\n# - Large numbers: '2.3K' or '1.5M' not '2300' or '1500000'\n\n# Remove chart junk\nax.spines['top'].set_visible(False)\nax.spines['right'].set_visible(False)\n\nplt.tight_layout()\nplt.savefig('chart_name.png', dpi=150, bbox_inches='tight')\nplt.show()\n```\n\n### 5. Apply Design Best Practices\n\n**Color:**\n- Use a consistent, colorblind-friendly palette\n- Use color meaningfully (not decoratively)\n- Highlight the key data point or trend with a contrasting color\n- Grey out less important reference data\n\n**Typography:**\n- Descriptive title that states the insight, not just the metric (e.g., \"Revenue grew 23% YoY\" not \"Revenue by Month\")\n- Readable axis labels (not rotated 90 degrees if avoidable)\n- Data labels on key points when they add clarity\n\n**Layout:**\n- Appropriate whitespace and margins\n- Legend placement that doesn't obscure data\n- Sorted categories by value (not alphabetically) unless there's a natural order\n\n**Accuracy:**\n- Y-axis starts at zero for bar charts\n- No misleading axis breaks without clear notation\n- Consistent scales when comparing panels\n- Appropriate precision (don't show 10 decimal places)\n\n### 6. Save and Present\n\n1. Save the chart as a PNG file with descriptive name\n2. Display the chart to the user\n3. Provide the code used so they can modify it\n4. Suggest variations (different chart type, different grouping, zoomed time range)\n\n## Examples\n\n```\n/create-viz Show monthly revenue for the last 12 months as a line chart with the trend highlighted\n```\n\n```\n/create-viz Here's our NPS data by product: [pastes data]. Create a horizontal bar chart ranking products by score.\n```\n\n```\n/create-viz Query the orders table and create a heatmap of order volume by day-of-week and hour\n```\n\n## Tips\n\n- If you want interactive charts (hover, zoom, filter), mention \"interactive\" and Claude will use plotly\n- Specify \"presentation\" if you need larger fonts and higher contrast\n- You can request multiple charts at once (e.g., \"create a 2x2 grid of charts showing...\")\n- Charts are saved to your current directory as PNG files",
  "applicable_domains": [
    "data",
    "analytics"
  ],
  "invocation": [
    "/create-viz",
    "/create-viz <data source> [chart type]"
  ],
  "tags": [
    "data",
    "anthropics",
    "knowledge-work"
  ],
  "authored_by": "anthropics",
  "source_url": "https://github.com/anthropics/knowledge-work-plugins/blob/main/data/skills/create-viz/SKILL.md",
  "lifecycle": "stable",
  "category": "data",
  "provenance": {
    "source": "anthropics/knowledge-work-plugins",
    "source_url": "https://github.com/anthropics/knowledge-work-plugins/blob/main/data/skills/create-viz/SKILL.md",
    "author": "Anthropic",
    "license": "Apache-2.0",
    "notes": "Imported by scripts/import-anthropic-skills.py."
  }
}