Build dashboards and visualizations with AI
Skills used in this guide (3)
为 Grafana、SigNoz 等平台搭建真正回答运维问题的监控看板,而不是只好看的仪表盘。
npx skills add affaan-m/ECC -gPostgreSQL 模式实践:查询优化、schema 设计、索引与安全,基于 Supabase 最佳实践。适合设计表结构与索引、配置 RLS,或排查慢查询。
npx skills add affaan-m/ECC -g以自然语言查询运行中的 Convex 应用的日志与健康(官方 MCP):失败、缓慢或昂贵的函数、部署因果关系——限定范围、有证据支撑,并附仪表盘深链。
npx skills add get-convex/agent-skills -g
The pain of dashboards isn't "can't draw charts" — it's "metrics undefined, charts piled, nobody looks". The point: define the north-star metric and the question first, then let AI pick chart types and write queries, not pile fancy charts upfront.
Who this is for / not for
For:
- Build monitoring dashboards for ops/business
- Have DB/API but can't write queries
- Want a panel that shows health at a glance
Not for:
- No data collected yet (collect first)
- Realtime millisecond screens (that's engineering)
- Fuzzy metric definitions (AI picks wrong)
Before you start
- Data source: DB tables / API endpoint.
- Question: who views it, which numbers to watch.
- Refresh: realtime / hourly / daily.
Steps
1. Install the skill
dashboard-builder is a dashboard skill. Copy its folder into your client's skills directory (same as any Agent Skill):
| Client | Directory |
|---|---|
| Claude Code | ~/.claude/skills/ |
| Codex | ~/.codex/skills/ |
| Cursor | ~/.cursor/skills/ |
| Trae | ~/.trae/skills/ |
| CodeBuddy | ~/.codebuddy/skills/ |
| Tongyi Lingma | ~/.lingma/skills/ |
2. Metrics first, then charts
Build an e-commerce ops dashboard answering: sales today, best channel, stock enough?
List 5 key metrics (definition +口径), pick a chart for each (trend=line, share=pie, rank=bar).
No chart-piling; each chart maps to one decision.3. Let AI write the query
Use postgres-patterns for correct queries, avoid N+1 and wrong口径:
From orders table, write SQL for "daily GMV last 7 days", aggregate by day,
exclude refunds, give a runnable statement and field notes.4. Realtime with Convex
For live refresh, use convex-insights as base, wire results as subscriptions.
Pitfalls
| Pit | Symptom | Fix |
|---|---|---|
| Metrics vague | Many charts, no use | North-star first |
| Wrong chart | Pie for trend | Line/pie/bar by type |
| Wrong口径 | Numbers mismatch | Define口径 clearly |
| Forced realtime | Slow, costly | Use scheduled refresh if not live |
| Decorated | Info buried | Each chart = one decision |
FAQ
No data, build?
Collect first; dashboard is display, empty is meaningless.
Chart choice?
Trend=line, share=pie, rank=bar, distribution=histogram.
Can't write SQL?
AI writes from schema; postgres-patterns avoids pitfalls.
Realtime screen?
convex-insights base; scheduled refresh is cheaper if not live.
Define metrics?
Reverse from "who views, what to answer"; don't draw first.
Related guides
Continue across these scenes:
相关源码
- affaan-m/ECC · dashboard-builder source
- affaan-m/ECC · postgres-patterns source
- get-convex/agent-skills · convex-insights source
- Agent Skill open format spec
一句话结论
结论:看板先定指标再画图表——给 AI 数据源和问题,让它选图写查询,别一上来堆花哨图。
References
Related Scenes
Write SQL and analytics queries with AI
AI SQL's scare is "runs but wrong口径" — looks right, aggregation dimension wrong. The point: give schema and clear口径 (by day / by user, dedup?, exclude refunds), have it explain then write, not just "count sales".
Turn raw data into a report you can ship, with AI
The most common analytics failure isn't "can't compute" — it's "computed fast but wrong": units not unified, nulls treated as 0,口径 drifting from last time. The point: define口径 first, let AI compute, then spot-check 3 rows by hand.