← 返回 Skills 市场
ckchzh

Cluster

作者 BytesAgain2 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
236
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install cluster
功能描述
Perform data clustering analysis using k-means and hierarchical algorithms. Use when you need to group, classify, or segment datasets.
使用说明 (SKILL.md)

Cluster — Data Clustering Analysis Tool

Cluster is a command-line data clustering analysis tool that supports k-means and hierarchical clustering algorithms. It reads numerical data from CSV/JSONL sources, performs clustering, evaluates cluster quality, and exports results.

Data is stored in ~/.cluster/data.jsonl as JSONL records. Each record represents a clustering run with its parameters, assignments, centroids, and evaluation metrics.

Prerequisites

  • Python 3.8+ with standard library (no external packages required for basic operations)
  • bash shell

Commands

run

Run a clustering algorithm on input data.

Environment Variables:

  • INPUT (required) — Path to input CSV/JSONL file with numerical data
  • K — Number of clusters (default: 3)
  • ALGORITHM — Algorithm to use: kmeans or hierarchical (default: kmeans)
  • MAX_ITER — Maximum iterations for k-means (default: 100)
  • SEED — Random seed for reproducibility

Example:

INPUT=/path/to/data.csv K=5 ALGORITHM=kmeans bash scripts/script.sh run

assign

Assign new data points to existing clusters from a previous run.

Environment Variables:

  • RUN_ID (required) — ID of the clustering run to use
  • INPUT (required) — Path to new data points (CSV/JSONL)

Example:

RUN_ID=abc123 INPUT=/path/to/new_data.csv bash scripts/script.sh assign

centroids

Display or export centroid coordinates for a clustering run.

Environment Variables:

  • RUN_ID (required) — ID of the clustering run
  • FORMAT — Output format: table, json, csv (default: table)

evaluate

Evaluate clustering quality with silhouette score, inertia, and Davies-Bouldin index.

Environment Variables:

  • RUN_ID (required) — ID of the clustering run to evaluate

visualize

Generate a text-based or ASCII visualization of cluster assignments.

Environment Variables:

  • RUN_ID (required) — ID of the clustering run
  • DIMS — Dimensions to plot, comma-separated (default: first two)

export

Export clustering results to a file.

Environment Variables:

  • RUN_ID (required) — ID of the run to export
  • OUTPUT — Output file path (default: stdout)
  • FORMAT — Export format: json, csv, jsonl (default: json)

import

Import a previously exported clustering run.

Environment Variables:

  • INPUT (required) — Path to the file to import

config

View or update configuration settings.

Environment Variables:

  • KEY — Configuration key to set
  • VALUE — Configuration value

list

List all stored clustering runs with summary info.

Environment Variables:

  • LIMIT — Maximum runs to display (default: 20)
  • SORT — Sort field: date, k, score (default: date)

stats

Show aggregate statistics across all clustering runs.

help

Display usage information and available commands.

version

Display the current version of the cluster tool.

Data Storage

All clustering runs are stored in ~/.cluster/data.jsonl. Each line is a JSON object with fields:

  • id — Unique run identifier
  • timestamp — ISO 8601 creation time
  • algorithm — Algorithm used
  • k — Number of clusters
  • centroids — List of centroid coordinates
  • assignments — Mapping of data point indices to cluster IDs
  • metrics — Evaluation metrics (silhouette, inertia, etc.)
  • input_file — Source data file path
  • num_points — Number of data points clustered

Configuration

Config is stored in ~/.cluster/config.json. Available keys:

  • default_k — Default number of clusters (default: 3)
  • default_algorithm — Default algorithm (default: kmeans)
  • max_iterations — Default max iterations (default: 100)
  • random_seed — Default random seed (default: 42)

Powered by BytesAgain | bytesagain.com | [email protected]

安全使用建议
This skill runs locally and appears to do only local clustering: you must provide input files via the INPUT environment variable and results are appended to ~/.cluster/data.jsonl and config is stored in ~/.cluster/config.json. Recommended precautions before installing/using: (1) review the bundled scripts (scripts/script.sh) yourself — they will be executed on your machine; (2) avoid pointing INPUT at sensitive files unless you are comfortable with the tool recording the input_file path and derived results in ~/.cluster; (3) if you need to remove traces, delete ~/.cluster; (4) ensure Python 3.8+ is available and be mindful of memory/CPU for large datasets. Nothing in the package indicates network communication or credential exfiltration.
功能分析
Type: OpenClaw Skill Name: cluster Version: 1.0.0 The clustering tool in `scripts/script.sh` provides legitimate data analysis functionality but contains significant security vulnerabilities due to a lack of input sanitization. The `run`, `assign`, and `export` commands use environment variables (`INPUT`, `OUTPUT`) to handle file paths for reading data and exporting results without any validation, enabling arbitrary file read and write operations. This could be exploited to access sensitive system information or overwrite critical files (e.g., configuration or startup scripts) if the AI agent is manipulated into using malicious paths.
能力评估
Purpose & Capability
Name and description match the actual implementation. The included scripts implement k-means and simple hierarchical clustering, evaluation metrics, import/export, and listing of runs — all coherent with a clustering tool.
Instruction Scope
Runtime instructions are narrowly scoped: they tell the agent/user to supply input file paths and flags via environment variables and to run the bundled script. The code reads the specified input file(s), writes results to ~/.cluster/data.jsonl and config to ~/.cluster/config.json, and does not access unrelated system paths, network endpoints, or other credentials.
Install Mechanism
There is no install spec; this is instruction-only plus a bundled script. The script is executed locally and no external packages or remote downloads are performed. The Python code uses only the standard library.
Credentials
The skill does not request any credentials or special environment variables from the registry. Runtime environment variables (INPUT, K, ALGORITHM, RUN_ID, etc.) are normal for command-line tools and relate directly to the tool's purpose. No secrets or unrelated service keys are required.
Persistence & Privilege
always is false and the skill does not request persistent platform privileges. It creates and writes its own data and config under ~/.cluster, which is expected for this kind of tool and does not modify other skills or system-wide agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cluster
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cluster 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
publish v1.0.0
元数据
Slug cluster
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Cluster 是什么?

Perform data clustering analysis using k-means and hierarchical algorithms. Use when you need to group, classify, or segment datasets. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 236 次。

如何安装 Cluster?

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

Cluster 是免费的吗?

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

Cluster 支持哪些平台?

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

谁开发了 Cluster?

由 BytesAgain2(@ckchzh)开发并维护,当前版本 v1.0.0。

💬 留言讨论