← 返回 Skills 市场
wangjipeng977

Sql To Dashboard

作者 王继鹏 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
159
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install sql-to-dashboard
功能描述
Use when (1) user provides a SQL query and asks to generate a chart, dashboard, or data visualization from the results. (2) user says "show this as a graph",...
使用说明 (SKILL.md)

SQL to Dashboard

Use when (1) user provides a SQL query and asks to generate a chart, dashboard, or data visualization from the results. (2) user says "show this as a graph", "make a dashboard from this query", "visualize the results", or "plot this data". (3) user has a query result and wants a visual summary rather than raw rows.

Core Position

This skill solves the specific problem of: SQL query results are rows and columns — a visual chart makes trends, comparisons, and anomalies immediately visible.

This skill IS NOT:

  • A SQL writing or debugging tool — it works with queries the user provides
  • A database management tool — it does not modify schema or data
  • A BI platform guide — it generates chart specs, not platform-specific dashboards

This skill IS activated ONLY when: SQL query or result set + visualization/dashboard intent are both present.

Modes

/sql-to-dashboard

Default mode. Takes a SQL query or result set and outputs a chart specification.

When to use: User provides SQL and wants to see the data as a chart.

/sql-to-dashboard/multi

Combines multiple queries into a single dashboard with multiple panels.

When to use: User has several related metrics they want on one screen.

Execution Steps

Step 1 — Analyze the Query Result

  1. Receive SQL query (pasted text or query result as CSV/table)
  2. If only query provided, analyze it to infer result structure:
    • SELECT columns → X-axis candidates (time, category) or Y-axis (numeric values)
    • GROUP BY → X-axis or legend groupings
    • ORDER BY with LIMIT → top-N pattern, suggest horizontal bar chart
    • COUNT, SUM, AVG aggregates → Y-axis values
    • Date/time columns → time series → line chart
    • String/category columns → bar chart or pie chart
  3. Identify column types:
    • Numeric (int, float) → value axis
    • Date/datetime → time axis or category axis
    • String/category → label axis, legend, or grouping

Step 2 — Suggest Chart Type

Query Pattern Chart Type Reason
Time series (GROUP BY date) Line chart Shows trend over time
Top-N with COUNT/SUM Horizontal bar Easy to compare magnitudes
Pie/sum by category Pie or donut Shows proportion
Two numeric columns Scatter plot Shows correlation
Multiple aggregates Grouped bar Compares categories across groups
Cumulative sum Area chart Shows accumulation
Yes/No count Donut chart Binary proportion

Step 3 — Generate Dashboard Spec

Output a specification in a format appropriate to context:

Plotly JSON spec:

{
  "data": [{
    "x": ["Jan","Feb","Mar"],
    "y": [120, 80, 150],
    "type": "scatter",
    "mode": "lines+markers",
    "name": "Revenue"
  }],
  "layout": {
    "title": "Monthly Revenue",
    "xaxis": {"title": "Month"},
    "yaxis": {"title": "Revenue ($)"}
  }
}

Grafana panel JSON:

{
  "title": "Monthly Revenue",
  "targets": [{"expr": "sum(revenue)"}],
  "fieldConfig": {"defaults": {"unit": "currencyUSD"}}
}

Mermaid (for simple data):

xychart-beta
  title "Monthly Revenue"
  x-axis [Jan, Feb, Mar]
  y-axis "Revenue ($)" 0 --> 200
  line [120, 80, 150]

Step 4 — Validate

  • Column mapping to axes is correct
  • Chart type matches the query's data shape
  • Axes are labeled with column names or derived names
  • No data values are invented or truncated

Mandatory Rules

Do not

  • Do not change the query — work with exactly what the user provides
  • Do not invent data points not in the result set
  • Do not use pie charts for >7 categories
  • Do not render a line chart for non-time-series data

Do

  • Preserve exact column names as axis labels
  • State which column is mapped to which axis
  • Suggest a chart type appropriate for the data shape, even if user suggested a different one
  • If the result set is empty, report "No data returned" rather than rendering an empty chart

Quality Bar

A good output:

  • Chart type matches query result shape
  • Axes are correctly mapped to the query's columns
  • Labels and titles are derived from column names (not generic)
  • Spec is valid and renderable in the target tool (Plotly, Grafana, etc.)

A bad output:

  • Line chart for non-sequential categories
  • Pie chart with 20 slices
  • X-axis shows numeric values as categories (should be scatter or bar)
  • Empty chart when query returns no data (should explicitly say "no data")

Good vs. Bad Examples

Scenario Bad Output Good Output
SELECT date, COUNT(*) grouped by month Bar chart Line chart (time series = trend)
SELECT status, COUNT(*) 3 statuses 3D pie chart Donut chart with legend
Empty result set Empty chart rendered "Query returned 0 rows — no chart to display"
Very large result (10k rows) Renders all 10k points Aggregates or samples — states "showing top 100"

References

  • references/ — Chart type decision tree, Plotly/Grafana/Redash spec templates, dashboard best practices
安全使用建议
This result is incomplete because the artifact files were not readable during the scan. Re-run the review in an environment where metadata.json and artifact/ can be inspected before treating the skill as approved.
能力评估
Purpose & Capability
Unable to read metadata.json or artifact contents because every filesystem command failed before execution with a sandbox setup error.
Instruction Scope
Instruction scope could not be evaluated from artifacts; no evidence-backed unsafe instruction was available to report.
Install Mechanism
Install mechanism could not be evaluated from artifacts; no evidence-backed unsafe install behavior was available to report.
Credentials
Environment access could not be evaluated from artifacts; no evidence-backed overbroad access was available to report.
Persistence & Privilege
Persistence or privilege behavior could not be evaluated from artifacts; no evidence-backed concern was available to report.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install sql-to-dashboard
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /sql-to-dashboard 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Update README with real Features and 功能特性 content
v1.0.0
Initial release
元数据
Slug sql-to-dashboard
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Sql To Dashboard 是什么?

Use when (1) user provides a SQL query and asks to generate a chart, dashboard, or data visualization from the results. (2) user says "show this as a graph",... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 159 次。

如何安装 Sql To Dashboard?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install sql-to-dashboard」即可一键安装,无需额外配置。

Sql To Dashboard 是免费的吗?

是的,Sql To Dashboard 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Sql To Dashboard 支持哪些平台?

Sql To Dashboard 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Sql To Dashboard?

由 王继鹏(@wangjipeng977)开发并维护,当前版本 v1.0.1。

💬 留言讨论