vector-cluster — скилл для Claude Code: как установить
Группирует файлы кода через поиск сообществ в графе. Пригодится, чтобы увидеть связанные части проекта и выбросы.
npx skills add ruvnet/ruflo --skill vector-cluster -a claude-codeЧто делает vector-cluster
Скилл запускает [email protected] и строит граф кластеров по файлам кода. Он вызывает hooks graph-cluster со спектральным алгоритмом или Louvain, а также hooks graph-mincut. В ответе приходят JSON-назначения кластеров, метки сообществ и рёбра графа.
Перед запуском нужен [email protected]; скилл проверяет пакет и при необходимости устанавливает его через npm. Результаты можно сохранить через MCP-инструмент памяти в пространстве vector-clusters. Если появляется ошибка graph.nodes is not iterable, сначала запустите hooks init.
Команда верхнего уровня cluster здесь не годится, потому что в [email protected] она отведена под операции распределённого кластера. Параметры --namespace, --k и --density для неё не сработают. Это повод использовать вызовы из hooks или выполнять k-means для векторов AgentDB в собственном коде.
Какие задачи решает
- сгруппировать файлы кода по связям графа
- найти тематические сообщества в проекте
- выявить выбросы среди файлов
- сохранить назначения кластеров в памяти агента
Примеры запросов агенту
- Запусти vector-cluster для файлов `src/*.ts` через `hooks graph-cluster`.
- Сгруппируй `src/app.ts` и `src/api.ts`, затем покажи JSON с сообществами.
- Если граф ещё не создан, выполни `hooks init`, а потом запусти vector-cluster для `src/*.ts`.
Как установить vector-cluster
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a claude-code2Вручную: положить файлы
~/.claude/skills/vector-cluster/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/vector-cluster/
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a codex2Вручную: положить файлы
.agents/skills/vector-cluster/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a cursor2Вручную: положить файлы
.cursor/skills/vector-cluster/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo vector-cluster2Вручную: положить файлы
.github/skills/vector-cluster/SKILL.md1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a gemini-cli2Командой платформы
gemini skills install https://github.com/ruvnet/ruflo --path plugins/ruflo-ruvector/skills/vector-clusterВручную: положить файлы
.devin/skills/vector-cluster/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-cluster -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Из того же набора104
Весь набор →Похожие
Вопросы о vector-cluster
Как установить vector-cluster в Claude Code?
Выполните npx skills add ruvnet/ruflo --skill vector-cluster -a claude-code, затем повторите npx skills add ruvnet/ruflo --skill vector-cluster -a claude-code. Файл скилла находится в ~/.claude/skills/vector-cluster/SKILL.md.
Что делает vector-cluster?
Скилл запускает кластеризацию файлов через сообщества графа в [email protected]. Он возвращает JSON с кластерами, метками сообществ и рёбрами.
Почему не работает команда cluster с --k?
В [email protected] верхнеуровневая cluster предназначена для распределённых операций и не принимает --namespace, --k или --density. Для кластеризации файлов используйте hooks graph-cluster или hooks graph-mincut.
Исходный текст
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