refactor(viz-platform): extract skills and slim commands
Extract shared knowledge from 10 commands into 7 reusable skills: - mcp-tools-reference.md: All viz-platform MCP tool signatures - theming-system.md: Theme tokens, CSS variables, color palettes - accessibility-rules.md: WCAG contrast, color-blind safe palettes - dmc-components.md: DMC categories, validation, common props - responsive-design.md: Breakpoints, mobile-first, grid config - chart-types.md: Plotly chart types, export formats, resolution - layout-templates.md: Dashboard templates, filter types All commands now reference skills via "Skills to Load" section. Commands reduced from 1396 lines total to 427 lines (69% reduction). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,18 +4,18 @@ description: Create a Plotly chart with theme integration
|
||||
|
||||
# Create Chart
|
||||
|
||||
## Skills to Load
|
||||
- skills/mcp-tools-reference.md
|
||||
- skills/chart-types.md
|
||||
|
||||
## Visual Output
|
||||
|
||||
When executing this command, display the plugin header:
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────────┐
|
||||
│ 🎨 VIZ-PLATFORM · Chart Builder │
|
||||
└──────────────────────────────────────────────────────────────────┘
|
||||
+------------------------------------------------------------------+
|
||||
| VIZ-PLATFORM - Chart Builder |
|
||||
+------------------------------------------------------------------+
|
||||
```
|
||||
|
||||
Then proceed with the chart creation.
|
||||
|
||||
Create a Plotly chart with automatic theme token application.
|
||||
|
||||
## Usage
|
||||
@@ -26,73 +26,16 @@ Create a Plotly chart with automatic theme token application.
|
||||
|
||||
## Arguments
|
||||
|
||||
- `type` (required): Chart type - one of: line, bar, scatter, pie, area, histogram, box, heatmap, sunburst, treemap
|
||||
|
||||
## Examples
|
||||
|
||||
```
|
||||
/chart line
|
||||
/chart bar
|
||||
/chart scatter
|
||||
/chart pie
|
||||
```
|
||||
- `type` (required): line, bar, scatter, pie, area, histogram, box, heatmap, sunburst, treemap
|
||||
|
||||
## Tool Mapping
|
||||
|
||||
This command uses the `chart_create` MCP tool:
|
||||
|
||||
```python
|
||||
chart_create(
|
||||
chart_type="line",
|
||||
data_ref="df_sales", # Reference to loaded DataFrame
|
||||
x="date", # X-axis column
|
||||
y="revenue", # Y-axis column
|
||||
color=None, # Optional: column for color grouping
|
||||
title="Sales Over Time", # Optional: chart title
|
||||
theme=None # Optional: theme name to apply
|
||||
)
|
||||
chart_create(chart_type="line", data_ref="df", x="date", y="value", theme=None)
|
||||
```
|
||||
|
||||
## Workflow
|
||||
## Related Commands
|
||||
|
||||
1. **User invokes**: `/chart line`
|
||||
2. **Agent asks**: Which DataFrame to use? (list available with `list_data` from data-platform)
|
||||
3. **Agent asks**: Which columns for X and Y axes?
|
||||
4. **Agent asks**: Any grouping/color column?
|
||||
5. **Agent creates**: Chart with `chart_create` tool
|
||||
6. **Agent returns**: Plotly figure JSON ready for rendering
|
||||
|
||||
## Chart Types
|
||||
|
||||
| Type | Best For |
|
||||
|------|----------|
|
||||
| `line` | Time series, trends |
|
||||
| `bar` | Comparisons, categories |
|
||||
| `scatter` | Correlations, distributions |
|
||||
| `pie` | Part-to-whole relationships |
|
||||
| `area` | Cumulative trends |
|
||||
| `histogram` | Frequency distributions |
|
||||
| `box` | Statistical distributions |
|
||||
| `heatmap` | Matrix correlations |
|
||||
| `sunburst` | Hierarchical data |
|
||||
| `treemap` | Hierarchical proportions |
|
||||
|
||||
## Theme Integration
|
||||
|
||||
Charts automatically inherit colors from the active theme:
|
||||
- Primary color for main data
|
||||
- Color palette for multi-series
|
||||
- Font family and sizes
|
||||
- Background colors
|
||||
|
||||
Override with explicit theme:
|
||||
```python
|
||||
chart_create(chart_type="bar", ..., theme="my-dark-theme")
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
Returns Plotly figure JSON that can be:
|
||||
- Rendered in a Dash app
|
||||
- Saved as HTML/PNG
|
||||
- Embedded in a layout component
|
||||
- `/chart-export {format}` - Export chart to image
|
||||
- `/theme {name}` - Apply theme to charts
|
||||
- `/dashboard` - Create layout with charts
|
||||
|
||||
Reference in New Issue
Block a user