---
name: data-dashboard
version: 0.2.1
description: Turn a small CSV (about 10 KB) into a single-file interactive data dashboard (数据看板) through SandBase models - the model picks the KPIs, charts and words, the template computes every number from the data in code, with a budget check, safety and quality checks and a bilingual report. Use when the user asks for a dashboard, KPI board, report page or 数据看板 from tabular data.
---

# data-dashboard

Turns a CSV plus a title and a description into one self-contained `site/index.html` (KPI tiles,
trend, breakdown, share, observations, table, range switch) plus `report.json` and
`report.en.html` / `report.zh-CN.html`. Every number on the page is computed from the CSV; the
model never writes one. The model picks one of three motion presets (or the brief's `motion`). See
`references/generation.md`.

## Workflow

1. Write the brief (`references/brief.md`; examples in `assets/sample-brief.*.json`).
2. The key: ask the user to export `SANDBASE_API_KEY` in their own shell. Never ask for it in the
   conversation, never pass it as a flag, never print it.
3. Estimate (this also checks the CSV): `node scripts/generate.mjs estimate --brief brief.json`.
4. Run: `node scripts/generate.mjs run --brief brief.json --yes [--site-lang zh-CN] [--lang zh-CN]`.
   Add `--archive DIR` to keep every request, raw answer and check result.
5. Report back: open `site/index.html`; mention data warnings (rows dropped, columns ignored).

Output: `data-dashboard-out/<stamp>-data-dashboard/{site/index.html, report.json, report.en.html, report.zh-CN.html}`.
A typical run costs about $0.02–0.05; the budget (default $0.20) is a hard cap.

## Rules

- Only SandBase (`https://api.sandbase.ai/v1`) receives the key.
- The CSV stays inside the page; reports never contain the key, the run token or the CSV.

## Files

- `scripts/generate.mjs` CLI · `scripts/hosted.mjs` Lab sandbox entry (`references/hosted.md`)
- `scripts/lib/entry/`: schema, layout variants, renderer, CSV parsing, charts, page script · `assets/prompt.md`: the prompt
- `scripts/lib/core/`: the shared web engine (identical copy in every web skill; edit it only in landing-page)
- `references/`: generation, brief, report format, hosted, third-party license notices
