com um clique
visualization
// Rules for charts and visualization. Use when the user asks for charts, graphs, plots, or visual representations (line, bar, pie, timeseries).
// Rules for charts and visualization. Use when the user asks for charts, graphs, plots, or visual representations (line, bar, pie, timeseries).
Optimize slow queries, analyze SQL performance, and collect evidence for expensive workloads.
Diagnose ClickHouse cluster health and provide concrete remediation.
Diagnose ClickHouse runtime query failures when the user wants database-level cause and fix guidance from an error or numeric error code, not source-code root cause analysis.
Investigate application or repository source code with search_file and read_file to explain behavior, trace root causes of runtime or query errors, and answer with precise file citations.
Query ClickHouse system tables to inspect query logs, monitor cluster health, check replication status, and analyze slow queries. Use when the user mentions "system tables", "query_log", "ClickHouse monitoring", "cluster status", "slow queries", or asks to diagnose ClickHouse operational issues.
Expert system for generating, validating, and optimizing ClickHouse SQL. Use this when the user needs data, queries, or analysis.
| name | visualization |
| description | Rules for charts and visualization. Use when the user asks for charts, graphs, plots, or visual representations (line, bar, pie, timeseries). |
| metadata | {"author":"System","disable-slash-command":true} |
a) Generate or obtain SQL:
sql-expert skill.sql-expert skill is loaded.
skill tool with ['sql-expert'] IMMEDIATELY. Do not proceed to generate SQL until the skill is loaded.sql-expert skill (including Schema Discovery, Schema Fidelity, ProfileEvents handling, and Performance Optimization).system.query_log visualization requests: Do NOT call search_query_log. Load the clickhouse-system-queries skill, then load references/system-query-log.md via skill_resource, generate the SQL, and validate it.b) VALIDATION (MANDATORY):
validate_sql with the SQL before including the chart spec in your response.sql-expert skill rules) and validating again.c) After validation passes:
chart-spec. The content must be valid JSON matching the OUTPUT FORMAT below, and must include datasource: { "sql": "<the validated SQL>" }. Derive type, titleOption, legendOption, etc. from the CHART TYPE RULES and OUTPUT FORMAT above. Do not call any tool for this—put the complete spec in your reply.d) Execution:
execute_sql. The chart component in the client will automatically execute the query found in the chart-spec. Calling it here wastes tokens and causes duplicate execution.If user question contains ANY of these keywords, use the corresponding chart type:
chart-spec code block)Put the full chart spec in a markdown code block with language chart-spec. The JSON must include datasource.sql (the validated SQL). The client parses this block to render the chart.
{
"type": "line",
"titleOption": { "title": "Descriptive chart title", "align": "center" },
"width": 6,
"legendOption": { "placement": "bottom", "values": ["min", "max", "sum"] },
"datasource": { "sql": "SELECT ..." }
}
{
"type": "pie",
"titleOption": { "title": "Distribution by Category", "align": "center" },
"width": 6,
"legendOption": { "placement": "right" },
"labelOption": { "show": true, "format": "name-percent" },
"valueFormat": "short_number",
"datasource": { "sql": "SELECT ..." }
}
sql-expert skill.sql-expert Skill → Validation → Include chart spec in response.