Chart Generator Skill
Use this skill to generate downloadable SVG chart artifacts from structured data. Supported chart types are radar, bar, line, pie, doughnut, scatter, and score_distribution; the structure is designed so future chart types can be added with a reference document and builtin renderer.
Supported Chart Types
radar: radar/spider charts for multi-dimensional score profiles and personal-vs-average comparisons.
bar: bar/column charts for category comparison, grouped comparison, and score comparison.
line: line charts for trends, ordered stages, time series, and score changes.
pie: pie charts for proportions, composition, and share-of-whole views.
doughnut: doughnut/ring charts for proportions with a visible center total.
scatter: scatter plots for two-variable relationships such as rank vs score.
score_distribution: score band distribution charts from raw scores or precomputed band counts.
Workflow
- Determine whether the user explicitly requested a
chart_type: radar, bar, line, pie, doughnut, scatter, or score_distribution.
- If the request is casual, vague, incomplete, or not already structured for a chart or visualization tool, first use
prompt-professionalizer to produce an optimized data visualization prompt and chart requirements.
- If the user only says a generic request such as "generate a chart", "make a graph", "生成图表", "做个图", or "可视化", call
request_user_input before calling generate_chart.
- Read exactly one reference document for that chart type before calling
generate_chart.
- Convert the user's data into the JSON payload documented in the selected reference.
- Validate that all required data is present and internally consistent.
- Call
call_skill_tool with tool_name set to generate_chart.
- If the user explicitly asks to save, create, add, upload, or import the chart into File Management or the current Files page, first generate the temporary chart artifact here, then call
file-manager/save_file_to_management with the returned tool_file_id/file_id and destination filename.
- In the final answer, briefly mention the generated chart filename and any assumptions. Do not paste SVG source unless the user explicitly asks for it.
Clarification Workflow
When any required decision is missing or ambiguous, call request_user_input instead of writing a plain clarification message. This ensures the UI renders the clarification as a structured confirmation card with optional quick replies.
Generic chart requests are incomplete even when the data can be parsed. Do not infer bar just because the data is ranking or category scores, do not infer line just because the data is ordered, do not infer pie or doughnut just because values can be totaled, do not infer scatter just because values have order, and do not infer radar just because the data contains multiple values. If the user did not explicitly name the chart type, ask.
For generic chart requests, chart type, chart title, and rendering style are required decisions. Ask for them before reading a chart reference or calling generate_chart.
Use a brief message explaining what needs confirmation, then provide 1-4 focused questions. Include options only when each option is a concrete answer that can be used directly. Omit options for open-ended questions such as the chart title, because the user can type freely.
After calling request_user_input, stop the turn and wait for the user's answer. Do not call generate_chart in the same turn.
Ask about:
- Chart type when the user did not explicitly request
radar, bar, line, pie, doughnut, scatter, or score_distribution.
- Chart title when the user did not provide a title.
- Data mapping when labels, x-axis/category names, dimensions, series names, or values are unclear.
- Rendering style when the user asks for a specific look or the use case implies a choice. Supported styles:
simple, business, teaching, comparison.
- Whether to show values, legend, or grid lines when the user explicitly cares about readability or presentation.
- Score bands when the user requests
score_distribution but did not specify the band rules.
Example generic request that must trigger request_user_input:
1张三98 2孙八98 3李四88 4吴十82 5钱七80 6周九78 7王五74 8赵六67 生成图表
Do not answer "I will use a bar chart" for this kind of request. Ask the user to confirm chart type, title, and style first.
Example request_user_input payload:
{
"message": "I can generate the chart, but need to confirm a few details first.",
"questions": [
{
"id": "chart_type",
"question": "Which chart type should I generate: bar, line, radar, pie, doughnut, scatter, or score_distribution?"
},
{
"id": "title",
"question": "What chart title should be shown?"
},
{
"id": "style",
"question": "Which rendering style should I use?",
"options": [
{ "label": "simple" },
{ "label": "business" },
{ "label": "teaching" },
{ "label": "comparison" }
]
},
{
"id": "show_values",
"question": "Should values be displayed on the chart?",
"options": [
{ "label": "show values" },
{ "label": "hide values" }
]
}
]
}
References
Read exactly one reference after choosing the chart type:
| Requested chart |
Read reference |
radar, spider, score profile, subject ability chart, personal-vs-average comparison |
chart-radar.md |
bar, column, category comparison, grouped comparison |
chart-bar.md |
line, trend, time series, score change, progress over attempts |
chart-line.md |
pie, proportion, composition, share of whole |
chart-pie.md |
doughnut, donut, ring chart, share of whole with center total |
chart-doughnut.md |
scatter, scatter plot, two-variable relationship |
chart-scatter.md |
score_distribution, score band distribution, grade range count |
chart-score-distribution.md |
If the user requests a chart type that is not listed, say it is not supported yet and offer to structure the data for a future chart type.
Unified Payload
generate_chart accepts:
chart_type: required. Supported values: radar, bar, line, pie, doughnut, scatter, score_distribution.
title: optional chart title.
output_filename: optional ASCII filename without extension. Defaults to chart.
data: required chart-specific data object.
options: optional rendering options. Common keys: width, height, style, show_values, legend, grid.
- For scatter charts,
options.show_labels controls point labels.
lifecycle: optional file lifecycle, persistent or temporary. Defaults to persistent.
Constraints
- Before calling
generate_chart, use prompt-professionalizer when the user's request is casual, vague, incomplete, or not already structured for chart generation. Direct tool calls are allowed only when the chart type, data mapping, title or purpose, and key rendering requirements are already complete.
- Do not call
generate_chart until the selected chart reference has been read.
- Do not read a chart reference until the chart type has been explicitly provided by the user or confirmed through
request_user_input.
- Generate SVG artifacts only. Do not promise PNG, PDF, or interactive charts.
- Do not invent scores, labels, dimensions, class averages, or comparison data.
- Do not silently choose a chart type, title, or style for a generic chart request.
- Do not use unsupported chart types silently. Unsupported chart types must be reported as unsupported.
- Keep filenames short, ASCII, and free of path separators.
- If the user's data is ambiguous, ask for clarification or state the assumptions before generating a chart.
1---2name: chart-generator3description: Generate downloadable SVG charts from structured data, including radar, bar, line, pie, doughnut, scatter, and score distribution charts.4---56# Chart Generator Skill78Use this skill to generate downloadable SVG chart artifacts from structured data. Supported chart types are `radar`, `bar`, `line`, `pie`, `doughnut`, `scatter`, and `score_distribution`; the structure is designed so future chart types can be added with a reference document and builtin renderer.910## Supported Chart Types1112- `radar`: radar/spider charts for multi-dimensional score profiles and personal-vs-average comparisons.13- `bar`: bar/column charts for category comparison, grouped comparison, and score comparison.14- `line`: line charts for trends, ordered stages, time series, and score changes.15- `pie`: pie charts for proportions, composition, and share-of-whole views.16- `doughnut`: doughnut/ring charts for proportions with a visible center total.17- `scatter`: scatter plots for two-variable relationships such as rank vs score.18- `score_distribution`: score band distribution charts from raw scores or precomputed band counts.1920## Workflow21221. Determine whether the user explicitly requested a `chart_type`: `radar`, `bar`, `line`, `pie`, `doughnut`, `scatter`, or `score_distribution`.232. If the request is casual, vague, incomplete, or not already structured for a chart or visualization tool, first use `prompt-professionalizer` to produce an optimized data visualization prompt and chart requirements.243. If the user only says a generic request such as "generate a chart", "make a graph", "生成图表", "做个图", or "可视化", call `request_user_input` before calling `generate_chart`.254. Read exactly one reference document for that chart type before calling `generate_chart`.265. Convert the user's data into the JSON payload documented in the selected reference.276. Validate that all required data is present and internally consistent.287. Call `call_skill_tool` with `tool_name` set to `generate_chart`.298. If the user explicitly asks to save, create, add, upload, or import the chart into File Management or the current Files page, first generate the temporary chart artifact here, then call `file-manager/save_file_to_management` with the returned `tool_file_id`/`file_id` and destination filename.309. In the final answer, briefly mention the generated chart filename and any assumptions. Do not paste SVG source unless the user explicitly asks for it.3132## Clarification Workflow3334When any required decision is missing or ambiguous, call `request_user_input` instead of writing a plain clarification message. This ensures the UI renders the clarification as a structured confirmation card with optional quick replies.3536Generic chart requests are incomplete even when the data can be parsed. Do not infer `bar` just because the data is ranking or category scores, do not infer `line` just because the data is ordered, do not infer `pie` or `doughnut` just because values can be totaled, do not infer `scatter` just because values have order, and do not infer `radar` just because the data contains multiple values. If the user did not explicitly name the chart type, ask.3738For generic chart requests, chart type, chart title, and rendering style are required decisions. Ask for them before reading a chart reference or calling `generate_chart`.3940Use a brief `message` explaining what needs confirmation, then provide 1-4 focused `questions`. Include `options` only when each option is a concrete answer that can be used directly. Omit options for open-ended questions such as the chart title, because the user can type freely.4142After calling `request_user_input`, stop the turn and wait for the user's answer. Do not call `generate_chart` in the same turn.4344Ask about:4546- Chart type when the user did not explicitly request `radar`, `bar`, `line`, `pie`, `doughnut`, `scatter`, or `score_distribution`.47- Chart title when the user did not provide a title.48- Data mapping when labels, x-axis/category names, dimensions, series names, or values are unclear.49- Rendering style when the user asks for a specific look or the use case implies a choice. Supported styles: `simple`, `business`, `teaching`, `comparison`.50- Whether to show values, legend, or grid lines when the user explicitly cares about readability or presentation.51- Score bands when the user requests `score_distribution` but did not specify the band rules.5253Example generic request that must trigger `request_user_input`:5455```text561张三98 2孙八98 3李四88 4吴十82 5钱七80 6周九78 7王五74 8赵六67 生成图表57```5859Do not answer "I will use a bar chart" for this kind of request. Ask the user to confirm chart type, title, and style first.6061Example `request_user_input` payload:6263```json64{65 "message": "I can generate the chart, but need to confirm a few details first.",66 "questions": [67 {68 "id": "chart_type",69 "question": "Which chart type should I generate: bar, line, radar, pie, doughnut, scatter, or score_distribution?"70 },71 {72 "id": "title",73 "question": "What chart title should be shown?"74 },75 {76 "id": "style",77 "question": "Which rendering style should I use?",78 "options": [79 { "label": "simple" },80 { "label": "business" },81 { "label": "teaching" },82 { "label": "comparison" }83 ]84 },85 {86 "id": "show_values",87 "question": "Should values be displayed on the chart?",88 "options": [89 { "label": "show values" },90 { "label": "hide values" }91 ]92 }93 ]94}95```9697## References9899Read exactly one reference after choosing the chart type:100101| Requested chart | Read reference |102| --- | --- |103| `radar`, `spider`, score profile, subject ability chart, personal-vs-average comparison | `chart-radar.md` |104| `bar`, `column`, category comparison, grouped comparison | `chart-bar.md` |105| `line`, trend, time series, score change, progress over attempts | `chart-line.md` |106| `pie`, proportion, composition, share of whole | `chart-pie.md` |107| `doughnut`, `donut`, ring chart, share of whole with center total | `chart-doughnut.md` |108| `scatter`, scatter plot, two-variable relationship | `chart-scatter.md` |109| `score_distribution`, score band distribution, grade range count | `chart-score-distribution.md` |110111If the user requests a chart type that is not listed, say it is not supported yet and offer to structure the data for a future chart type.112113## Unified Payload114115`generate_chart` accepts:116117- `chart_type`: required. Supported values: `radar`, `bar`, `line`, `pie`, `doughnut`, `scatter`, `score_distribution`.118- `title`: optional chart title.119- `output_filename`: optional ASCII filename without extension. Defaults to `chart`.120- `data`: required chart-specific data object.121- `options`: optional rendering options. Common keys: `width`, `height`, `style`, `show_values`, `legend`, `grid`.122- For scatter charts, `options.show_labels` controls point labels.123- `lifecycle`: optional file lifecycle, `persistent` or `temporary`. Defaults to `persistent`.124125## Constraints126127- Before calling `generate_chart`, use `prompt-professionalizer` when the user's request is casual, vague, incomplete, or not already structured for chart generation. Direct tool calls are allowed only when the chart type, data mapping, title or purpose, and key rendering requirements are already complete.128- Do not call `generate_chart` until the selected chart reference has been read.129- Do not read a chart reference until the chart type has been explicitly provided by the user or confirmed through `request_user_input`.130- Generate SVG artifacts only. Do not promise PNG, PDF, or interactive charts.131- Do not invent scores, labels, dimensions, class averages, or comparison data.132- Do not silently choose a chart type, title, or style for a generic chart request.133- Do not use unsupported chart types silently. Unsupported chart types must be reported as unsupported.134- Keep filenames short, ASCII, and free of path separators.135- If the user's data is ambiguous, ask for clarification or state the assumptions before generating a chart.