vector-cluster — Claude Code skill: install and use
Clusters code files with graph community detection. Use it to inspect related areas of a project and spot outliers.
npx skills add ruvnet/ruflo --skill vector-cluster -a claude-codeWhat vector-cluster does
This skill runs [email protected] to create code-graph clusters from supplied files. It calls hooks graph-cluster with spectral or Louvain community detection, and can also run hooks graph-mincut. The output is JSON containing cluster assignments, community labels, and graph edges.
It checks for [email protected] and installs the package with npm when needed. Results can be stored with the memory MCP tool under the vector-clusters namespace. If graph.nodes is not iterable appears, run hooks init before clustering.
The top-level cluster command is the wrong path here because [email protected] reserves it for distributed cluster operations. Its --namespace, --k, and --density flags will not work. Use the hooks commands instead, or run k-means in your own code against vectors in AgentDB.
What it helps with
- group code files by graph communities
- find related code areas
- detect outlier files
- store cluster assignments in agent memory
Example prompts for the agent
- Run vector-cluster for `src/*.ts` with `hooks graph-cluster`.
- Cluster `src/app.ts` and `src/api.ts`, then show the community JSON.
- Run `hooks init` first, then use vector-cluster on `src/*.ts`.
How to install vector-cluster
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a claude-code2Manually: put the files in place
~/.claude/skills/vector-cluster/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/vector-cluster/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a codex2Manually: put the files in place
.agents/skills/vector-cluster/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a cursor2Manually: put the files in place
.cursor/skills/vector-cluster/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo vector-cluster2Manually: put the files in place
.github/skills/vector-cluster/SKILL.md1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a gemini-cli2Platform CLI
gemini skills install https://github.com/ruvnet/ruflo --path plugins/ruflo-ruvector/skills/vector-clusterManually: put the files in place
.devin/skills/vector-cluster/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set104
The whole set →Similar
Questions about vector-cluster
How do I install vector-cluster in Claude Code?
Run npx skills add ruvnet/ruflo --skill vector-cluster -a claude-code, then run npx skills add ruvnet/ruflo --skill vector-cluster -a claude-code again. The skill file is placed at ~/.claude/skills/vector-cluster/SKILL.md.
What does vector-cluster do?
It clusters supplied code files through graph community detection in [email protected]. It returns JSON with cluster assignments, community labels, and edges.
Why does cluster with --k fail?
In [email protected], the top-level cluster command is for distributed cluster operations and does not accept --namespace, --k, or --density. Use hooks graph-cluster or hooks graph-mincut for file clustering.
Source text
SKILL.md · MIT
--- name: vector-cluster description: Cluster code by graph community detection via npx [email protected] hooks graph-cluster (spectral / Louvain) argument-hint: "<namespace> [--k N]" allowed-tools: Bash Read mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_list --- # 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 1. **Ensure [email protected] is available**: ```bash npm ls ruvector 2>/dev/null | grep '0.3.3' || npm install [email protected] ``` 2. **Run clustering** — in [email protected] the only working clustering is via `hooks graph-cluster` (spectral/Louvain over a code graph). The top-level `cluster` command is reserved for distributed cluster ops and is currently "Coming Soon" upstream. ```bash npx -y [email protected] hooks graph-cluster <files...> npx -y [email protected] hooks graph-mincut <files...> ``` 3. **Review output** — JSON with cluster assignments, community labels, and edges. If you see `"graph.nodes is not iterable"`, run `hooks init` first to seed the graph state. 4. **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 N` and `cluster --density` are **not** valid in [email protected] — 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.
© ruvnet · MIT · ruvnet/ruflo