AGENT SKILL

chart-renderer

创建适用于图表渲染插件的 Chart.js 图表。当用户要求把数据做成图表、可视化趋势、比较分类或展示占比时使用。

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 299
Forks
50

01 前言 Front Matter

name
chart-renderer
description
创建适用于图表渲染插件的 Chart.js 图表。当用户要求把数据做成图表、可视化趋势、比较分类或展示占比时使用。

03 SKILL.md 正文

Chart.js 图表渲染

目标

把用户提供的数据整理成一次 render_chart 工具调用,让图表出现在当前 MessageList 消息下方。不要只输出 Markdown 表格来替代图表。

工具参数

必须传:

  • type: line、bar、pie、doughnut、polarArea、radar、scatter 或 bubble
  • data: 标准 Chart.js data 对象

可选传:

  • options: 标准 Chart.js options 对象
  • title: 简短中文标题
  • description: 一句话说明统计口径或时间范围
  • height: 180 到 560 之间的数字,默认 300
  • charts: 可选的图表数组,最多 4 个;使用 charts 时每一项都必须包含自己的 type 和 data

优先使用一次 render_chart 调用中的 charts 数组生成多图表。单图表也可以继续直接传 type 和 data,以兼容旧调用。

如果用户同一轮需要多个图表,必须尽量合并到一次工具调用中,不要连续调用多次 render_chart。最多 4 个图表,超过 4 个时按用户最重要的指标合并或分批,并先说明限制。

布局规则

  • 每个图表都占满整行宽度,单列自上而下排列,顺序即传入顺序
  • 不要为了排版重复图表
  • 多个指标需要分别展示时,使用一个 charts 数组调用,不要连续调用工具

数据格式

分类图表使用:

{
  "labels": ["一月", "二月", "三月"],
  "datasets": [
    {
      "label": "销售额",
      "data": [120, 180, 240],
      "backgroundColor": "#2563eb",
      "borderColor": "#2563eb"
    }
  ]
}

折线图和柱状图可以有多个 datasets。饼图和环形图通常使用一个 dataset:

{
  "labels": ["华东", "华南", "华北"],
  "datasets": [{
    "label": "订单占比",
    "data": [45, 30, 25],
    "backgroundColor": ["#2563eb", "#16a34a", "#f59e0b"]
  }]
}

选择图表类型

  • 时间趋势:line
  • 分类对比:bar
  • 构成占比:doughnut 或 pie
  • 多维指标:radar
  • 两个数值变量关系:scatter
  • 三个数值变量关系:bubble

约束

  1. 只传 JSON 可序列化值,不传函数、Date、undefined、DOM 节点或自定义类实例。
  2. charts 数量必须在 1 到 4 之间;每个图表都必须有合法的 type 和 data。
  3. labels 和 datasets[].data 的长度应一致;不要混用中文标签和缺失数据。
  4. 数值缺失时使用 null,不要使用 NaN 或字符串数字。
  5. 工具调用失败时,读取返回的 error 和 retryable 字段,立即修正参数并重试一次;不要结束当前任务。
  6. 多图表需求只调用一次工具,使用 charts 数组,不要为每个图表分别调用工具。
  7. 如果用户没有提供足够数据,先说明缺少哪些字段,不要编造数值。

04 同仓库更多 Skills

openvetta
openvetta/open-vetta

publish-ability

Publish a skill, MCP server, plugin, or bundle to the Vetta ability marketplace. Use when the user asks to upload/publish/submit an ability, put a plugin on the marketplace, share a skill with other users, or migrate an existing package into Vetta.

★ 299
openvetta
openvetta/open-vetta

install-ability

在本机 Vetta 中安装能力——插件(plugin)、Skill 与 MCP 服务器。用户说「装一个插件 / install plugin / 从能力市场安装 / 加一个 MCP server / 配置 MCP / 装个 skill」,或插件装完没生效、需要 reload、pending 版本没应用时使用。不用于安装 npm 依赖、IDE 插件、浏览器扩展,也不用于开发插件(那是 plugin-workbench)或创作 Skill(那是 create-skill)。

★ 299
openvetta
openvetta/open-vetta

create-skill

Create or update Vetta-compatible Agent Skills. Use when the user asks to create a skill, add a SKILL.md workflow, register a skill in skills-manifest.json, package a skill in a Vetta plugin, or add a built-in Vetta skill preset.

★ 299
openvetta
openvetta/open-vetta

vetta-ui-design

Build and edit design documents (.vetd) on the Vetta design canvas — app screens, landing pages, slides, posters, infographics. Use when the user asks for a UI design, mockup, screen, deck, or poster, or attaches a design frame/element from the canvas. Frames are real React (TSX) routes, not pictures. Do NOT use for ordinary front-end work in the user's own codebase — building, styling or reworking pages of a real app is that repo's job, and none of the vetd_* tools or canvas rules here apply to it.

★ 299
openvetta
openvetta/open-vetta

remotion-video

Create, modify, and render Remotion React video projects in the current Vetta conversation workspace. Use for requests to make programmatic videos, motion graphics, animated explainers, social videos, data videos, or to edit an existing Remotion composition and export it as MP4.

★ 299
openvetta
openvetta/open-vetta

plugin-workbench

Create, implement, build, pack, install, reload, and manage Vetta desktop plugins for non-developers. Use whenever the user wants a Vetta plugin, plugin scaffolding, apply a `.vettapkg` package to Vetta, edit plugin.json name/guidingWords, or debug plugin load/install. Requires the Plugin Workbench input-bar toggle (hard isolation). The plugin handbook ships inside the project's own @vetta-org/plugin-sdk; locate it with the bundled CLI's docs command.

★ 299