[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7189ZG78E46E4Z2DJ7A8DE2":3,"skill-same:01M7189ZG78E46E4Z2DJ7A8DE2":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M7189ZG78E46E4Z2DJ7A8DE2","build-dashboard",null,"Build an interactive HTML dashboard with charts, filters, and tables. Use when creating an executive overview with KPI cards, turning query results into a shareable self-contained report, building a team monitoring snapshot, or needing multiple charts with filters in one browser-openable file.","anthropics\u002Fknowledge-work-plugins","anthropics","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76263028?v=4","01M697XGDPXJAVQ8391V2BCYTE","Anthropic","01M7188MPC48111TN566QNQE3X",35824,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fbuild-dashboard\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"build dashboard","build","dashboard","file","use","overview","kpi","tables","html","source","data","snapshot","self","browser","monitoring","team","query","when","filters","Charts","2026-11-10 10:12:30",false,"---\nname: build-dashboard\ndescription: Build an interactive HTML dashboard with charts, filters, and tables. Use when creating an executive overview with KPI cards, turning query results into a shareable self-contained report, building a team monitoring snapshot, or needing multiple charts with filters in one browser-openable file.\nargument-hint: \"\u003Cdescription> [data source]\"\n---\n\n# \u002Fbuild-dashboard - Build Interactive Dashboards\n\n> If you see unfamiliar placeholders or need to check which tools are connected, see [CONNECTORS.md](..\u002F..\u002FCONNECTORS.md).\n\nBuild a self-contained interactive HTML dashboard with charts, filters, tables, and professional styling. Opens directly in a browser -- no server or dependencies required.\n\n## Usage\n\n```\n\u002Fbuild-dashboard \u003Cdescription of dashboard> [data source]\n```\n\n## Workflow\n\n### 1. Understand the Dashboard Requirements\n\nDetermine:\n\n- **Purpose**: Executive overview, operational monitoring, deep-dive analysis, team reporting\n- **Audience**: Who will use this dashboard?\n- **Key metrics**: What numbers matter most?\n- **Dimensions**: What should users be able to filter or slice by?\n- **Data source**: Live query, pasted data, CSV file, or sample data\n\n### 2. Gather the Data\n\n**If data warehouse is connected:**\n1. Query the necessary data\n2. Embed the results as JSON within the HTML file\n\n**If data is pasted or uploaded:**\n1. Parse and clean the data\n2. Embed as JSON in the dashboard\n\n**If working from a description without data:**\n1. Create a realistic sample dataset matching the described schema\n2. Note in the dashboard that it uses sample data\n3. Provide instructions for swapping in real data\n\n### 3. Design the Dashboard Layout\n\nFollow a standard dashboard layout pattern:\n\n```\n┌──────────────────────────────────────────────────┐\n│  Dashboard Title                    [Filters ▼]  │\n├────────────┬────────────┬────────────┬───────────┤\n│  KPI Card  │  KPI Card  │  KPI Card  │ KPI Card  │\n├────────────┴────────────┼────────────┴───────────┤\n│                         │                        │\n│    Primary Chart        │   Secondary Chart      │\n│    (largest area)       │                        │\n│                         │                        │\n├─────────────────────────┴────────────────────────┤\n│                                                  │\n│    Detail Table (sortable, scrollable)           │\n│                                                  │\n└──────────────────────────────────────────────────┘\n```\n\n**Adapt the layout to the content:**\n- 2-4 KPI cards at the top for headline numbers\n- 1-3 charts in the middle section for trends and breakdowns\n- Optional detail table at the bottom for drill-down data\n- Filters in the header or sidebar depending on complexity\n\n### 4. Build the HTML Dashboard\n\nGenerate a single self-contained HTML file using the base template below. The file includes:\n\n**Structure (HTML):**\n- Semantic HTML5 layout\n- Responsive grid using CSS Grid or Flexbox\n- Filter controls (dropdowns, date pickers, toggles)\n- KPI cards with values and labels\n- Chart containers\n- Data table with sortable headers\n\n**Styling (CSS):**\n- Professional color scheme (clean whites, grays, with accent colors for data)\n- Card-based layout with subtle shadows\n- Consistent typography (system fonts for fast loading)\n- Responsive design that works on different screen sizes\n- Print-friendly styles\n\n**Interactivity (JavaScript):**\n- Chart.js for interactive charts (included via CDN)\n- Filter dropdowns that update all charts and tables simultaneously\n- Sortable table columns\n- Hover tooltips on charts\n- Number formatting (commas, currency, percentages)\n\n**Data (embedded JSON):**\n- All data embedded directly in the HTML as JavaScript variables\n- No external data fetches required\n- Dashboard works completely offline\n\n### 5. Implement Chart Types\n\nUse Chart.js for all charts. Common dashboard chart patterns:\n\n- **Line chart**: Time series trends\n- **Bar chart**: Category comparisons\n- **Doughnut chart**: Composition (when \u003C6 categories)\n- **Stacked bar**: Composition over time\n- **Mixed (bar + line)**: Volume with rate overlay\n\nUse the Chart.js integration patterns below for each chart type.\n\n### 6. Add Interactivity\n\nUse the filter and interactivity implementation patterns below for dropdown filters, date range filters, combined filter logic, sortable tables, and chart updates.\n\n### 7. Save and Open\n\n1. Save the dashboard as an HTML file with a descriptive name (e.g., `sales_dashboard.html`)\n2. Open it in the user's default browser\n3. Confirm it renders correctly\n4. Provide instructions for updating data or customizing\n\n---\n\n## Base Template\n\nEvery dashboard follows this structure:\n\n```html\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n\u003Chead>\n    \u003Cmeta charset=\"UTF-8\">\n    \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    \u003Ctitle>Dashboard Title\u003C\u002Ftitle>\n    \u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fchart.js@4.5.1\" integrity=\"sha384-jb8JQMbMoBUzgWatfe6COACi2ljcDdZQ2OxczGA3bGNeWe+6DChMTBJemed7ZnvJ\" crossorigin=\"anonymous\">\u003C\u002Fscript>\n    \u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fchartjs-adapter-date-fns@3.0.0\" integrity=\"sha384-cVMg8E3QFwTvGCDuK+ET4PD341jF3W8nO1auiXfuZNQkzbUUiBGLsIQUE+b1mxws\" crossorigin=\"anonymous\">\u003C\u002Fscript>\n    \u003Cstyle>\n        \u002F* Dashboard styles go here *\u002F\n    \u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n    \u003Cdiv class=\"dashboard-container\">\n        \u003Cheader class=\"dashboard-header\">\n            \u003Ch1>Dashboard Title\u003C\u002Fh1>\n            \u003Cdiv class=\"filters\">\n                \u003C!-- Filter controls -->\n            \u003C\u002Fdiv>\n        \u003C\u002Fheader>\n\n        \u003Csection class=\"kpi-row\">\n            \u003C!-- KPI cards -->\n        \u003C\u002Fsection>\n\n        \u003Csection class=\"chart-row\">\n            \u003C!-- Chart containers -->\n        \u003C\u002Fsection>\n\n        \u003Csection class=\"table-section\">\n            \u003C!-- Data table -->\n        \u003C\u002Fsection>\n\n        \u003Cfooter class=\"dashboard-footer\">\n            \u003Cspan>Data as of: \u003Cspan id=\"data-date\">\u003C\u002Fspan>\u003C\u002Fspan>\n        \u003C\u002Ffooter>\n    \u003C\u002Fdiv>\n\n    \u003Cscript>\n        \u002F\u002F Embedded data\n        const DATA = [];\n\n        \u002F\u002F Dashboard logic\n        class Dashboard {\n            constructor(data) {\n                this.rawData = data;\n                this.filteredData = data;\n                this.charts = {};\n                this.init();\n            }\n\n            init() {\n                this.setupFilters();\n                this.renderKPIs();\n                this.renderCharts();\n                this.renderTable();\n            }\n\n            applyFilters() {\n                \u002F\u002F Filter logic\n                this.filteredData = this.rawData.filter(row => {\n                    \u002F\u002F Apply each active filter\n                    return true; \u002F\u002F placeholder\n                });\n                this.renderKPIs();\n                this.updateCharts();\n                this.renderTable();\n            }\n\n            \u002F\u002F ... methods for each section\n        }\n\n        const dashboard = new Dashboard(DATA);\n    \u003C\u002Fscript>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\n## KPI Card Pattern\n\n```html\n\u003Cdiv class=\"kpi-card\">\n    \u003Cdiv class=\"kpi-label\">Total Revenue\u003C\u002Fdiv>\n    \u003Cdiv class=\"kpi-value\" id=\"kpi-revenue\">$0\u003C\u002Fdiv>\n    \u003Cdiv class=\"kpi-change positive\" id=\"kpi-revenue-change\">+0%\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n```\n\n```javascript\nfunction renderKPI(elementId, value, previousValue, format = 'number') {\n    const el = document.getElementById(elementId);\n    const changeEl = document.getElementById(elementId + '-change');\n\n    \u002F\u002F Format the value\n    el.textContent = formatValue(value, format);\n\n    \u002F\u002F Calculate and display change\n    if (previousValue && previousValue !== 0) {\n        const pctChange = ((value - previousValue) \u002F previousValue) * 100;\n        const sign = pctChange >= 0 ? '+' : '';\n        changeEl.textContent = `${sign}${pctChange.toFixed(1)}% vs prior period`;\n        changeEl.className = `kpi-change ${pctChange >= 0 ? 'positive' : 'negative'}`;\n    }\n}\n\nfunction formatValue(value, format) {\n    switch (format) {\n        case 'currency':\n            if (value >= 1e6) return `$${(value \u002F 1e6).toFixed(1)}M`;\n            if (value >= 1e3) return `$${(value \u002F 1e3).toFixed(1)}K`;\n            return `$${value.toFixed(0)}`;\n        case 'percent':\n            return `${value.toFixed(1)}%`;\n        case 'number':\n            if (value >= 1e6) return `${(value \u002F 1e6).toFixed(1)}M`;\n            if (value >= 1e3) return `${(value \u002F 1e3).toFixed(1)}K`;\n            return value.toLocaleString();\n        default:\n            return value.toString();\n    }\n}\n```\n\n## Chart.js Integration\n\n### Chart Container Pattern\n\n```html\n\u003Cdiv class=\"chart-container\">\n    \u003Ch3 class=\"chart-title\">Monthly Revenue Trend\u003C\u002Fh3>\n    \u003Ccanvas id=\"revenue-chart\">\u003C\u002Fcanvas>\n\u003C\u002Fdiv>\n```\n\n### Line Chart\n\n```javascript\nfunction createLineChart(canvasId, labels, datasets) {\n    const ctx = document.getElementById(canvasId).getContext('2d');\n    return new Chart(ctx, {\n        type: 'line',\n        data: {\n            labels: labels,\n            datasets: datasets.map((ds, i) => ({\n                label: ds.label,\n                data: ds.data,\n                borderColor: COLORS[i % COLORS.length],\n                backgroundColor: COLORS[i % COLORS.length] + '20',\n                borderWidth: 2,\n                fill: ds.fill || false,\n                tension: 0.3,\n                pointRadius: 3,\n                pointHoverRadius: 6,\n            }))\n        },\n        options: {\n            responsive: true,\n            maintainAspectRatio: false,\n            interaction: {\n                mode: 'index',\n                intersect: false,\n            },\n            plugins: {\n                legend: {\n                    position: 'top',\n                    labels: { usePointStyle: true, padding: 20 }\n                },\n                tooltip: {\n                    callbacks: {\n                        label: function(context) {\n                            return `${context.dataset.label}: ${formatValue(context.parsed.y, 'currency')}`;\n                        }\n                    }\n                }\n            },\n            scales: {\n                x: {\n                    grid: { display: false }\n                },\n                y: {\n                    beginAtZero: true,\n                    ticks: {\n                        callback: function(value) {\n                            return formatValue(value, 'currency');\n                        }\n                    }\n                }\n            }\n        }\n    });\n}\n```\n\n### Bar Chart\n\n```javascript\nfunction createBarChart(canvasId, labels, data, options = {}) {\n    const ctx = document.getElementById(canvasId).getContext('2d');\n    const isHorizontal = options.horizontal || labels.length > 8;\n\n    return new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: labels,\n            datasets: [{\n                label: options.label || 'Value',\n                data: data,\n                backgroundColor: options.colors || COLORS.map(c => c + 'CC'),\n                borderColor: options.colors || COLORS,\n                borderWidth: 1,\n                borderRadius: 4,\n            }]\n        },\n        options: {\n            responsive: true,\n            maintainAspectRatio: false,\n            indexAxis: isHorizontal ? 'y' : 'x',\n            plugins: {\n                legend: { display: false },\n                tooltip: {\n                    callbacks: {\n                        label: function(context) {\n                            return formatValue(context.parsed[isHorizontal ? 'x' : 'y'], options.format || 'number');\n                        }\n                    }\n                }\n            },\n            scales: {\n                x: {\n                    beginAtZero: true,\n                    grid: { display: isHorizontal },\n                    ticks: isHorizontal ? {\n                        callback: function(value) {\n                            return formatValue(value, options.format || 'number');\n                        }\n                    } : {}\n                },\n                y: {\n                    beginAtZero: !isHorizontal,\n                    grid: { display: !isHorizontal },\n                    ticks: !isHorizontal ? {\n                        callback: function(value) {\n                            return formatValue(value, options.format || 'number');\n                        }\n                    } : {}\n                }\n            }\n        }\n    });\n}\n```\n\n### Doughnut Chart\n\n```javascript\nfunction createDoughnutChart(canvasId, labels, data) {\n    const ctx = document.getElementById(canvasId).getContext('2d');\n    return new Chart(ctx, {\n        type: 'doughnut',\n        data: {\n            labels: labels,\n            datasets: [{\n                data: data,\n                backgroundColor: COLORS.map(c => c + 'CC'),\n                borderColor: '#ffffff',\n                borderWidth: 2,\n            }]\n        },\n        options: {\n            responsive: true,\n            maintainAspectRatio: false,\n            cutout: '60%',\n            plugins: {\n                legend: {\n                    position: 'right',\n                    labels: { usePointStyle: true, padding: 15 }\n                },\n                tooltip: {\n                    callbacks: {\n                        label: function(context) {\n                            const total = context.dataset.data.reduce((a, b) => a + b, 0);\n                            const pct = ((context.parsed \u002F total) * 100).toFixed(1);\n                            return `${context.label}: ${formatValue(context.parsed, 'number')} (${pct}%)`;\n                        }\n                    }\n                }\n            }\n        }\n    });\n}\n```\n\n### Updating Charts on Filter Change\n\n```javascript\nfunction updateChart(chart, newLabels, newData) {\n    chart.data.labels = newLabels;\n\n    if (Array.isArray(newData[0])) {\n        \u002F\u002F Multiple datasets\n        newData.forEach((data, i) => {\n            chart.data.datasets[i].data = data;\n        });\n    } else {\n        chart.data.datasets[0].data = newData;\n    }\n\n    chart.update('none'); \u002F\u002F 'none' disables animation for instant update\n}\n```\n\n## Filter and Interactivity Implementation\n\n### Dropdown Filter\n\n```html\n\u003Cdiv class=\"filter-group\">\n    \u003Clabel for=\"filter-region\">Region\u003C\u002Flabel>\n    \u003Cselect id=\"filter-region\" onchange=\"dashboard.applyFilters()\">\n        \u003Coption value=\"all\">All Regions\u003C\u002Foption>\n    \u003C\u002Fselect>\n\u003C\u002Fdiv>\n```\n\n```javascript\nfunction populateFilter(selectId, data, field) {\n    const select = document.getElementById(selectId);\n    const values = [...new Set(data.map(d => d[field]))].sort();\n\n    \u002F\u002F Keep the \"All\" option, add unique values\n    values.forEach(val => {\n        const option = document.createElement('option');\n        option.value = val;\n        option.textContent = val;\n        select.appendChild(option);\n    });\n}\n\nfunction getFilterValue(selectId) {\n    const val = document.getElementById(selectId).value;\n    return val === 'all' ? null : val;\n}\n```\n\n### Date Range Filter\n\n```html\n\u003Cdiv class=\"filter-group\">\n    \u003Clabel>Date Range\u003C\u002Flabel>\n    \u003Cinput type=\"date\" id=\"filter-date-start\" onchange=\"dashboard.applyFilters()\">\n    \u003Cspan>to\u003C\u002Fspan>\n    \u003Cinput type=\"date\" id=\"filter-date-end\" onchange=\"dashboard.applyFilters()\">\n\u003C\u002Fdiv>\n```\n\n```javascript\nfunction filterByDateRange(data, dateField, startDate, endDate) {\n    return data.filter(row => {\n        const rowDate = new Date(row[dateField]);\n        if (startDate && rowDate \u003C new Date(startDate)) return false;\n        if (endDate && rowDate > new Date(endDate)) return false;\n        return true;\n    });\n}\n```\n\n### Combined Filter Logic\n\n```javascript\napplyFilters() {\n    const region = getFilterValue('filter-region');\n    const category = getFilterValue('filter-category');\n    const startDate = document.getElementById('filter-date-start').value;\n    const endDate = document.getElementById('filter-date-end').value;\n\n    this.filteredData = this.rawData.filter(row => {\n        if (region && row.region !== region) return false;\n        if (category && row.category !== category) return false;\n        if (startDate && row.date \u003C startDate) return false;\n        if (endDate && row.date > endDate) return false;\n        return true;\n    });\n\n    this.renderKPIs();\n    this.updateCharts();\n    this.renderTable();\n}\n```\n\n### Sortable Table\n\n```javascript\nfunction renderTable(containerId, data, columns) {\n    const container = document.getElementById(containerId);\n    let sortCol = null;\n    let sortDir = 'desc';\n\n    function render(sortedData) {\n        let html = '\u003Ctable class=\"data-table\">';\n\n        \u002F\u002F Header\n        html += '\u003Cthead>\u003Ctr>';\n        columns.forEach(col => {\n            const arrow = sortCol === col.field\n                ? (sortDir === 'asc' ? ' ▲' : ' ▼')\n                : '';\n            html += `\u003Cth onclick=\"sortTable('${col.field}')\" style=\"cursor:pointer\">${col.label}${arrow}\u003C\u002Fth>`;\n        });\n        html += '\u003C\u002Ftr>\u003C\u002Fthead>';\n\n        \u002F\u002F Body\n        html += '\u003Ctbody>';\n        sortedData.forEach(row => {\n            html += '\u003Ctr>';\n            columns.forEach(col => {\n                const value = col.format ? formatValue(row[col.field], col.format) : row[col.field];\n                html += `\u003Ctd>${value}\u003C\u002Ftd>`;\n            });\n            html += '\u003C\u002Ftr>';\n        });\n        html += '\u003C\u002Ftbody>\u003C\u002Ftable>';\n\n        container.innerHTML = html;\n    }\n\n    window.sortTable = function(field) {\n        if (sortCol === field) {\n            sortDir = sortDir === 'asc' ? 'desc' : 'asc';\n        } else {\n            sortCol = field;\n            sortDir = 'desc';\n        }\n        const sorted = [...data].sort((a, b) => {\n            const aVal = a[field], bVal = b[field];\n            const cmp = aVal \u003C bVal ? -1 : aVal > bVal ? 1 : 0;\n            return sortDir === 'asc' ? cmp : -cmp;\n        });\n        render(sorted);\n    };\n\n    render(data);\n}\n```\n\n## CSS Styling for Dashboards\n\n### Color System\n\n```css\n:root {\n    \u002F* Background layers *\u002F\n    --bg-primary: #f8f9fa;\n    --bg-card: #ffffff;\n    --bg-header: #1a1a2e;\n\n    \u002F* Text *\u002F\n    --text-primary: #212529;\n    --text-secondary: #6c757d;\n    --text-on-dark: #ffffff;\n\n    \u002F* Accent colors for data *\u002F\n    --color-1: #4C72B0;\n    --color-2: #DD8452;\n    --color-3: #55A868;\n    --color-4: #C44E52;\n    --color-5: #8172B3;\n    --color-6: #937860;\n\n    \u002F* Status colors *\u002F\n    --positive: #28a745;\n    --negative: #dc3545;\n    --neutral: #6c757d;\n\n    \u002F* Spacing *\u002F\n    --gap: 16px;\n    --radius: 8px;\n}\n```\n\n### Layout\n\n```css\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n}\n\nbody {\n    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n    background: var(--bg-primary);\n    color: var(--text-primary);\n    line-height: 1.5;\n}\n\n.dashboard-container {\n    max-width: 1400px;\n    margin: 0 auto;\n    padding: var(--gap);\n}\n\n.dashboard-header {\n    background: var(--bg-header);\n    color: var(--text-on-dark);\n    padding: 20px 24px;\n    border-radius: var(--radius);\n    margin-bottom: var(--gap);\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    flex-wrap: wrap;\n    gap: 12px;\n}\n\n.dashboard-header h1 {\n    font-size: 20px;\n    font-weight: 600;\n}\n```\n\n### KPI Cards\n\n```css\n.kpi-row {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n    gap: var(--gap);\n    margin-bottom: var(--gap);\n}\n\n.kpi-card {\n    background: var(--bg-card);\n    border-radius: var(--radius);\n    padding: 20px 24px;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n}\n\n.kpi-label {\n    font-size: 13px;\n    color: var(--text-secondary);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    margin-bottom: 4px;\n}\n\n.kpi-value {\n    font-size: 28px;\n    font-weight: 700;\n    color: var(--text-primary);\n    margin-bottom: 4px;\n}\n\n.kpi-change {\n    font-size: 13px;\n    font-weight: 500;\n}\n\n.kpi-change.positive { color: var(--positive); }\n.kpi-change.negative { color: var(--negative); }\n```\n\n### Chart Containers\n\n```css\n.chart-row {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));\n    gap: var(--gap);\n    margin-bottom: var(--gap);\n}\n\n.chart-container {\n    background: var(--bg-card);\n    border-radius: var(--radius);\n    padding: 20px 24px;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n}\n\n.chart-container h3 {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--text-primary);\n    margin-bottom: 16px;\n}\n\n.chart-container canvas {\n    max-height: 300px;\n}\n```\n\n### Filters\n\n```css\n.filters {\n    display: flex;\n    gap: 12px;\n    align-items: center;\n    flex-wrap: wrap;\n}\n\n.filter-group {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n}\n\n.filter-group label {\n    font-size: 12px;\n    color: rgba(255, 255, 255, 0.7);\n}\n\n.filter-group select,\n.filter-group input[type=\"date\"] {\n    padding: 6px 10px;\n    border: 1px solid rgba(255, 255, 255, 0.2);\n    border-radius: 4px;\n    background: rgba(255, 255, 255, 0.1);\n    color: var(--text-on-dark);\n    font-size: 13px;\n}\n\n.filter-group select option {\n    background: var(--bg-header);\n    color: var(--text-on-dark);\n}\n```\n\n### Data Table\n\n```css\n.table-section {\n    background: var(--bg-card);\n    border-radius: var(--radius);\n    padding: 20px 24px;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n    overflow-x: auto;\n}\n\n.data-table {\n    width: 100%;\n    border-collapse: collapse;\n    font-size: 13px;\n}\n\n.data-table thead th {\n    text-align: left;\n    padding: 10px 12px;\n    border-bottom: 2px solid #dee2e6;\n    color: var(--text-secondary);\n    font-weight: 600;\n    font-size: 12px;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    white-space: nowrap;\n    user-select: none;\n}\n\n.data-table thead th:hover {\n    color: var(--text-primary);\n    background: #f8f9fa;\n}\n\n.data-table tbody td {\n    padding: 10px 12px;\n    border-bottom: 1px solid #f0f0f0;\n}\n\n.data-table tbody tr:hover {\n    background: #f8f9fa;\n}\n\n.data-table tbody tr:last-child td {\n    border-bottom: none;\n}\n```\n\n### Responsive Design\n\n```css\n@media (max-width: 768px) {\n    .dashboard-header {\n        flex-direction: column;\n        align-items: flex-start;\n    }\n\n    .kpi-row {\n        grid-template-columns: repeat(2, 1fr);\n    }\n\n    .chart-row {\n        grid-template-columns: 1fr;\n    }\n\n    .filters {\n        flex-direction: column;\n        align-items: flex-start;\n    }\n}\n\n@media print {\n    body { background: white; }\n    .dashboard-container { max-width: none; }\n    .filters { display: none; }\n    .chart-container { break-inside: avoid; }\n    .kpi-card { border: 1px solid #dee2e6; box-shadow: none; }\n}\n```\n\n## Performance Considerations for Large Datasets\n\n### Data Size Guidelines\n\n| Data Size | Approach |\n|---|---|\n| \u003C1,000 rows | Embed directly in HTML. Full interactivity. |\n| 1,000 - 10,000 rows | Embed in HTML. May need to pre-aggregate for charts. |\n| 10,000 - 100,000 rows | Pre-aggregate server-side. Embed only aggregated data. |\n| >100,000 rows | Not suitable for client-side dashboard. Use a BI tool or paginate. |\n\n### Pre-Aggregation Pattern\n\nInstead of embedding raw data and aggregating in the browser:\n\n```javascript\n\u002F\u002F DON'T: embed 50,000 raw rows\nconst RAW_DATA = [\u002F* 50,000 rows *\u002F];\n\n\u002F\u002F DO: pre-aggregate before embedding\nconst CHART_DATA = {\n    monthly_revenue: [\n        { month: '2024-01', revenue: 150000, orders: 1200 },\n        { month: '2024-02', revenue: 165000, orders: 1350 },\n        \u002F\u002F ... 12 rows instead of 50,000\n    ],\n    top_products: [\n        { product: 'Widget A', revenue: 45000 },\n        \u002F\u002F ... 10 rows\n    ],\n    kpis: {\n        total_revenue: 1980000,\n        total_orders: 15600,\n        avg_order_value: 127,\n    }\n};\n```\n\n### Chart Performance\n\n- Limit line charts to \u003C500 data points per series (downsample if needed)\n- Limit bar charts to \u003C50 categories\n- For scatter plots, cap at 1,000 points (use sampling for larger datasets)\n- Disable animations for dashboards with many charts: `animation: false` in Chart.js options\n- Use `Chart.update('none')` instead of `Chart.update()` for filter-triggered updates\n\n### DOM Performance\n\n- Limit data tables to 100-200 visible rows. Add pagination for more.\n- Use `requestAnimationFrame` for coordinated chart updates\n- Avoid rebuilding the entire DOM on filter change -- update only changed elements\n\n```javascript\n\u002F\u002F Efficient table pagination\nfunction renderTablePage(data, page, pageSize = 50) {\n    const start = page * pageSize;\n    const end = Math.min(start + pageSize, data.length);\n    const pageData = data.slice(start, end);\n    \u002F\u002F Render only pageData\n    \u002F\u002F Show pagination controls: \"Showing 1-50 of 2,340\"\n}\n```\n\n## Examples\n\n```\n\u002Fbuild-dashboard Monthly sales dashboard with revenue trend, top products, and regional breakdown. Data is in the orders table.\n```\n\n```\n\u002Fbuild-dashboard Here's our support ticket data [pastes CSV]. Build a dashboard showing volume by priority, response time trends, and resolution rates.\n```\n\n```\n\u002Fbuild-dashboard Create a template executive dashboard for a SaaS company showing MRR, churn, new customers, and NPS. Use sample data.\n```\n\n## Tips\n\n- Dashboards are fully self-contained HTML files -- share them with anyone by sending the file\n- For real-time dashboards, consider connecting to a BI tool instead. These dashboards are point-in-time snapshots\n- Request \"dark mode\" or \"presentation mode\" for different styling\n- You can request a specific color scheme to match your brand\n","# \u002Fbuild-dashboard - Build Interactive Dashboards\n\n> If you see unfamiliar placeholders or need to check which tools are connected, see [CONNECTORS.md](..\u002F..\u002FCONNECTORS.md).\n\nBuild a self-contained interactive HTML dashboard with charts, filters, tables, and professional styling. Opens directly in a browser -- no server or dependencies required.\n\n## Usage\n\n```\n\u002Fbuild-dashboard \u003Cdescription of dashboard> [data source]\n```\n\n## Workflow\n\n### 1. Understand the Dashboard Requirements\n\nDetermine:\n\n- **Purpose**: Executive overview, operational monitoring, deep-dive analysis, team reporting\n- **Audience**: Who will use this dashboard?\n- **Key metrics**: What numbers matter most?\n- **Dimensions**: What should users be able to filter or slice by?\n- **Data source**: Live query, pasted data, CSV file, or sample data\n\n### 2. Gather the Data\n\n**If data warehouse is connected:**\n1. Query the necessary data\n2. Embed the results as JSON within the HTML file\n\n**If data is pasted or uploaded:**\n1. Parse and clean the data\n2. Embed as JSON in the dashboard\n\n**If working from a description without data:**\n1. Create a realistic sample dataset matching the described schema\n2. Note in the dashboard that it uses sample data\n3. Provide instructions for swapping in real data\n\n### 3. Design the Dashboard Layout\n\nFollow a standard dashboard layout pattern:\n\n```\n┌──────────────────────────────────────────────────┐\n│  Dashboard Title                    [Filters ▼]  │\n├────────────┬────────────┬────────────┬───────────┤\n│  KPI Card  │  KPI Card  │  KPI Card  │ KPI Card  │\n├────────────┴────────────┼────────────┴───────────┤\n│                         │                        │\n│    Primary Chart        │   Secondary Chart      │\n│    (largest area)       │                        │\n│                         │                        │\n├─────────────────────────┴────────────────────────┤\n│                                                  │\n│    Detail Table (sortable, scrollable)           │\n│                                                  │\n└──────────────────────────────────────────────────┘\n```\n\n**Adapt the layout to the content:**\n- 2-4 KPI cards at the top for headline numbers\n- 1-3 charts in the middle section for trends and breakdowns\n- Optional detail table at the bottom for drill-down data\n- Filters in the header or sidebar depending on complexity\n\n### 4. Build the HTML Dashboard\n\nGenerate a single self-contained HTML file using the base template below. The file includes:\n\n**Structure (HTML):**\n- Semantic HTML5 layout\n- Responsive grid using CSS Grid or Flexbox\n- Filter controls (dropdowns, date pickers, toggles)\n- KPI cards with values and labels\n- Chart containers\n- Data table with sortable headers\n\n**Styling (CSS):**\n- Professional color scheme (clean whites, grays, with accent colors for data)\n- Card-based layout with subtle shadows\n- Consistent typography (system fonts for fast loading)\n- Responsive design that works on different screen sizes\n- Print-friendly styles\n\n**Interactivity (JavaScript):**\n- Chart.js for interactive charts (included via CDN)\n- Filter dropdowns that update all charts and tables simultaneously\n- Sortable table columns\n- Hover tooltips on charts\n- Number formatting (commas, currency, percentages)\n\n**Data (embedded JSON):**\n- All data embedded directly in the HTML as JavaScript variables\n- No external data fetches required\n- Dashboard works completely offline\n\n### 5. Implement Chart Types\n\nUse Chart.js for all charts. Common dashboard chart patterns:\n\n- **Line chart**: Time series trends\n- **Bar chart**: Category comparisons\n- **Doughnut chart**: Composition (when \u003C6 categories)\n- **Stacked bar**: Composition over time\n- **Mixed (bar + line)**: Volume with rate overlay\n\nUse the Chart.js integration patterns below for each chart type.\n\n### 6. Add Interactivity\n\nUse the filter and interactivity implementation patterns below for dropdown filters, date range filters, combined filter logic, sortable tables, and chart updates.\n\n### 7. Save and Open\n\n1. Save the dashboard as an HTML file with a descriptive name (e.g., `sales_dashboard.html`)\n2. Open it in the user's default browser\n3. Confirm it renders correctly\n4. Provide instructions for updating data or customizing\n\n---\n\n## Base Template\n\nEvery dashboard follows this structure:\n\n```html\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n\u003Chead>\n    \u003Cmeta charset=\"UTF-8\">\n    \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    \u003Ctitle>Dashboard Title\u003C\u002Ftitle>\n    \u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fchart.js@4.5.1\" integrity=\"sha384-jb8JQMbMoBUzgWatfe6COACi2ljcDdZQ2OxczGA3bGNeWe+6DChMTBJemed7ZnvJ\" crossorigin=\"anonymous\">\u003C\u002Fscript>\n    \u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fchartjs-adapter-date-fns@3.0.0\" integrity=\"sha384-cVMg8E3QFwTvGCDuK+ET4PD341jF3W8nO1auiXfuZNQkzbUUiBGLsIQUE+b1mxws\" crossorigin=\"anonymous\">\u003C\u002Fscript>\n    \u003Cstyle>\n        \u002F* Dashboard styles go here *\u002F\n    \u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n    \u003Cdiv class=\"dashboard-container\">\n        \u003Cheader class=\"dashboard-header\">\n            \u003Ch1>Dashboard Title\u003C\u002Fh1>\n            \u003Cdiv class=\"filters\">\n                \u003C!-- Filter controls -->\n            \u003C\u002Fdiv>\n        \u003C\u002Fheader>\n\n        \u003Csection class=\"kpi-row\">\n            \u003C!-- KPI cards -->\n        \u003C\u002Fsection>\n\n        \u003Csection class=\"chart-row\">\n            \u003C!-- Chart containers -->\n        \u003C\u002Fsection>\n\n        \u003Csection class=\"table-section\">\n            \u003C!-- Data table -->\n        \u003C\u002Fsection>\n\n        \u003Cfooter class=\"dashboard-footer\">\n            \u003Cspan>Data as of: \u003Cspan id=\"data-date\">\u003C\u002Fspan>\u003C\u002Fspan>\n        \u003C\u002Ffooter>\n    \u003C\u002Fdiv>\n\n    \u003Cscript>\n        \u002F\u002F Embedded data\n        const DATA = [];\n\n        \u002F\u002F Dashboard logic\n        class Dashboard {\n            constructor(data) {\n                this.rawData = data;\n                this.filteredData = data;\n                this.charts = {};\n                this.init();\n            }\n\n            init() {\n                this.setupFilters();\n                this.renderKPIs();\n                this.renderCharts();\n                this.renderTable();\n            }\n\n            applyFilters() {\n                \u002F\u002F Filter logic\n                this.filteredData = this.rawData.filter(row => {\n                    \u002F\u002F Apply each active filter\n                    return true; \u002F\u002F placeholder\n                });\n                this.renderKPIs();\n                this.updateCharts();\n                this.renderTable();\n            }\n\n            \u002F\u002F ... methods for each section\n        }\n\n        const dashboard = new Dashboard(DATA);\n    \u003C\u002Fscript>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\n## KPI Card Pattern\n\n```html\n\u003Cdiv class=\"kpi-card\">\n    \u003Cdiv class=\"kpi-label\">Total Revenue\u003C\u002Fdiv>\n    \u003Cdiv class=\"kpi-value\" id=\"kpi-revenue\">$0\u003C\u002Fdiv>\n    \u003Cdiv class=\"kpi-change positive\" id=\"kpi-revenue-change\">+0%\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n```\n\n```javascript\nfunction renderKPI(elementId, value, previousValue, format = 'number') {\n    const el = document.getElementById(elementId);\n    const changeEl = document.getElementById(elementId + '-change');\n\n    \u002F\u002F Format the value\n    el.textContent = formatValue(value, format);\n\n    \u002F\u002F Calculate and display change\n    if (previousValue && previousValue !== 0) {\n        const pctChange = ((value - previousValue) \u002F previousValue) * 100;\n        const sign = pctChange >= 0 ? '+' : '';\n        changeEl.textContent = `${sign}${pctChange.toFixed(1)}% vs prior period`;\n        changeEl.className = `kpi-change ${pctChange >= 0 ? 'positive' : 'negative'}`;\n    }\n}\n\nfunction formatValue(value, format) {\n    switch (format) {\n        case 'currency':\n            if (value >= 1e6) return `$${(value \u002F 1e6).toFixed(1)}M`;\n            if (value >= 1e3) return `$${(value \u002F 1e3).toFixed(1)}K`;\n            return `$${value.toFixed(0)}`;\n        case 'percent':\n            return `${value.toFixed(1)}%`;\n        case 'number':\n            if (value >= 1e6) return `${(value \u002F 1e6).toFixed(1)}M`;\n            if (value >= 1e3) return `${(value \u002F 1e3).toFixed(1)}K`;\n            return value.toLocaleString();\n        default:\n            return value.toString();\n    }\n}\n```\n\n## Chart.js Integration\n\n### Chart Container Pattern\n\n```html\n\u003Cdiv class=\"chart-container\">\n    \u003Ch3 class=\"chart-title\">Monthly Revenue Trend\u003C\u002Fh3>\n    \u003Ccanvas id=\"revenue-chart\">\u003C\u002Fcanvas>\n\u003C\u002Fdiv>\n```\n\n### Line Chart\n\n```javascript\nfunction createLineChart(canvasId, labels, datasets) {\n    const ctx = document.getElementById(canvasId).getContext('2d');\n    return new Chart(ctx, {\n        type: 'line',\n        data: {\n            labels: labels,\n            datasets: datasets.map((ds, i) => ({\n                label: ds.label,\n                data: ds.data,\n                borderColor: COLORS[i % COLORS.length],\n                backgroundColor: COLORS[i % COLORS.length] + '20',\n                borderWidth: 2,\n                fill: ds.fill || false,\n                tension: 0.3,\n                pointRadius: 3,\n                pointHoverRadius: 6,\n            }))\n        },\n        options: {\n            responsive: true,\n            maintainAspectRatio: false,\n            interaction: {\n                mode: 'index',\n                intersect: false,\n            },\n            plugins: {\n                legend: {\n                    position: 'top',\n                    labels: { usePointStyle: true, padding: 20 }\n                },\n                tooltip: {\n                    callbacks: {\n                        label: function(context) {\n                            return `${context.dataset.label}: ${formatValue(context.parsed.y, 'currency')}`;\n                        }\n                    }\n                }\n            },\n            scales: {\n                x: {\n                    grid: { display: false }\n                },\n                y: {\n                    beginAtZero: true,\n                    ticks: {\n                        callback: function(value) {\n                            return formatValue(value, 'currency');\n                        }\n                    }\n                }\n            }\n        }\n    });\n}\n```\n\n### Bar Chart\n\n```javascript\nfunction createBarChart(canvasId, labels, data, options = {}) {\n    const ctx = document.getElementById(canvasId).getContext('2d');\n    const isHorizontal = options.horizontal || labels.length > 8;\n\n    return new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: labels,\n            datasets: [{\n                label: options.label || 'Value',\n                data: data,\n                backgroundColor: options.colors || COLORS.map(c => c + 'CC'),\n                borderColor: options.colors || COLORS,\n                borderWidth: 1,\n                borderRadius: 4,\n            }]\n        },\n        options: {\n            responsive: true,\n            maintainAspectRatio: false,\n            indexAxis: isHorizontal ? 'y' : 'x',\n            plugins: {\n                legend: { display: false },\n                tooltip: {\n                    callbacks: {\n                        label: function(context) {\n                            return formatValue(context.parsed[isHorizontal ? 'x' : 'y'], options.format || 'number');\n                        }\n                    }\n                }\n            },\n            scales: {\n                x: {\n                    beginAtZero: true,\n                    grid: { display: isHorizontal },\n                    ticks: isHorizontal ? {\n                        callback: function(value) {\n                            return formatValue(value, options.format || 'number');\n                        }\n                    } : {}\n                },\n                y: {\n                    beginAtZero: !isHorizontal,\n                    grid: { display: !isHorizontal },\n                    ticks: !isHorizontal ? {\n                        callback: function(value) {\n                            return formatValue(value, options.format || 'number');\n                        }\n                    } : {}\n                }\n            }\n        }\n    });\n}\n```\n\n### Doughnut Chart\n\n```javascript\nfunction createDoughnutChart(canvasId, labels, data) {\n    const ctx = document.getElementById(canvasId).getContext('2d');\n    return new Chart(ctx, {\n        type: 'doughnut',\n        data: {\n            labels: labels,\n            datasets: [{\n                data: data,\n                backgroundColor: COLORS.map(c => c + 'CC'),\n                borderColor: '#ffffff',\n                borderWidth: 2,\n            }]\n        },\n        options: {\n            responsive: true,\n            maintainAspectRatio: false,\n            cutout: '60%',\n            plugins: {\n                legend: {\n                    position: 'right',\n                    labels: { usePointStyle: true, padding: 15 }\n                },\n                tooltip: {\n                    callbacks: {\n                        label: function(context) {\n                            const total = context.dataset.data.reduce((a, b) => a + b, 0);\n                            const pct = ((context.parsed \u002F total) * 100).toFixed(1);\n                            return `${context.label}: ${formatValue(context.parsed, 'number')} (${pct}%)`;\n                        }\n                    }\n                }\n            }\n        }\n    });\n}\n```\n\n### Updating Charts on Filter Change\n\n```javascript\nfunction updateChart(chart, newLabels, newData) {\n    chart.data.labels = newLabels;\n\n    if (Array.isArray(newData[0])) {\n        \u002F\u002F Multiple datasets\n        newData.forEach((data, i) => {\n            chart.data.datasets[i].data = data;\n        });\n    } else {\n        chart.data.datasets[0].data = newData;\n    }\n\n    chart.update('none'); \u002F\u002F 'none' disables animation for instant update\n}\n```\n\n## Filter and Interactivity Implementation\n\n### Dropdown Filter\n\n```html\n\u003Cdiv class=\"filter-group\">\n    \u003Clabel for=\"filter-region\">Region\u003C\u002Flabel>\n    \u003Cselect id=\"filter-region\" onchange=\"dashboard.applyFilters()\">\n        \u003Coption value=\"all\">All Regions\u003C\u002Foption>\n    \u003C\u002Fselect>\n\u003C\u002Fdiv>\n```\n\n```javascript\nfunction populateFilter(selectId, data, field) {\n    const select = document.getElementById(selectId);\n    const values = [...new Set(data.map(d => d[field]))].sort();\n\n    \u002F\u002F Keep the \"All\" option, add unique values\n    values.forEach(val => {\n        const option = document.createElement('option');\n        option.value = val;\n        option.textContent = val;\n        select.appendChild(option);\n    });\n}\n\nfunction getFilterValue(selectId) {\n    const val = document.getElementById(selectId).value;\n    return val === 'all' ? null : val;\n}\n```\n\n### Date Range Filter\n\n```html\n\u003Cdiv class=\"filter-group\">\n    \u003Clabel>Date Range\u003C\u002Flabel>\n    \u003Cinput type=\"date\" id=\"filter-date-start\" onchange=\"dashboard.applyFilters()\">\n    \u003Cspan>to\u003C\u002Fspan>\n    \u003Cinput type=\"date\" id=\"filter-date-end\" onchange=\"dashboard.applyFilters()\">\n\u003C\u002Fdiv>\n```\n\n```javascript\nfunction filterByDateRange(data, dateField, startDate, endDate) {\n    return data.filter(row => {\n        const rowDate = new Date(row[dateField]);\n        if (startDate && rowDate \u003C new Date(startDate)) return false;\n        if (endDate && rowDate > new Date(endDate)) return false;\n        return true;\n    });\n}\n```\n\n### Combined Filter Logic\n\n```javascript\napplyFilters() {\n    const region = getFilterValue('filter-region');\n    const category = getFilterValue('filter-category');\n    const startDate = document.getElementById('filter-date-start').value;\n    const endDate = document.getElementById('filter-date-end').value;\n\n    this.filteredData = this.rawData.filter(row => {\n        if (region && row.region !== region) return false;\n        if (category && row.category !== category) return false;\n        if (startDate && row.date \u003C startDate) return false;\n        if (endDate && row.date > endDate) return false;\n        return true;\n    });\n\n    this.renderKPIs();\n    this.updateCharts();\n    this.renderTable();\n}\n```\n\n### Sortable Table\n\n```javascript\nfunction renderTable(containerId, data, columns) {\n    const container = document.getElementById(containerId);\n    let sortCol = null;\n    let sortDir = 'desc';\n\n    function render(sortedData) {\n        let html = '\u003Ctable class=\"data-table\">';\n\n        \u002F\u002F Header\n        html += '\u003Cthead>\u003Ctr>';\n        columns.forEach(col => {\n            const arrow = sortCol === col.field\n                ? (sortDir === 'asc' ? ' ▲' : ' ▼')\n                : '';\n            html += `\u003Cth onclick=\"sortTable('${col.field}')\" style=\"cursor:pointer\">${col.label}${arrow}\u003C\u002Fth>`;\n        });\n        html += '\u003C\u002Ftr>\u003C\u002Fthead>';\n\n        \u002F\u002F Body\n        html += '\u003Ctbody>';\n        sortedData.forEach(row => {\n            html += '\u003Ctr>';\n            columns.forEach(col => {\n                const value = col.format ? formatValue(row[col.field], col.format) : row[col.field];\n                html += `\u003Ctd>${value}\u003C\u002Ftd>`;\n            });\n            html += '\u003C\u002Ftr>';\n        });\n        html += '\u003C\u002Ftbody>\u003C\u002Ftable>';\n\n        container.innerHTML = html;\n    }\n\n    window.sortTable = function(field) {\n        if (sortCol === field) {\n            sortDir = sortDir === 'asc' ? 'desc' : 'asc';\n        } else {\n            sortCol = field;\n            sortDir = 'desc';\n        }\n        const sorted = [...data].sort((a, b) => {\n            const aVal = a[field], bVal = b[field];\n            const cmp = aVal \u003C bVal ? -1 : aVal > bVal ? 1 : 0;\n            return sortDir === 'asc' ? cmp : -cmp;\n        });\n        render(sorted);\n    };\n\n    render(data);\n}\n```\n\n## CSS Styling for Dashboards\n\n### Color System\n\n```css\n:root {\n    \u002F* Background layers *\u002F\n    --bg-primary: #f8f9fa;\n    --bg-card: #ffffff;\n    --bg-header: #1a1a2e;\n\n    \u002F* Text *\u002F\n    --text-primary: #212529;\n    --text-secondary: #6c757d;\n    --text-on-dark: #ffffff;\n\n    \u002F* Accent colors for data *\u002F\n    --color-1: #4C72B0;\n    --color-2: #DD8452;\n    --color-3: #55A868;\n    --color-4: #C44E52;\n    --color-5: #8172B3;\n    --color-6: #937860;\n\n    \u002F* Status colors *\u002F\n    --positive: #28a745;\n    --negative: #dc3545;\n    --neutral: #6c757d;\n\n    \u002F* Spacing *\u002F\n    --gap: 16px;\n    --radius: 8px;\n}\n```\n\n### Layout\n\n```css\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n}\n\nbody {\n    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n    background: var(--bg-primary);\n    color: var(--text-primary);\n    line-height: 1.5;\n}\n\n.dashboard-container {\n    max-width: 1400px;\n    margin: 0 auto;\n    padding: var(--gap);\n}\n\n.dashboard-header {\n    background: var(--bg-header);\n    color: var(--text-on-dark);\n    padding: 20px 24px;\n    border-radius: var(--radius);\n    margin-bottom: var(--gap);\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    flex-wrap: wrap;\n    gap: 12px;\n}\n\n.dashboard-header h1 {\n    font-size: 20px;\n    font-weight: 600;\n}\n```\n\n### KPI Cards\n\n```css\n.kpi-row {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n    gap: var(--gap);\n    margin-bottom: var(--gap);\n}\n\n.kpi-card {\n    background: var(--bg-card);\n    border-radius: var(--radius);\n    padding: 20px 24px;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n}\n\n.kpi-label {\n    font-size: 13px;\n    color: var(--text-secondary);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    margin-bottom: 4px;\n}\n\n.kpi-value {\n    font-size: 28px;\n    font-weight: 700;\n    color: var(--text-primary);\n    margin-bottom: 4px;\n}\n\n.kpi-change {\n    font-size: 13px;\n    font-weight: 500;\n}\n\n.kpi-change.positive { color: var(--positive); }\n.kpi-change.negative { color: var(--negative); }\n```\n\n### Chart Containers\n\n```css\n.chart-row {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));\n    gap: var(--gap);\n    margin-bottom: var(--gap);\n}\n\n.chart-container {\n    background: var(--bg-card);\n    border-radius: var(--radius);\n    padding: 20px 24px;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n}\n\n.chart-container h3 {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--text-primary);\n    margin-bottom: 16px;\n}\n\n.chart-container canvas {\n    max-height: 300px;\n}\n```\n\n### Filters\n\n```css\n.filters {\n    display: flex;\n    gap: 12px;\n    align-items: center;\n    flex-wrap: wrap;\n}\n\n.filter-group {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n}\n\n.filter-group label {\n    font-size: 12px;\n    color: rgba(255, 255, 255, 0.7);\n}\n\n.filter-group select,\n.filter-group input[type=\"date\"] {\n    padding: 6px 10px;\n    border: 1px solid rgba(255, 255, 255, 0.2);\n    border-radius: 4px;\n    background: rgba(255, 255, 255, 0.1);\n    color: var(--text-on-dark);\n    font-size: 13px;\n}\n\n.filter-group select option {\n    background: var(--bg-header);\n    color: var(--text-on-dark);\n}\n```\n\n### Data Table\n\n```css\n.table-section {\n    background: var(--bg-card);\n    border-radius: var(--radius);\n    padding: 20px 24px;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n    overflow-x: auto;\n}\n\n.data-table {\n    width: 100%;\n    border-collapse: collapse;\n    font-size: 13px;\n}\n\n.data-table thead th {\n    text-align: left;\n    padding: 10px 12px;\n    border-bottom: 2px solid #dee2e6;\n    color: var(--text-secondary);\n    font-weight: 600;\n    font-size: 12px;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    white-space: nowrap;\n    user-select: none;\n}\n\n.data-table thead th:hover {\n    color: var(--text-primary);\n    background: #f8f9fa;\n}\n\n.data-table tbody td {\n    padding: 10px 12px;\n    border-bottom: 1px solid #f0f0f0;\n}\n\n.data-table tbody tr:hover {\n    background: #f8f9fa;\n}\n\n.data-table tbody tr:last-child td {\n    border-bottom: none;\n}\n```\n\n### Responsive Design\n\n```css\n@media (max-width: 768px) {\n    .dashboard-header {\n        flex-direction: column;\n        align-items: flex-start;\n    }\n\n    .kpi-row {\n        grid-template-columns: repeat(2, 1fr);\n    }\n\n    .chart-row {\n        grid-template-columns: 1fr;\n    }\n\n    .filters {\n        flex-direction: column;\n        align-items: flex-start;\n    }\n}\n\n@media print {\n    body { background: white; }\n    .dashboard-container { max-width: none; }\n    .filters { display: none; }\n    .chart-container { break-inside: avoid; }\n    .kpi-card { border: 1px solid #dee2e6; box-shadow: none; }\n}\n```\n\n## Performance Considerations for Large Datasets\n\n### Data Size Guidelines\n\n| Data Size | Approach |\n|---|---|\n| \u003C1,000 rows | Embed directly in HTML. Full interactivity. |\n| 1,000 - 10,000 rows | Embed in HTML. May need to pre-aggregate for charts. |\n| 10,000 - 100,000 rows | Pre-aggregate server-side. Embed only aggregated data. |\n| >100,000 rows | Not suitable for client-side dashboard. Use a BI tool or paginate. |\n\n### Pre-Aggregation Pattern\n\nInstead of embedding raw data and aggregating in the browser:\n\n```javascript\n\u002F\u002F DON'T: embed 50,000 raw rows\nconst RAW_DATA = [\u002F* 50,000 rows *\u002F];\n\n\u002F\u002F DO: pre-aggregate before embedding\nconst CHART_DATA = {\n    monthly_revenue: [\n        { month: '2024-01', revenue: 150000, orders: 1200 },\n        { month: '2024-02', revenue: 165000, orders: 1350 },\n        \u002F\u002F ... 12 rows instead of 50,000\n    ],\n    top_products: [\n        { product: 'Widget A', revenue: 45000 },\n        \u002F\u002F ... 10 rows\n    ],\n    kpis: {\n        total_revenue: 1980000,\n        total_orders: 15600,\n        avg_order_value: 127,\n    }\n};\n```\n\n### Chart Performance\n\n- Limit line charts to \u003C500 data points per series (downsample if needed)\n- Limit bar charts to \u003C50 categories\n- For scatter plots, cap at 1,000 points (use sampling for larger datasets)\n- Disable animations for dashboards with many charts: `animation: false` in Chart.js options\n- Use `Chart.update('none')` instead of `Chart.update()` for filter-triggered updates\n\n### DOM Performance\n\n- Limit data tables to 100-200 visible rows. Add pagination for more.\n- Use `requestAnimationFrame` for coordinated chart updates\n- Avoid rebuilding the entire DOM on filter change -- update only changed elements\n\n```javascript\n\u002F\u002F Efficient table pagination\nfunction renderTablePage(data, page, pageSize = 50) {\n    const start = page * pageSize;\n    const end = Math.min(start + pageSize, data.length);\n    const pageData = data.slice(start, end);\n    \u002F\u002F Render only pageData\n    \u002F\u002F Show pagination controls: \"Showing 1-50 of 2,340\"\n}\n```\n\n## Examples\n\n```\n\u002Fbuild-dashboard Monthly sales dashboard with revenue trend, top products, and regional breakdown. Data is in the orders table.\n```\n\n```\n\u002Fbuild-dashboard Here's our support ticket data [pastes CSV]. Build a dashboard showing volume by priority, response time trends, and resolution rates.\n```\n\n```\n\u002Fbuild-dashboard Create a template executive dashboard for a SaaS company showing MRR, churn, new customers, and NPS. Use sample data.\n```\n\n## Tips\n\n- Dashboards are fully self-contained HTML files -- share them with anyone by sending the file\n- For real-time dashboards, consider connecting to a BI tool instead. These dashboards are point-in-time snapshots\n- Request \"dark mode\" or \"presentation mode\" for different styling\n- You can request a specific color scheme to match your brand\n",{"name":5,"description":7,"argument-hint":44},"\u003Cdescription> [data source]","main","e605d8ddbfb688da57dfaaceebd93f12a64ef1d3","data\u002Fskills\u002Fbuild-dashboard",3966,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins","https:\u002F\u002Fgithub.com\u002Fanthropics","https:\u002F\u002Fanthropic.com","2026-11-14 06:21:52",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add anthropics\u002Fknowledge-work-plugins --skill build-dashboard",{"tool":59,"command":60},"bunx","bunx skills add anthropics\u002Fknowledge-work-plugins --skill build-dashboard",{"tool":62,"command":63},"pnpm","pnpm dlx skills add anthropics\u002Fknowledge-work-plugins --skill build-dashboard","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fbuild-dashboard\u002FSKILL.md",true,[],[68,77,103,128,151,175],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":72,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":76},"01M73EGCY8ZMBZCCP7TTE6119W","nextflow-development","Run nf-core bioinformatics pipelines (rnaseq, sarek, atacseq) on sequencing data. Use when analyzing RNA-seq, WGS\u002FWES, or ATAC-seq data—either local FASTQs or public datasets from GEO\u002FSRA. Triggers on nf-core, Nextflow, FASTQ analysis, variant calling, gene expression, differential expression, GEO reanalysis, GSE\u002FGSM\u002FSRR accessions, or samplesheet creation.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fbio-research\u002Fskills\u002Fnextflow-development\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fbio-research\u002Fskills\u002Fnextflow-development\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":39},"01M718Y97HCGW12Q53PSJDY03W","ticket-deflector","Reads a forwarded customer email or ticket, pulls order and refund status from a payments connector (PayPal, Square, or Stripe) or Shopify, account history from the CRM, and open tickets from a support desk (Zoho Desk), drafts a tone-matched reply in the owner's writing voice, and can issue a refund through the payments connector with explicit owner approval. With Shopify connected it also runs a proactive order-triage mode that surfaces orders needing attention — unfulfilled past the promised window, payment problems, pending refunds, stuck shipments — and drafts the next action for each before the customer has to ask. Use when the user says \"draft a response,\" \"answer this customer,\" \"where's my order,\" \"I want a refund,\" \"check my orders,\" or \"anything about to blow up.\"","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fsmall-business\u002Fskills\u002Fticket-deflector\u002FSKILL.md",[],[84,85,86,87,88,89,90,91,92,93,36,94,95,96,97,98,99,100,101,102],"ticket","ticket deflector","read","crm","window","mail","text","Connector","ask","workflow","writing","customer","support","open","payments","up","mode","past","next",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":39},"01M718Y55HFAN5705ME5VEDZ9K","tax-season-organizer","Prepares tax-season materials for the owner's accountant, not tax advice. US federal tax; a non-US business gets its closed-books packet instead. Two modes: (1) quarterly estimated tax from YTD net income in the ledger (MYOB, NetSuite, QuickBooks, Xero, or Zoho Books); (2) year-end 1099 prep, scanning the ledger, PayPal, and Stripe for contractors paid over USD 600 into a 1099-NEC list with missing W-9 flags.\nAny tax request routes first to \u002Ftax-prep, which confirms the books are closed and reconciled before running this skill. Use this skill directly only when the owner says the period's books are already closed: \"books are closed, now do the 1099s,\" \"run the quarterly estimate off the closed numbers,\" or \"just the contractor W-9 list.\"","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fsmall-business\u002Fskills\u002Ftax-season-organizer\u002FSKILL.md",[],[110,111,112,113,114,115,36,116,117,118,119,120,121,122,123,124,125,126,127,86],"tax season organizer","tax","end","scanning","xero","books","now","only","usd","request","paid","netsuite","which","us federal","run","stripe","list","flags",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":39},"01M718Y13VVPHDD9NTDBVFJ2AZ","tax-prep","Prepares tax materials as a two-link chain — month-end-prep confirms the books are closed and reconciled first, then tax-season-organizer calculates the quarterly estimated payment or builds the year-end 1099-NEC list and accountant packet from those closed numbers. Requires a ledger (MYOB, NetSuite, QuickBooks, Xero, or Zoho Books); uses Gusto, PayPal, and Stripe when connected, else CSV upload. US federal tax math; a non-US business gets the closed-books packet. Prep material for a CPA, never tax advice, nothing filed. Trigger on \"quarterly taxes,\" \"estimated tax payment,\" \"how much should I set aside,\" \"1099s,\" \"1099-NEC,\" \"W-9s,\" \"year-end tax prep,\" \"get my books ready for my accountant,\" any phrasing that suggests a tax deadline is coming, or a question about net profit or YTD income that sounds like worry about a tax bill. An owner who says the period's books are already closed routes to tax-season-organizer directly.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fsmall-business\u002Fskills\u002Ftax-prep\u002FSKILL.md",[],[135,111,136,137,138,139,140,123,141,142,143,144,145,146,147,121,148,149,112,150],"prep","tax prep","business","paypal","question","material","trigger","for","profit","chain","get","zoho books","never","ready","as","SET",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":39},"01M718XWTWQZ01GYSG9T8RW8TW","speed-to-lead","Makes sure no inbound lead goes unanswered. Watches web forms, the shared inbox, and the CRM for new inquiries, qualifies each one against the owner's criteria, drafts a reply in the owner's voice with real meeting times for the owner to approve and send, routes anything hot to a human right away, and logs the whole thing to the CRM. Never sends on its own. Built to run on a schedule so overnight inquiries are drafted and sorted by morning, and works from forwarded or pasted inquiries when no connector is available. Use this whenever the owner is worried about inbound leads or response time — including phrasings like \"leads are going cold,\" \"did anyone answer that inquiry,\" \"I keep missing form submissions,\" \"nothing falls through the cracks,\" \"handle my inbound,\" \"respond to this lead,\" or \"we lose people because nobody gets back fast enough.\" Reach for it for a single unanswered inquiry as readily as for a standing setup.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fsmall-business\u002Fskills\u002Fspeed-to-lead\u002FSKILL.md",[],[158,159,160,161,162,163,147,164,165,166,167,168,169,91,170,171,36,172,173,174],"speed","lead","speed to lead","send","inbox","time","cold","back","shared","respond","human","sure","logs","schedule","people","web forms","new",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":39},"01M718XQYMN1KY3TPS33967FK0","social-content-engine","Runs the owner's content operation as a standing thing rather than a one-off: keeps a rolling posting calendar, learns the owner's voice, generates on-brand Canva graphics, writes captions that sound like them, repurposes one asset into every channel format, and stages posts for approval instead of publishing on its own. Pulls product photos and prices from Shopify when connected; with no connectors, drafts the calendar and asset briefs for manual posting. Use this whenever the owner talks about posting, content, or social — including \"I need to post more,\" \"we've gone quiet on Instagram,\" \"what should we post this month,\" \"make the content,\" \"give me a month of posts,\" \"write this in my voice,\" \"repurpose this,\" or \"set up our content calendar.\" Reach for it for a single post as readily as for a full quarter. One handoff: a finished, approved campaign brief goes to canva-creator; this skill owns the standing operation.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fknowledge-work-plugins\u002Fblob\u002Fmain\u002Fsmall-business\u002Fskills\u002Fsocial-content-engine\u002FSKILL.md",[],[182,183,184,185,186,187,188,189,190,86,191,192,36,193,99,194,195,196,197,150],"social content engine","engine","social","content","social content","content engine","calendar","drafts","write","product","me","campaign","prices","Captions","posts","brief"]