仪表盘设计规范
安装方式
先用 Prompt 核对来源,也可切换到安装命令或下载可用的安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "lens-dashboard":https://skillpi.com/zh/skills/deepskill-eb3eafedbeaaa12d28ef72b8f9f04db267d191297041d71f79e0ae25cdcddb17。安装前核对上游来源和版本:https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/ai-agency/tonone/skills/lens-dashboard/SKILL.md。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
此命令从 GitHub 来源仓库获取指定技能。运行前请先查看源文件。
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/ai-agency/tonone/skills/lens-dashboard --skill lens-dashboard来源与配置
查看 GitHub 源码jeremylongshore/tons-of-skills-marketplace固定提交 6ea46b08dce892944db7c16f28d0b5308d402402
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
本条目介绍 仪表盘设计规范 的公开用途。DeepSkill 当前公开目录说明:“设计并规范一个分析仪表盘——明确每个图表所回答的问题,编写 SQL 查询语句,规定布局与刷新频率。输出一份可直接实施的完整仪表盘规范。适用于当被要求“构建仪表盘”、“分析仪表盘”、“BI 仪表盘”、“每周产品健康状况”或“可视化此数据”时使用。” 适用场景包括做图表与报表、写 SQL 取数、分析数据与指标归因。本页根据公开目录资料和固定版本的上游仓库整理,建议使用前核对该版本的环境、工具、权限及数据处理要求。Skillπ 提供站方用途介绍与原站链接;原始 SKILL.md 和附件仅在对应许可允许时开放。
文件浏览
---
name: lens-dashboard
description: Design and spec an analytical dashboard — define the question each chart answers, write the SQL queries, spec the layout and refresh cadence. Produces a complete dashboard spec ready to implement. Use when asked to "build a dashboard", "analytics dashboard", "BI dashboard", "weekly product health", or "visualize this data".
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion
version: 0.6.4
author: tonone-ai <hello@tonone.ai>
license: MIT
---
# Build Analytical Dashboard
You are Lens — the data analytics and BI engineer from the Engineering Team. A dashboard nobody checks is waste. Every chart answers a specific question — if it doesn't, it doesn't ship.
## Steps
### Step 0: Detect Environment
Scan workspace for data and BI indicators:
- `docker-compose.yml` — check for Metabase, Grafana, Superset, ClickHouse, PostgreSQL
- `.env` or config files — database connection strings, BI tool URLs
- `requirements.txt` / `pyproject.toml` — Streamlit, Dash, Plotly, pandas
- `package.json` — Chart.js, Recharts, D3, Observable
- `dbt_project.yml` — dbt models (data transformation layer)
- `grafana/` or `dashboards/` — existing dashboard configs
- SQL files, `.sql` queries — existing analytics queries
- `analytics/`, `reports/`, `metrics/` directories
Identify: data store (Postgres, BigQuery, Snowflake, etc.), BI tools in use, available tables/schemas.
### Step 1: Run the Decision + "So What?" Audit
Before writing a single query, answer:
1. **What decision does this dashboard support?** — Not "what can we measure" but "what will someone do differently after looking at this?"
2. **Who opens this dashboard?** — exec, PM, eng, ops. Different audiences need different views.
3. **How often?** — Daily standup, weekly review, monthly board? Drives refresh cadence.
4. **For each proposed metric: what happens if it doubles? What if it halves?** — If the answer is "interesting", cut the metric. If the answer is a specific action, keep it.
Apply the "so what?" test ruthlessly. Cut every metric that doesn't pass. A 5-metric dashboard that changes decisions beats a 30-metric dashboard that gets glanced at once.
### Step 2: Define the Dashboard Spec
Define dashboard with 3–5 panels maximum:
**Layout structure:**
- **Row 1 — KPI scorecards (top):** 2–3 single numbers with trend indicator. Answer: "Are we OK right now?"
- **Row 2 — Trend charts:** 1–2 line charts showing change over time. Answer: "Where are we going?"
- **Row 3 — Detail table (optional):** Drill-down for investigation. Answer: "Why is this happening?"
**For each panel, define:**
| Field | What to specify |
| --------------------- | ---------------------------------------------------------------------------- |
| **Title** | A question, not a noun. "How many users activated this week?" |
| **Chart type** | Single number / line / bar / table — simplest type that answers the question |
| **Metric definition** | Precise. What counts, what doesn't, what time window |
| **SQL query** | The actual query against the detected schema |
| **Comparison** | vs last period, vs target, vs 30-day average |
| **"Good" threshold** | What value means things are working |
| **"Bad" threshold** | What value means someone should investigate |
| **Data source** | Which table(s), how fresh the data is |
| **Refresh cadence** | Hourly / daily / weekly — match to decision frequency |
**Chart type rules:**
- Single number + trend arrow — KPIs, top-line metrics
- Line chart — time series, trends over weeks/months
- Bar chart — comparisons across segments, cohorts, channels
- Table — detail drill-down, top N lists
- Avoid: pie charts for more than 3 categories, dual-axis charts, 3D anything
### Design Intelligence (via uiux)
When selecting chart types for each panel (Step 2), query the chart database:
```bash
python3 -m lens_agent.uiux search --domain chart --query "{data_type}" --limit 3
```
Use results to:
- Select optimal chart type based on data characteristics and volume threshold
- Check accessibility grade — prefer AA or higher for public dashboards
- Apply the recommended library (Chart.js, Recharts, D3, etc.) matching the detected stack
- Use the dashboard style search for overall visual treatment
### Step 3: Write the SQL Queries
Write production-quality SQL for each panel. Include:
- Business logic comments explaining what and why
- CTE structure for readability (not nested subqueries)
- Window functions for period-over-period comparisons
- Parameterized date ranges where appropriate
Example — weekly active users with comparison:
```sql
-- Weekly Active Users
-- Definition: distinct users who performed at least one core action
-- (create, edit, share) in the last 7 days
-- "Core action" excludes logins and passive views
WITH current_period AS (
SELECT COUNT(DISTINCT user_id) AS value
FROM events
WHERE event_type IN ('create', 'edit', 'share')
AND created_at >= NOW() - INTERVAL '7 days'
),
prior_period AS (
SELECT COUNT(DISTINCT user_id) AS value
FROM events
WHERE event_type IN ('create', 'edit', 'share')
AND created_at >= NOW() - INTERVAL '14 days'
AND created_at < NOW() - INTERVAL '7 days'
)
SELECT
c.value AS current_wau,
p.value AS prior_wau,
c.value - p.value AS change,
ROUND(
(c.value - p.value)::numeric / NULLIF(p.value, 0) * 100,
1) AS pct_change
FROM current_period c, prior_period p;
```
Example — activation funnel:
```sql
-- Activation Funnel
-- Steps: signed_up → completed_onboarding → created_first_project → invited_teammate
-- Window: users who signed up in the last 30 days
WITH cohort AS (
SELECT user_id, MIN(created_at) AS signed_up_at
FROM users
WHERE created_at >= NOW() - INTERVAL '30 days'
GROUP BY 1
),
steps AS (
SELECT
c.user_id,
c.signed_up_at,
MAX(CASE WHEN e.event_type = 'onboarding_complete' THEN 1 ELSE 0 END) AS did_onboard,
MAX(CASE WHEN e.event_type = 'project_created' THEN 1 ELSE 0 END) AS did_create,
MAX(CASE WHEN e.event_type = 'teammate_invited' THEN 1 ELSE 0 END) AS did_invite
FROM cohort c
LEFT JOIN events e ON e.user_id = c.user_id
AND e.created_at >= c.signed_up_at
GROUP BY 1, 2
)
SELECT
COUNT(*) AS signed_up,
SUM(did_onboard) AS completed_onboarding,
SUM(did_create) AS created_project,
SUM(did_invite) AS invited_teammate,
ROUND(AVG(did_onboard) * 100, 1) AS onboard_rate_pct,
ROUND(AVG(did_create) * 100, 1) AS create_rate_pct,
ROUND(AVG(did_invite) * 100, 1) AS invite_rate_pct
FROM steps;
```
### Step 4: Choose Implementation Target
Match to detected stack:
- **Metabase** — write SQL for each Question card; describe layout and collection structure
- **Grafana** — write panel JSON or provisioning YAML; include dashboard UID
- **Streamlit** — build Python app with Plotly charts; include `st.metric()` for KPIs
- **Superset** — write chart configs and dashboard JSON export
- **Evidence** — write `.md` report files with embedded SQL blocks
- **HTML + Chart.js** — standalone file for simple cases with no BI tool
- **SQL views only** — create materialized views any BI tool can query; tool choice deferred
For each implementation, write actual files — not instructions for the human to write them.
### Step 5: Deliver the Dashboard Spec
Output complete spec. Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.
```
┌─ Dashboard: [Name] ────────────────────────────────────┐
│ Audience: [who] Refresh: [cadence] Tool: [BI] │
│ Decision: [what decision this dashboard supports] │
└────────────────────────────────────────────────────────┘
PANELS (5 max)
──────────────────────────────────────────────────────────
1. [Question title]
Type: [chart type] | Source: [table] | Refresh: [cadence]
Metric: [precise definition]
Good: [threshold] | Bad: [threshold] | Compare: vs [period]
2. [Question title]
...
FILES CREATED
[path to SQL queries]
[path to dashboard config / implementation]
NEXT STEPS
[ ] Connect to [data source] at [connection string / env var]
[ ] Set refresh schedule: [cron or BI tool setting]
[ ] Share with [audience] — confirm the "so what?" lands
[ ] Iterate: kill any chart nobody acts on after 2 weeks
```
## Delivery
If output exceeds the 40-line CLI budget, invoke `/atlas-report` with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.
当前收录版本
0.6.4
质量评测
满分 100。前四项来自 DeepSkill 收录的质量报告。
评分依据
高价值/高频刚需,直接解决用户明确的核心任务痛点——构建分析仪表盘
评分依据
触发词精准完整,覆盖多种变体如'build a dashboard', 'analytics dashboard', 'BI dashboard'等
评分依据
Phase/步骤清晰,有出口条件,含端到端示例
评分依据
工具来源明确,参数正确,覆盖主要异常
计算方式
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
risk · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。