Xpersona
D

data-analysis-partner

CLAWHUB · Unverified

智能数据分析 Skill,输入 CSV/Excel 文件和分析需求,输出带交互式 ECharts 图表的 HTML 自包含分析报告 Skill: data-analysis-partner Owner: 1992huanghai Summary: 智能数据分析 Skill,输入 CSV/Excel 文件和分析需求,输出带交互式 ECharts 图表的 HTML 自包含分析报告 Tags: latest:1.0.2 Version history: v1.0.2 | 2026-03-24T09:46:50.619Z | user [1.0.2] - 2026-03-24 🐛 Bug Fix - **ERR_AMBIGUOUS_MODULE_SYNTAX**: Converted index.js from ES Module (import/export default) to CommonJS (require/module.exports) to fix compatibility with OpenClaw skill runner - Removed

62
Rank
84
Safety
1.8k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.8K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s173409vvz1f0s45z8mbr7xmd183h7y2:data-analysis-partner
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-1992huanghai-data-analysis-partner/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

34,167 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: data-analysis-partner
description: 智能数据分析 Skill,输入 CSV/Excel 文件和分析需求,输出带交互式 ECharts 图表的 HTML 自包含分析报告
metadata:
  {
    "openclaw": {
      "emoji": "📊",
      "requires": { "bins": ["python3"] }
    }
  }
---

# 数据分析 Skill

## 功能说明

本 Skill 提供 `analyze_data` 工具,能够:

1. 读取 CSV 或 Excel 数据文件(.csv / .xlsx / .xls)
2. 自动进行数据概览(行列数、字段类型、缺失值)
3. 执行统计分析(描述统计、相关性分析、异常值检测)
4. 根据用户需求生成针对性的分析和洞察
5. 输出带交互式 ECharts 图表的自包含 HTML 报告

## 触发场景

当用户出现以下意图时,应主动调用 `analyze_data` 工具:

- 上传了 CSV 或 Excel 文件,并提出分析需求
- 要求"帮我分析这份数据"、"生成数据报告"、"可视化这个文件"
- 要求找规律、找差异、找趋势、找异常
- 要求生成 BI 报告、数据洞察报告

## 调用方式

```
analyze_data(
  file_path: "<文件绝对路径>",
  requirements: "<自然语言分析需求>",
  output_dir: "<输出目录,可选>"
)
```

### 调用示例

**示例 1**:
用户说「帮我分析一下这个销售数据,各区域表现怎么样?」
→ 调用 `analyze_data(file_path="/path/to/sales.csv", requirements="分析各区域销售额差异,找出表现最好和最差的区域,给出改善建议")`

**示例 2**:
用户说「分析用户行为数据,找出流失节点」
→ 调用 `analyze_data(file_path="/path/to/users.xlsx", requirements="对用户行为数据做漏斗分析,找出主要流失节点,分析流失原因")`

**示例 3**:
用户说「分析产品退货率的影响因素」
→ 调用 `analyze_data(file_path="/path/to/orders.csv", requirements="分析产品退货率,找出与退货率相关的主要因素,给出降低退货率的建议")`

## 返回值说明

工具返回一个对象,包含:

| 字段 | 说明 |
|------|------|
| `report_path` | HTML 报告文件路径,可直接在浏览器打开 |
| `summary` | 结构化摘要数据(行列数、字段信息、关键洞察列表) |
| `charts_count` | 生成的图表数量 |
| `insights` | 规则引擎提取的关键洞察列表 |
| `open_command` | 打开报告的命令(如 `open /path/to/report.html`) |

## 报告结构

生成的 HTML 报告包含以下模块:

1. **执行摘要** — 核心发现概览卡片
2. **数据概览** — 字段类型、缺失值、基础统计表格
3. **数据洞察** — 规则引擎自动提取的关键发现
4. **可视化图表** — 交互式 ECharts 图表(分布图、柱状图、热力图、趋势图等)
5. **描述统计** — 数值列的 min/max/mean/std/quartile 详细统计
6. **分析结论** — 针对用户需求的分析总结

## 获取文件路径

如果用户上传了文件但未提供路径,使用以下方式获取:

```
# OpenClaw 上传文件后,路径通常在 ~/Downloads/ 或临时目录
# 可以用 list_files 工具确认
list_files("~/Downloads")
```

## 首次使用:安装 Python 依赖

本 Skill 在首次调用时会**自动尝试**创建隔离的 Python 环境并安装依赖。如果自动安装失败,请手动执行:

```bash
# 在 Skill 目录下创建虚拟环境
python3 -m venv ~/.openclaw/skills/data-analysis-partner/.venv

# 安装依赖
~/.openclaw/skills/data-analysis-partner/.venv/bin/pip install pandas numpy openpyxl xlrd
```

依赖安装优先级:
1. Skill 目录内置 `.venv`(隔离环境,推荐)
2. 系统 `python3`(需已安装 pandas/numpy)
3. 自动创建 `.venv` 并安装(首次运行时尝试)

## 隐私说明

生成的 HTML 报告通过 **CDN** 加载 ECharts 图表库:

```html
<script src="https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js"></script>
```

这意味着:
- 用浏览器**打开报告时**会向 `cdn.jsdelivr.net` 发出网络请求
- CDN 服务器可能记录访问 IP、时间等基础日志
- **报告本身的数据内容不会上传**,仅加载图表渲染库

如需完全离线查看,可在有网络时打开一次报告(ECharts 会被浏览器缓存),后续即可离线使用。

## 其他注意事项

- 大文件(>100MB)分析时间可能较长(30秒~2分钟)
- 超过 5 万行的数据集会自动随机抽样,原始行数在报告中标注
- HTML 报告自包含(图表配置内嵌),可发送给他人查看

README.md

# 📊 data-analysis Skill for OpenClaw

智能数据分析 Skill,输入 CSV/Excel 文件和自然语言分析需求,自动生成带 **ECharts 交互式图表**的 HTML 自包含分析报告。

## 功能特性

- 支持 `.csv` / `.xlsx` / `.xls` 文件格式
- 自动检测字段类型(数值、分类、时间、文本)
- 智能生成多种 ECharts 图表:
  - 分布直方图(数值字段)
  - 分类柱状图(分类字段)
  - 多系列对比柱状图
  - 相关性热力图
  - 时间趋势折线图(含面积填充)
  - 占比饼图
  - 缺失值分布图
- 规则引擎自动提取数据洞察(缺失值、异常值、相关性、偏态)
- 输出自包含 HTML 报告,可在浏览器中交互查看
- 支持大数据集(>5 万行自动采样)

## 安装

### 方式一:直接复制(当前已完成)

```bash
# Skill 已安装至全局目录
ls ~/.openclaw/skills/data-analysis/
```

### 方式二:OpenClaw 命令安装(发布后)

```
/skills install @custom/data-analysis
```

## 依赖环境

### 必须

- **Python 3.8+**(系统已安装)
- **pandas**:数据处理核心库
- **numpy**:数值计算

### 可选(Excel 支持)

- **openpyxl**:读取 `.xlsx` 文件
- **xlrd**:读取 `.xls` 文件

### 一键安装依赖

```bash
pip install pandas numpy openpyxl xlrd
```

## 使用方式

### 在 OpenClaw 中使用

```
你:帮我分析一下这个销售数据 /path/to/sales.csv,看各区域的差异
```

OpenClaw 会自动调用 `analyze_data` 工具,生成报告后告知你路径。

### 直接调用工具

```
analyze_data(
  file_path: "/path/to/data.csv",
  requirements: "分析各产品类别的销售额趋势,找出增长最快的类别"
)
```

### 返回值

```json
{
  "report_path": "/Users/you/Downloads/report_data_2026-03-24T10-30-00.html",
  "open_command": "open \"/Users/you/Downloads/report_data_2026-03-24T10-30-00.html\"",
  "charts_count": 7,
  "insights": ["⚠️ 字段 X 缺失率 15.3%...", "📈 A 与 B 存在强正相关..."],
  "basic_info": { "rows": 7300, "cols": 14, ... }
}
```

## 配置项

在 `openclaw.json` 中配置:

```json
{
  "skills": {
    "data-analysis": {
      "enabled": true,
      "config": {
        "outputDir": "~/Desktop/reports",
        "maxCharts": 8,
        "theme": "light"
      }
    }
  }
}
```

| 配置项 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
| `outputDir` | string | `~/Downloads` | HTML 报告输出目录 |
| `maxCharts` | number | `8` | 最多生成图表数量 |
| `theme` | string | `light` | 报告主题(当前仅 light) |

## 报告结构

生成的 HTML 报告包含:

1. **Header** — 文件名、生成时间、分析需求
2. **概览卡片** — 行数、列数、数值字段数、分类字段数、重复行、图表数、洞察数
3. **数据洞察** — 自动发现的关键问题和特征
4. **可视化图表** — 响应式 ECharts 图表网格
5. **字段信息表** — 每列的类型、缺失率、唯一值数、样本值
6. **描述统计表** — 数值列的 min/Q25/median/Q75/max/mean/std/偏度

## 文件结构

```
~/.openclaw/skills/data-analysis/
├── manifest.json       # 工具定义、权限、配置
├── SKILL.md            # AI 使用指令(告知 OpenClaw 何时及如何调用)
├── index.js            # 主逻辑:调用 Python + 生成 HTML 报告
├── scripts/
│   └── analyze.py      # Python 数据分析核心(pandas + numpy)
└── README.md           # 本文件
```

## 常见问题

**Q: 提示"缺少依赖包"或 Python 环境找不到?**

本 Skill 首次运行时会自动尝试创建 `.venv` 并安装依赖。如自动安装失败,请手动执行:

```bash
python3 -m venv ~/.openclaw/skills/data-analysis-partner/.venv
~/.openclaw/skills/data-analysis-partner/.venv/bin/pip install pandas numpy openpyxl xlrd
```

Python 环境查找优先级:
1. Skill 目录内 `.venv/bin/python3`(隔离环境)
2. 系统 `python3`(需已安装 pandas/numpy)
3. 首次运行自动创建 `.venv`

**Q: Excel 文件读取失败?**
```bash
pip install openpyxl  # .xlsx 格式
pip install xlrd      # .xls 格式
```

**Q: 图表不显示(空白)?**

ECharts 通过 CDN(jsdelivr.net)加载,需要网络连接。浏览器会缓存 ECharts 库,联网加载一次后即可离线查看。

**Q: 打开报告时有外部网络请求,有隐私风险吗?**

报告加载 ECharts 时会向 `cdn.jsdelivr.net` 发出请求,CDN 可能记录访问 IP 和时间戳等基础日志,但**报告中的数据内容不会被上传**。如在敏感环境中使用,建

_meta.json

{
  "ownerId": "kn78pcrbesym0p175kf1vpg4cx83gpk7",
  "slug": "data-analysis-partner",
  "version": "1.0.2",
  "publishedAt": 1774345610619
}

CHANGELOG.md

# Changelog

All notable changes to the **data-analysis** Skill are documented here.

Format: [Semantic Versioning](https://semver.org) — `MAJOR.MINOR.PATCH`

---

## [1.0.2] - 2026-03-24

### 🐛 Bug Fix

- **ERR_AMBIGUOUS_MODULE_SYNTAX**: Converted `index.js` from ES Module (`import`/`export default`) to CommonJS (`require`/`module.exports`) to fix compatibility with OpenClaw skill runner
- Removed `execSync` (auto-venv creation) to reduce `child_process` usage surface; Python env now resolves via `.venv` → system `python3` only

---

## [1.0.1] - 2026-03-24

### 🔧 Fixes & Improvements

- **Python env fallback**: `index.js` now auto-detects Python in order: bundled `.venv` → system `python3` → auto-create `.venv`. No manual setup needed in most cases.
- **SKILL.md**: Added first-run setup instructions and ECharts CDN privacy disclosure.
- **README.md**: Added FAQ entries for Python env resolution and CDN privacy.

---

## [1.0.0] - 2026-03-24

### 🎉 Initial Release

#### Features
- **File Support**: CSV (multi-encoding) and Excel (.xlsx / .xls) input
- **Auto Column Detection**: numeric, categorical, datetime, text types
- **Chart Generation** (up to 8 ECharts interactive charts):
  - Distribution histograms for numeric columns
  - Value-count bar charts for categorical columns
  - Correlation heatmap (Pearson r matrix)
  - Time-series line chart with area fill (when datetime column detected)
  - Multi-series grouped bar chart
  - Proportion pie/donut chart
  - Missing value bar chart
- **Rule-Based Insight Engine**:
  - Missing value alert (threshold: > 10%)
  - Duplicate row detection
  - Strong correlation detection (|r| > 0.7)
  - Outlier detection via IQR method
  - Skewed distribution alert (|skewness| > 2)
  - High-cardinality categorical field warning (nunique > 50)
  - Sample size warning for small/large datasets
- **Self-Contained HTML Report**:
  - Responsive 2-column chart grid
  - Summary stat cards
  - Column info table (type / missing % / unique count / sample values)
  - Descriptive statistics table (min / Q25 / median / Q75 / max / std / skewness)
  - Modern CSS design with hover effects
- **Large Dataset Support**: auto-samples at 50,000 rows
- **Isolated Python Environment**: bundled `.venv` for dependency isolation

skill-card.md

## Description:

Data Analysis Partner analyzes CSV and Excel files from a natural-language request and produces a self-contained HTML report with interactive ECharts visualizations.

This skill is ready for commercial/non-commercial use.

## Publisher:

[1992huanghai](https://clawhub.ai/user/1992huanghai)

### License/Terms of Use:

MIT-0

## Use Case:

Developers, analysts, and external users use this skill to inspect CSV or Excel datasets, generate statistical summaries and rule-based insights, and create browser-viewable reports with interactive charts.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Generated HTML reports can execute injected JavaScript from malicious spreadsheet or user-supplied content.

Mitigation: Review generated reports before opening or sharing them, avoid untrusted input files, and keep sensitive reports in a private folder.

Risk: Reports load ECharts from jsDelivr when opened, which can create an external network request.

Mitigation: Use a locally bundled or cached ECharts library for sensitive or offline workflows.

Risk: Python dependency resolution may rely on the local environment.

Mitigation: Use a pinned virtual environment with reviewed versions of pandas, numpy, openpyxl, and xlrd.

## Reference(s):

- [ClawHub Skill Page](https://clawhub.ai/1992huanghai/skills/data-analysis-partner)
- [Publisher Profile](https://clawhub.ai/user/1992huanghai)
- [Artifact README](artifact/README.md)
- [ECharts CDN Dependency](https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js)

## Skill Output:

**Output Type(s):** [Analysis, Files, JSON, Shell commands, Configuration instructions]

**Output Format:** [JSON tool result plus a self-contained HTML report with interactive ECharts charts]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Requires python3 with pandas and numpy; Excel support uses openpyxl and xlrd; generated reports may load ECharts from jsDelivr when opened.]

## Skill Version(s):

1.0.2 (source: release evidence, manifest.json, CHANGELOG.md)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to data-analysis-partner and adjacent AI workflows.