vector-cluster
它能做什么
这项技能使用基于图的方法,按相关程度对集合中的项目进行分组。适用于整理大量代码或笔记、并希望看到自然分组的人。
适用场景
- ✓当你想在大量笔记或代码中发现主题的时候。
- ✓当你想找出不属于任何组的离群项的时候。
- ✓当你想把一个大型集合整理成多个聚类的时候。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-ruvector/skills/vector-cluster/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请根据我项目中模块之间的紧密程度对它们分组,并展示各个聚类。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能会安装固定版本的 ruvector 工具,对你指定的文件运行图聚类命令,并检查聚类分配结果。它会为每个聚类的内聚度评分,并保存结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Vector Cluster
Cluster vectors in a namespace by semantic similarity using ruvector.
When to use
Use this skill when you have a collection of embeddings and want to discover natural groupings. Clustering reveals themes, identifies outliers, and helps organize large vector collections.
Steps
- Ensure ruvector@0.3.3 is available:
npm ls ruvector 2>/dev/null | grep '0.3.3' || npm install ruvector@0.3.3 - Run clustering — in ruvector@0.3.3 the only working clustering is via
hooks graph-cluster(spectral/Louvain over a code graph). The top-levelclustercommand is reserved for distributed cluster ops and is currently "Coming Soon" upstream.npx -y ruvector@0.3.3 hooks graph-cluster <files...> npx -y ruvector@0.3.3 hooks graph-mincut <files...> - Review output — JSON with cluster assignments, community labels, and edges. If you see
"graph.nodes is not iterable", runhooks initfirst to seed the graph state. - Store results:
mcp__plugin_ruflo-core_ruflo__memory_store({ key: "clusters-PROJECT-TIMESTAMP", value: "CLUSTER_ASSIGNMENTS", namespace: "vector-clusters" })
Interpreting results
- High cohesion (>0.85): tight, well-defined cluster
- Medium cohesion (0.6-0.85): related but diverse content
- Low cohesion (<0.6): loose grouping, try higher resolution
- Outliers: novel or anomalous files worth investigating
Caveats
cluster --namespace ... --k Nandcluster --densityare not valid in ruvector@0.3.3 — those flags fall through to the distributed-cluster command, which only accepts--status,--join,--leave,--nodes,--leader,--info.- For namespaced k-means over arbitrary embeddings, run k-means in your own code against vectors stored in AgentDB.
常见问题
内聚度是什么意思?
它是一个分数,表示聚类中的项目结合得有多紧密。来源给出的范围是:高于 0.85 表示紧密,低于 0.6 表示松散。
如果输出出错怎么办?
来源建议先运行 hooks init 命令,以设置图状态。
它能对我提供的任意向量进行聚类吗?
这项技能说明,可用的聚类方式是图聚类命令。
详情
作者的原始描述
Cluster code by graph community detection via npx ruvector@0.3.3 hooks graph-cluster (spectral / Louvain)
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1685
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。