← 返回 Skills 市场
local-api-chart-generator
作者
z904832819
· GitHub ↗
· v1.0.3
· MIT-0
122
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install local-api-chart-generator
功能描述
专为调用本地数据接口并生成图表展示定制的 Skill。接收自然语言指令(如“我要最近一年燃油类型为天然气的扭矩占比”),自动提取参数,请求本地接口,生成 HTML 柱状图并返回完整的 HTML 源码。
使用说明 (SKILL.md)
本地接口数据图表生成器 (Local API Chart Generator)
重要:这是一个专为 API 调用设计的技能,必须严格遵守以下执行流程。
🔄 强制执行流程 (Strict Workflow)
第一步:提取参数
从用户指令中提取:
- 燃油类型(必传):如
柴油,天然气 - 时间范围(必传):转换为
['开始日期', '结束日期']格式 - 马力(选传):如
90 - 排放(选传):如
国六 - 排量(选传):如
7
第二步:执行 Python 脚本
执行命令:
python3 /Users/laixufei/PycharmProjects/skills/local-api-chart-generator/build_chart.py --fueltype1 "燃油类型" --time '["开始日期", "结束日期"]'
如需带选传参数,可使用:
python3 /Users/laixufei/PycharmProjects/skills/local-api-chart-generator/build_chart.py --fueltype1 "燃油类型" --time '["开始日期", "结束日期"]' --horsepower "马力" --emission "排放" --displacement "排量"
第三步:提取并原样返回 HTML(关键!)
严格约束:
- 从 Python 输出中提取
---HTML_CODE_START---和---HTML_CODE_END---之间的内容。 - 直接将这段 HTML 源码原封不动地放在回复的最前面,不要添加任何额外的解释文字。
- 禁止使用
[embed]、MEDIA:或任何其他 OpenClaw 内部渲染语法。 - 禁止对数据进行额外分析或总结,只需返回 HTML 源码即可。
⚠️ API 调用模式
当通过 /v1/chat/completions API 调用时,回复格式必须为:
\x3C!DOCTYPE html>
\x3Chtml lang="zh-CN">
...完整 HTML 源码...
\x3C/html>
这样调用方可以直接从 choices[0].message.content 中获取 HTML 并在前端渲染。
安全使用建议
Before installing or enabling this skill:
- Understand it will execute a Python script that posts to http://127.0.0.1:9080 and returns whatever data the local API provides embedded in HTML. That can leak sensitive local data to whoever calls the skill.
- The SKILL.md points at a hardcoded user path (/Users/laixufei/...) which likely won't exist; confirm how the agent will execute the included build_chart.py (adjust SKILL.md to a relative path if needed).
- The code contains a hardcoded Bearer token. Treat that as a secret: ask the author to remove it and use a declared environment variable instead, or rotate the token and restrict its scope/permissions. Hardcoded credentials are a red flag.
- The script sets requests.Session.trust_env = False, which avoids proxy interception — combined with the static token this looks intentional; verify the intended local API and trust boundaries.
- Test the skill in a controlled environment (isolated VM/container) and review the exact data returned by the local API before enabling it for sensitive data or granting broad agent access.
- If you cannot verify the origin or purpose of the embedded token and the author, treat the skill as untrusted and avoid running it against production/local services.
功能分析
Type: OpenClaw Skill
Name: local-api-chart-generator
Version: 1.0.3
The skill contains hardcoded sensitive information, specifically a Bearer JWT token used for authentication in `build_chart.py`, and hardcoded absolute file paths (`/Users/laixufei/...`) in `SKILL.md`. While the code appears to perform its stated function of querying a local API (127.0.0.1:9080) for data visualization, the inclusion of specific user credentials and environment-specific paths is a significant security risk and highly irregular for a portable skill bundle.
能力评估
Purpose & Capability
The code and SKILL.md align with the stated purpose (fetch local API data and generate an HTML ECharts bar chart). However the SKILL.md instructs executing a python file at a hardcoded absolute path (/Users/laixufei/...), while the skill bundle actually contains build_chart.py — this path mismatch is inconsistent and suggests sloppy packaging or an expectation that the runtime has a specific user environment.
Instruction Scope
The SKILL.md forces running the Python script and returning the raw HTML between exact markers with no extra text. The script makes HTTP POST requests to localhost (127.0.0.1:9080) and will include whatever local data the API returns directly in the HTML reply; the strict 'return raw HTML' rule increases the risk of unintentionally exfiltrating sensitive local data to callers. The SKILL.md does not warn about the included static authorization token or side effects of the API calls.
Install Mechanism
Instruction-only skill with included code file; there is no install spec or external download. No third-party install mechanism or remote executable fetch was found.
Credentials
The skill declares no required environment variables, yet the Python code embeds a static Bearer token in Authorization headers and forces session.trust_env = False. Embedding a credential in code is disproportionate and unexpected; ignoring environment proxy settings further forces direct localhost access. These are security and maintainability concerns.
Persistence & Privilege
The skill does not request persistent or elevated platform privileges (always:false, no config paths, no modifications to other skills). Autonomous invocation is allowed (default) but that alone is not flagged.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install local-api-chart-generator - 安装完成后,直接呼叫该 Skill 的名称或使用
/local-api-chart-generator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
Sync from PycharmProjects
v1.0.2
User update 2
v1.0.1
User update
元数据
常见问题
local-api-chart-generator 是什么?
专为调用本地数据接口并生成图表展示定制的 Skill。接收自然语言指令(如“我要最近一年燃油类型为天然气的扭矩占比”),自动提取参数,请求本地接口,生成 HTML 柱状图并返回完整的 HTML 源码。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 122 次。
如何安装 local-api-chart-generator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install local-api-chart-generator」即可一键安装,无需额外配置。
local-api-chart-generator 是免费的吗?
是的,local-api-chart-generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
local-api-chart-generator 支持哪些平台?
local-api-chart-generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 local-api-chart-generator?
由 z904832819(@z904832819)开发并维护,当前版本 v1.0.3。
推荐 Skills