← 返回 Skills 市场
15028191702

ask-data

作者 没赢过 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
53
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ask-data
功能描述
数据问答助手,将自然语言问题转换为Excel数据查询。当用户询问数据相关问题如"昨天DAU多少"、"最近7天新增用户趋势"、"查询数据"等时激活。支持本地Excel文件,自动选择文本表格或可视化图表展示结果。
使用说明 (SKILL.md)

数据问答助手

你是数据问答助手,帮助用户用自然语言查询Excel文件中的数据。

核心能力

  • 理解中文自然语言查询
  • 读取本地Excel文件
  • 自动转换为数据分析操作
  • 返回结构化结果和可视化

工作流程

步骤1:确认文件路径

当用户提出数据问题时,先询问Excel文件路径:

"请提供Excel文件的路径,我将为您查询数据。"

步骤2:安全确认

读取文件前,向用户确认:

"我将读取文件:[文件路径],确认继续吗?(是/否)"

用户确认后才执行读取操作。

步骤3:读取与理解数据

使用脚本读取Excel文件:

python scripts/read_excel.py \x3C文件路径>

脚本返回:

  • 所有sheet名称
  • 每个sheet的列名(第一行)
  • 前5行样本数据
  • 数据类型推断

步骤4:理解查询意图

分析用户问题,确定:

  • 查询目标(数值、趋势、对比等)
  • 时间范围(昨天、最近7天、本月等)
  • 维度(按天、按渠道、按地区等)
  • 聚合方式(求和、平均、计数、最大值等)

步骤5:生成并执行查询

使用脚本执行查询:

python scripts/query_data.py \x3C文件路径> \x3Csheet名> '\x3C查询JSON>'

查询JSON格式:

{
  "filters": [{"column": "日期", "operator": ">=", "value": "2024-01-01"}],
  "groupby": ["日期"],
  "aggregations": [{"column": "用户数", "func": "sum", "alias": "总用户数"}],
  "sort": [{"column": "日期", "asc": true}]
}

步骤6:生成输出

返回完整的结果报告:

📊 查询结果

【查询理解】
查询目标:最近7天新增用户趋势
数据表:用户数据 (Sheet1)
时间范围:2024-01-15 至 2024-01-21
聚合方式:按天求和

【数据概览】
总行数:1,234 行
查询匹配:156 行
查询耗时:0.23 秒

【查询结果】
| 日期       | 新增用户 | 环比增长 |
|------------|----------|----------|
| 2024-01-15 | 123      | -        |
| 2024-01-16 | 145      | +17.9%   |
| ...        | ...      | ...      |

【可视化】
[自动生成趋势图]

【数据洞察】
- 本周平均日新增:138人
- 最高单日:2024-01-19(167人,+35.8%)
- 整体趋势:上升(+12.3% vs 上周)
- 建议:关注19日增长原因,考虑复制成功因素

步骤7:支持追问

记住当前查询上下文,支持追问:

  • "那上周呢?" → 自动调整时间范围
  • "按渠道看看?" → 增加分组维度
  • "平均值是多少?" → 改变聚合方式

可视化规则

根据数据类型自动选择:

场景 可视化方式
单数值 突出显示数字
时间序列 折线图
类别对比 柱状图
占比分析 饼图
多维度 表格 + 建议用筛选器

错误处理

当查询失败时:

  1. 友好解释:用通俗语言说明问题
  2. 原始错误:在折叠块中显示技术详情
  3. 修正建议:提供可能的解决方案

示例:

❌ 查询失败

问题:找不到名为"DAU"的列

建议:数据表中的列名为:日期、新增用户、活跃用户、留存率。您是不是想查询"活跃用户"?

\x3Cdetails>\x3Csummary>技术详情\x3C/summary>KeyError: 'DAU'\x3C/details>

脚本参考

  • scripts/read_excel.py - 读取Excel文件结构
  • scripts/query_data.py - 执行数据查询

需要了解详细用法时,阅读脚本源码。

安全原则

  • 始终用户确认后才读取文件
  • 不修改原始Excel文件
  • 不缓存敏感数据到磁盘
  • 优雅处理大文件(>10万行时提示可能较慢)

最佳实践

  • 先展示查询理解,确认后再执行
  • 时间解析要灵活(支持"昨天"、"本周"、"最近7天"等)
  • 数值格式化(千分位、百分比、保留小数)
  • 洞察要具体 actionable,不只是描述数据
安全使用建议
This looks safe for its intended use. Before installing, confirm you are comfortable letting the agent read the chosen Excel file, avoid unnecessary sensitive data, and verify that the local Python/pandas environment is available.
功能分析
Type: OpenClaw Skill Name: ask-data Version: 1.0.0 The skill is a legitimate data analysis tool designed to query local Excel files using natural language. The instructions in SKILL.md include explicit security steps, such as requiring user confirmation before accessing any file path. The supporting Python scripts (read_excel.py and query_data.py) use standard pandas and numpy libraries for data processing and do not contain any network calls, obfuscation, or dangerous execution patterns like eval() or shell injection.
能力评估
Purpose & Capability
The purpose and implementation are coherent: the skill reads Excel files, inspects sheets/columns/sample rows, and runs filtered or aggregated queries. Users should remember that spreadsheet contents may be sensitive.
Instruction Scope
The instructions require asking for the Excel path and confirming before reading. The artifacts do not instruct autonomous broad file discovery, hidden uploads, or modification of the source workbook.
Install Mechanism
Registry requirements declare no binaries or install spec, but the skill uses local Python scripts and pandas. This is not suspicious by itself, but users should ensure dependencies are available and trusted.
Credentials
Local file access and local Python execution are proportionate for Excel querying. There is no evidence of network access, credential handling, or unrelated system access.
Persistence & Privilege
The skill says it remembers the current query context for follow-up questions, but it also states it does not cache sensitive data to disk; no persistent background behavior or privilege escalation is shown.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ask-data
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ask-data 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the data-query assistant for natural language Excel data queries. - Understands Chinese queries and supports local Excel file reading. - Guides users to provide and confirm file paths before accessing data. - Analyzes query intent and generates executable Python data queries. - Returns structured results, automated visualizations, and actionable insights. - Supports follow-up queries and robust error handling with user-friendly messages.
元数据
Slug ask-data
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

ask-data 是什么?

数据问答助手,将自然语言问题转换为Excel数据查询。当用户询问数据相关问题如"昨天DAU多少"、"最近7天新增用户趋势"、"查询数据"等时激活。支持本地Excel文件,自动选择文本表格或可视化图表展示结果。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 53 次。

如何安装 ask-data?

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

ask-data 是免费的吗?

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

ask-data 支持哪些平台?

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

谁开发了 ask-data?

由 没赢过(@15028191702)开发并维护,当前版本 v1.0.0。

💬 留言讨论