make-dashboard
Use when the user wants a dashboard, KPI page or charts built from local data files (CSV, Parquet, JSON, DuckDB, SQLite) or Postgres/MySQL as a self-contained static HTML page whose charts show their SQL and refresh time; works offline with any agent that can run shell commands.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- make-dashboard
- model
- haiku
- effort
- low
- description
- Use when the user wants a dashboard, KPI page or charts built from local data files (CSV, Parquet, JSON, DuckDB, SQLite) or Postgres/MySQL as a self-contained static HTML page whose charts show their SQL and refresh time; works offline with any agent that can run shell commands.
- argument-hint
- what to build, e.g. "revenue by region and monthly trend from data/sales.csv"
02 资源文件 146
- 参考文档package-lock.json46.2 KB
- 参考文档package.json604 B
- 参考文档README.md9.6 KB
- 资产文件references/examples/data/sales.csv1.3 KB
- 参考文档references/examples/data/sales.parquet1.3 KB
- 参考文档references/examples/minimal.json411 B
- 参考文档references/examples/sales-overview.json2.6 KB
- 参考文档references/kinds.md7.0 KB
- 参考文档references/refresh.md4.0 KB
- 参考文档references/schema.md11.9 KB
- 参考文档references/sql-sandbox.md7.0 KB
- 脚本scripts/build.mjs2.8 KB
- 脚本scripts/doctor.mjs523 B
- 脚本scripts/inspect.mjs6.0 KB
- 脚本scripts/lib/axis-ticks.mjs3.7 KB
- 脚本scripts/lib/data.mjs10.0 KB
- 脚本scripts/lib/format.mjs640 B
- 脚本scripts/lib/guard.mjs5.6 KB
- 脚本scripts/lib/html.mjs8.0 KB
- 脚本scripts/lib/inline-chart.mjs4.6 KB
- 脚本scripts/lib/interact.mjs3.2 KB
- 脚本scripts/lib/kinds.mjs4.7 KB
- 脚本scripts/lib/live.mjs9.1 KB
- 脚本scripts/lib/pipeline.mjs6.4 KB
- 脚本scripts/lib/requirements.mjs497 B
- 脚本scripts/lib/sources.mjs4.4 KB
- 脚本scripts/lib/spec.mjs10.6 KB
- 脚本scripts/lib/sql.mjs10.3 KB
- 脚本scripts/lib/static-chart.mjs15.1 KB
- 脚本scripts/lib/vega-config.mjs1.6 KB
- 脚本scripts/lib/views.mjs13.3 KB
- 脚本scripts/serve.mjs5.5 KB
- 脚本scripts/setup.mjs2.2 KB
- 脚本scripts/validate.mjs1.3 KB
- 脚本shared/agents.mjs4.7 KB
- 脚本shared/art.mjs20.8 KB
- 脚本shared/cli.mjs2.3 KB
- 脚本shared/contrast.mjs3.0 KB
- 脚本shared/doctor.mjs34.4 KB
- 脚本shared/errors.mjs4.4 KB
- 资产文件shared/fonts/atkinson-hyperlegible-latin-400-normal.woff216.8 KB
- 资产文件shared/fonts/atkinson-hyperlegible-latin-700-normal.woff217.1 KB
- 资产文件shared/fonts/big-shoulders-display-latin-900-normal.woff213.7 KB
- 资产文件shared/fonts/bricolage-grotesque-latin-600-normal.woff221.9 KB
- 资产文件shared/fonts/commit-mono-latin-400-normal.woff247.0 KB
- 资产文件shared/fonts/familjen-grotesk-latin-400-normal.woff211.4 KB
- 资产文件shared/fonts/familjen-grotesk-latin-700-normal.woff211.5 KB
- 资产文件shared/fonts/funnel-display-latin-700-normal.woff210.4 KB
- 资产文件shared/fonts/geist-mono-latin-400-normal.woff29.6 KB
- 资产文件shared/fonts/geist-sans-latin-400-normal.woff232.6 KB
- 资产文件shared/fonts/geist-sans-latin-600-normal.woff234.5 KB
- 资产文件shared/fonts/host-grotesk-latin-400-normal.woff213.4 KB
- 资产文件shared/fonts/host-grotesk-latin-700-normal.woff213.6 KB
- 资产文件shared/fonts/jetbrains-mono-latin-400-normal.woff220.7 KB
- 参考文档shared/fonts/LICENSES/atkinson-hyperlegible.txt4.5 KB
- 参考文档shared/fonts/LICENSES/big-shoulders-display.txt4.3 KB
- 参考文档shared/fonts/LICENSES/bricolage-grotesque.txt4.3 KB
- 参考文档shared/fonts/LICENSES/commit-mono.txt4.3 KB
- 参考文档shared/fonts/LICENSES/familjen-grotesk.txt4.4 KB
- 参考文档shared/fonts/LICENSES/funnel-display.txt4.3 KB
- 参考文档shared/fonts/LICENSES/geist-mono.txt4.4 KB
- 参考文档shared/fonts/LICENSES/geist-sans.txt4.3 KB
- 参考文档shared/fonts/LICENSES/host-grotesk.txt4.4 KB
- 参考文档shared/fonts/LICENSES/jetbrains-mono.txt4.4 KB
- 参考文档shared/fonts/LICENSES/martian-mono.txt4.3 KB
- 参考文档shared/fonts/LICENSES/newsreader.txt4.4 KB
- 参考文档shared/fonts/LICENSES/schibsted-grotesk.txt4.4 KB
- 参考文档shared/fonts/LICENSES/young-serif.txt4.3 KB
- 资产文件shared/fonts/martian-mono-latin-400-normal.woff210.1 KB
- 参考文档shared/fonts/metrics.json65.9 KB
- 资产文件shared/fonts/newsreader-latin-600-normal.woff223.3 KB
- 资产文件shared/fonts/schibsted-grotesk-latin-400-normal.woff223.8 KB
- 资产文件shared/fonts/schibsted-grotesk-latin-700-normal.woff224.6 KB
- 参考文档shared/fonts/SOURCES.md1.4 KB
- 资产文件shared/fonts/young-serif-latin-400-normal.woff226.4 KB
- 参考文档shared/GENERATED.md167 B
- 脚本shared/icons.mjs2.8 KB
- 脚本shared/nowrap-probe.mjs2.2 KB
- 脚本shared/nowrap.mjs1.8 KB
- 脚本shared/output.mjs1.1 KB
- 脚本shared/provenance.mjs2.8 KB
- 脚本shared/stale-copy.mjs2.5 KB
- 脚本shared/text.mjs3.9 KB
- 脚本shared/theme-toggle.mjs2.5 KB
- 脚本shared/theme.mjs3.5 KB
- 参考文档shared/themes/blueprint.json2.3 KB
- 参考文档shared/themes/brief.json2.4 KB
- 参考文档shared/themes/dusk.json2.3 KB
- 参考文档shared/themes/editorial.json2.4 KB
- 参考文档shared/themes/ink.json2.3 KB
- 参考文档shared/themes/mono.json2.3 KB
- 参考文档shared/themes/paper.json2.0 KB
- 参考文档shared/themes/poster.json2.4 KB
- 参考文档shared/themes/press.json2.3 KB
- 脚本shared/type.mjs1.8 KB
- 脚本template/live.js2.7 KB
- 脚本template/pa-lib.js2.4 KB
- 参考文档template/page.html7.7 KB
- 脚本template/runtime.js12.8 KB
- 脚本test/browser.test.mjs27.4 KB
- 脚本test/build.test.mjs17.0 KB
- 脚本test/chrome-browser.test.mjs2.5 KB
- 脚本test/chrome.test.mjs4.5 KB
- 脚本test/doctor.test.mjs6.4 KB
- 脚本test/errors.test.mjs3.6 KB
- 资产文件test/fixtures/data/sales.csv1.3 KB
- 其他test/fixtures/data/sales.parquet1.3 KB
- 参考文档test/golden/area.color.json2.6 KB
- 参考文档test/golden/area.json1.9 KB
- 参考文档test/golden/area.line.json1.9 KB
- 参考文档test/golden/bar.json787 B
- 参考文档test/golden/bar.share.json1.2 KB
- 参考文档test/golden/bar.sorted.json787 B
- 参考文档test/golden/boxplot.histogram.json855 B
- 参考文档test/golden/boxplot.json271 B
- 参考文档test/golden/bubble.json739 B
- 参考文档test/golden/bubble.scatter.json556 B
- 参考文档test/golden/donut.bar.json787 B
- 参考文档test/golden/donut.json852 B
- 参考文档test/golden/grouped-bar.json1.0 KB
- 参考文档test/golden/grouped-bar.stacked.json999 B
- 参考文档test/golden/heatmap.json917 B
- 参考文档test/golden/histogram.boxplot.json189 B
- 参考文档test/golden/histogram.json855 B
- 参考文档test/golden/line.area.json2.6 KB
- 参考文档test/golden/line.json2.6 KB
- 参考文档test/golden/scatter.json1.0 KB
- 参考文档test/golden/stacked-bar.grouped.json1.0 KB
- 参考文档test/golden/stacked-bar.json999 B
- 参考文档test/golden/stacked-bar.normalized.json1.1 KB
- 脚本test/guard.test.mjs10.7 KB
- 脚本test/helpers/browser.mjs1.6 KB
- 脚本test/helpers/live-harness.mjs5.5 KB
- 脚本test/inspect.test.mjs4.8 KB
- 脚本test/interact.test.mjs1.6 KB
- 脚本test/kinds.test.mjs6.3 KB
- 脚本test/live-harness.test.mjs4.1 KB
- 脚本test/live.test.mjs14.7 KB
- 脚本test/nowrap-browser.test.mjs9.4 KB
- 脚本test/pa-lib.test.mjs2.2 KB
- 脚本test/serve.test.mjs3.6 KB
- 脚本test/sources.test.mjs15.5 KB
- 脚本test/static-chart.test.mjs34.4 KB
- 脚本test/theme-page.test.mjs2.8 KB
- 脚本test/validate.test.mjs14.6 KB
- 脚本test/views.test.mjs22.5 KB
03 SKILL.md 正文
make-dashboard
You write one JSON spec (dashboard.json: sources, SQL queries, KPIs, charts as kinds or raw Vega-Lite).
Scripts validate it and build a single offline index.html. Every chart card shows its SQL,
row count and refresh time. No network, no LLM at build time.
Cheaper model
Skip this section if you are running in Claude Code (it already runs this skill on the model named in the frontmatter), or if artifact-builder is not in your list of available agents. Otherwise, if you can start another agent, start the artifact-builder agent to do the work, unless you are already artifact-builder. If you are already artifact-builder, skip the rest of this section and do the work yourself.
Give it a self-contained brief. It has no memory of this conversation, so the brief must say:
- What to build, and every fact and choice from this conversation that affects it (data, names, wording, theme, what the user asked for and what they ruled out).
- This skill directory: the full path of the folder that holds this SKILL.md.
- The spec path: where it should write the JSON spec.
- Optionally, an output folder for the build (it passes this to the build script as
--out).
Relay only the output path it returns. Do not repeat its work.
If the artifact-builder agent is not installed, or you cannot start another agent, continue with the steps below yourself.
Before the first build
<skill-dir> is the folder containing this SKILL.md. Run node <skill-dir>/scripts/doctor.mjs --json (add --for <spec.json> once the spec exists, --for voiceover for a voiceover (make-motion), --for check before check.mjs (skills that have one)). It needs only Node.
If it reports anything missing, tell the user in one message: each item, why it is needed, its size and the command, plus every notes and info entry from the output (they disclose downloads and the files an install writes). Ask once per set of missing items (the plain run and a later --for run may each find new ones). On yes, run node <skill-dir>/scripts/doctor.mjs --fix <ids> with the ids it reported, and the same --for you diagnosed with (for example --fix <ids> --for check). Hand the user the exact command to run themselves for anything the doctor reports as refused (it needs sudo, or has no automatic fix), skipped (needs node_modules first), installed elsewhere, still missing, or failed; in Claude Code suggest prefixing it with !. On no, do what you can without it and give the user the remaining commands.
Workflow
Run every step yourself, in this same turn, with your shell or file tools. Do not end your reply after showing or describing the JSON: keep going until validate prints valid and the output file exists.
Run every command from the project folder
(where dashboard.json lives), using the full path to the scripts.
If the request is empty, ask what to build and from which data file(s).
- Look at the data first. Never guess columns:
node <skill-dir>/scripts/inspect.mjs data/sales.csv(column names, types, 5 sample rows; csv, parquet or json). For an attached source in a spec (duckdb, sqlite, postgres, mysql) list its tables, then look at one:node <skill-dir>/scripts/inspect.mjs --spec dashboard.json --source shopand... --source shop --table items. - Write
dashboard.jsonnext to the data. Source paths are relative to the spec file and must stay inside the spec's folder. Actually create the file: describing it or announcing a patch is not enough. If your file tool fails, write it with a shortnode -escript that callsfs.writeFileSync, then confirm the file exists before validating. - Validate and fix until it prints
valid(it also runs every query, so valid means buildable):node <skill-dir>/scripts/validate.mjs dashboard.json - Write
generatedByintodashboard.json: the model you are running as, your effort level if you know it, and your host (for example Claude Code, Codex, Copilot CLI, Gemini CLI). Never guess; leave out any field you do not know. Aserve.mjs --watchrebuild reads it from the spec and does not get the flags, so the spec is where it must live.--model,--effortand--agenton the build override it for a one-off build. Build:node <skill-dir>/scripts/build.mjs dashboard.json(writesdist/index.html,--out <dir>to change). An error such ascharts[0].y: "revnue" is not a column of query "by_region" (columns: region, revenue); did you mean "revenue"?names the exact path and fix. - Show it. For live updates while editing the spec or data:
node <skill-dir>/scripts/serve.mjs --watch dashboard.json --open(rebuilds on save; Postgres/MySQL: add--interval 60). Or run theserve:line that build printed, or opendist/index.htmldirectly: it is one file. - To change anything, edit only
dashboard.json, then rerun steps 3 and 4. Never editdist/. A refresh is just a rebuild; for scheduled rebuilds seereferences/refresh.md.
Data outside the spec's folder is refused. Do not work around that: move or copy the data under the
spec folder. Only the person running the commands may add --allow-outside to validate/build.
Queries have a 30 s limit (--timeout <seconds> on build).
Spec shape
{
"title": "Sales", "description": "optional", "maxRows": 5000,
"sources": { "sales": { "type": "parquet", "path": "data/sales.parquet" } },
"queries": {
"total": "SELECT SUM(amount) AS revenue FROM sales",
"by_region": "SELECT region, SUM(amount) AS revenue FROM sales GROUP BY 1 ORDER BY 2 DESC",
"by_month": "SELECT date_trunc('month', date) AS month, region, SUM(amount) AS revenue FROM sales GROUP BY 1, 2 ORDER BY 1"
},
"kpis": [ { "id": "k1", "title": "Revenue", "query": "total", "field": "revenue", "format": "currency" } ],
"charts": [
{ "id": "c1", "title": "North drives half of revenue", "query": "by_region", "width": "half",
"kind": "bar", "x": "region", "y": "revenue", "format": "currency" },
{ "id": "c2", "title": "Revenue up 18% since March", "query": "by_month",
"kind": "line", "x": "month", "y": "revenue", "color": "region" }
]
}
sources.type:csv | parquet | json(a table named after the key),duckdb | sqlite(attached; queryname.table,path),postgres | mysql(attached;"env": "PG_URL"names the variable holding the connection string, never put it in the spec). sqlite/postgres/mysql need a one-timenode <skill-dir>/scripts/setup.mjs dashboard.json(online; builds stay offline).queries: one SELECT each, names[a-z][a-z0-9_]*. Alias every aggregate (AS revenue); chart fields are those aliases.kpis[].format:number | currency | percent | compact(percent expects a fraction).charts[].width:full(default) orhalf. Each chart has exactly one ofkindorvegaLite.kind:bar | stacked-bar | grouped-bar | line | area | scatter | bubble | heatmap | histogram | boxplot | donut. Name columns by role (x,y,color,size,value); the build makes the chart, tooltips, alternate views, a sortable Table view and PNG/SVG/CSV export. RawvegaLite(any Vega-Lite spec withoutdata) still works for anything the kinds don't cover.- Chart titles state the finding ("North drives half of revenue"), not the field names.
viewspicks alternate views (e.g.["sorted", "table"]);pair: trueputs the primary view and a second (switchable) view side by side. Order follows the query, so writeORDER BY.theme:paper(default),blueprint,editorial,ink,dusk,press,poster,mono,brief. Never set colours,config,widthorautosizeinvegaLite.- Full kind reference (roles, views, rules, errors):
references/kinds.md. - Raw
vegaLitedates are UTC strings: use"type": "temporal"withutc…time units (utcyearmonth). - Aim for few, clear charts: bar for magnitude, line for change over time, colour only for a real category (max 8).
- Field list and rules:
references/schema.md. Working examples:references/examples/.
Degraded mode
If you cannot run shell commands, write dashboard.json and give the user the exact commands from steps 3, 4 and 5 to run (with the real <skill-dir> path).
When done, report the spec path, the built index.html path, the serve URL and one line per chart. Remind the user that the page embeds the query results: do not publish it if the data is private.
Security
The SQL is written by a model, so it is untrusted. Each query must parse as one SELECT, and then an
allowlist runs over its syntax tree (nesting, CTEs, subqueries and string constants cannot hide anything):
it may read only the declared sources (name, source.table, source.schema.table) and its own CTEs, and the
only table functions allowed are range, generate_series and unnest. System catalogs (pg_catalog,
information_schema, duckdb_* views) and functions that read settings, the environment or files are rejected.
It then runs in DuckDB locked to the declared files. Attached DuckDB files that define views or macros are refused.
Titles, SQL and data are escaped in the page. Keep credentials out of specs and data paths.
Do not point path at files the user did not mention. Charts can never load URLs
(url, data, usermeta are rejected anywhere in vegaLite) and the page ships a strict CSP.
The SQL allowlist is the control; the cell/error scrubber is only defence in depth.
Each known bypass vector and the test that pins it is in references/sql-sandbox.md.
The allowlist is the query control; offline is guaranteed by the locked DuckDB
connection and the page's default-src 'none' CSP, not by the validator.
serve.mjs binds 127.0.0.1 and refuses non-local Host headers (403).
Watch mode serves a copy with connect-src 'self' for the event stream; the built file on disk keeps default-src 'none'.
For postgres/mysql, READ_ONLY on the attach only limits DuckDB: the real guard is a read-only database role.
04 同仓库更多 Skills
second-wind
Orchestrate long unattended Claude Code runs across multiple repos with the wind CLI. Use when the user wants to run Claude Code overnight, resume sessions after the 5-hour usage limit, run Claude in many repos at once via tmux, or says "set up second wind", "wind up", "overnight run", "resume after limit", "usage limit orchestrator".
structured-output-adaptive-thinking-token-bloat
A Claude API call using output_config.format (json_schema structured outputs) with thinking:{type:"adaptive"} burns most of its output budget on thinking (observed ~21k of ~24k tokens) without improving JSON quality, making the run up to ~5x more expensive than the same call with thinking omitted — use when calling the Messages API with a json_schema output format for extraction, ranking, classification, or summarization tasks, or when a schema-constrained call's usage.output_tokens is far larger than the returned JSON.
review
Apply a code-review lens to a diff, branch, or file — find correctness bugs, security issues, and quality problems, ranked by severity, with a concrete fix for each. Use when the user says "review this", "review my diff", "check this PR", "look this over before I commit", or "is this safe". Skip when the user wants the code written, not reviewed.
refresh
Rebuild the prompt-craft command registry and usage profile, and print a summary of installed commands and your personalized recommendations. Use when you install or update plugins and want the advisor to pick them up immediately, or say "refresh prompt-craft", "rebuild the command registry".
refactor
Apply a refactoring lens — restructure code without changing behavior, guarded by tests that pass before and after. Use when the user says "refactor", "clean this up", "extract this", "simplify this", "reduce duplication", or "make this readable" on existing working code. Skip when the change is meant to alter behavior (that's a feature or a fix).
plan
Decompose a non-trivial task into an explicit, tracked plan with goals and per-step acceptance criteria before writing code. Use when the user says "plan this", "break this down", "what's the plan", or asks for a multi-step feature/refactor that touches more than one file. Pairs with plan mode. Skip for single-edit changes that need no decomposition.