← Back to Skills Marketplace
15028191702

ask-data

by 没赢过 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
53
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ask-data
Description
数据问答助手,将自然语言问题转换为Excel数据查询。当用户询问数据相关问题如"昨天DAU多少"、"最近7天新增用户趋势"、"查询数据"等时激活。支持本地Excel文件,自动选择文本表格或可视化图表展示结果。
README (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,不只是描述数据
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ask-data
  3. After installation, invoke the skill by name or use /ask-data
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug ask-data
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is ask-data?

数据问答助手,将自然语言问题转换为Excel数据查询。当用户询问数据相关问题如"昨天DAU多少"、"最近7天新增用户趋势"、"查询数据"等时激活。支持本地Excel文件,自动选择文本表格或可视化图表展示结果。 It is an AI Agent Skill for Claude Code / OpenClaw, with 53 downloads so far.

How do I install ask-data?

Run "/install ask-data" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ask-data free?

Yes, ask-data is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ask-data support?

ask-data is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ask-data?

It is built and maintained by 没赢过 (@15028191702); the current version is v1.0.0.

💬 Comments