intelligence-route — скилл для Claude Code: что делает
Выбирает агента и уровень модели по трём ступеням сложности с учётом прошлых запусков. Помогает сократить затраты на токены.
npx skills add ruvnet/ruflo --skill intelligence-route -a claude-codeЧто делает intelligence-route
Скилл распределяет задачи по трём уровням исполнения. Для базовых структурных правок вроде var-to-const или remove-console он использует компилятор TypeScript: такая обработка занимает около 1 мс и обходится в $0 без обращения к языковым моделям. Простые исправления ошибок с низкой сложностью уходят в Haiku. Сложные задачи на архитектуру и безопасность направляются в Sonnet или Opus.
Маршрутизатор опирается на историю предыдущих вызовов и нейросетевое предсказание вероятности успеха. Если добавить флаг --why, инструмент объяснит логику выбора через хук hooks_explain. Без отправки результата работы в hooks_model-outcome роутер не сохранит опыт и перестанет обучаться.
Какие задачи решает
- подобрать модель нужного уровня под сложность задачи
- выполнить структурные правки кода через компилятор без вызова LLM
- получить аудит и обоснование выбора модели с флагом
--why - обучить маршрутизатор на реальных исходах задач
Примеры запросов агенту
- intelligence-route "переписать модуль авторизации на JWT" --why
- intelligence-route "удалить отладочные вызовы console.log в src/api.ts"
- intelligence-route "исправить плавающий тест тайм-аута в воркере"
Как установить intelligence-route
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill intelligence-route -a claude-code2Вручную: положить файлы
~/.claude/skills/intelligence-route/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/intelligence-route/
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill intelligence-route -a codex2Вручную: положить файлы
.agents/skills/intelligence-route/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill intelligence-route -a cursor2Вручную: положить файлы
.cursor/skills/intelligence-route/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo intelligence-route2Вручную: положить файлы
.github/skills/intelligence-route/SKILL.md1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill intelligence-route -a gemini-cli2Командой платформы
gemini skills install https://github.com/ruvnet/ruflo --path plugins/ruflo-intelligence/skills/intelligence-routeВручную: положить файлы
.devin/skills/intelligence-route/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill intelligence-route -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о intelligence-route
Как установить intelligence-route в Claude Code?
Выполните команду npx skills add ruvnet/ruflo --skill intelligence-route -a claude-code.
Что делает intelligence-route?
Скилл анализирует описание задачи, ищет похожие успешные паттерны в истории и подбирает исполнителя вместе с уровнем модели: кодмод, Haiku или Sonnet/Opus.
Какие задачи выполняются бесплатно без вызова LLM?
Детерминированные трансформации компилятора TypeScript вроде var-to-const, remove-console и add-logging запускаются на первом уровне без LLM. Операции вида add-types или async-await требуют рассуждений и направляются в платные модели.
Исходный текст
SKILL.md · MIT
---
name: intelligence-route
description: Route tasks via the 3-tier model selector and learned patterns; emits a routing rationale via hooks_explain
argument-hint: "<task-description> [--why]"
allowed-tools: mcp__plugin_ruflo-core_ruflo__hooks_route mcp__plugin_ruflo-core_ruflo__hooks_explain mcp__plugin_ruflo-core_ruflo__hooks_model-route mcp__plugin_ruflo-core_ruflo__hooks_model-stats mcp__plugin_ruflo-core_ruflo__hooks_model-outcome mcp__plugin_ruflo-core_ruflo__hooks_intelligence_pattern-search mcp__plugin_ruflo-core_ruflo__hooks_intelligence_attention mcp__plugin_ruflo-core_ruflo__hooks_intelligence_stats mcp__plugin_ruflo-core_ruflo__neural_predict mcp__plugin_ruflo-core_ruflo__hooks_pre-task Bash
---
# Intelligence Routing
Pick the optimal agent + model tier for a task using learned patterns + the 3-tier router. Emits a `hooks_explain` rationale so the choice is auditable.
## When to use
Before starting any non-trivial task. Replaces manual agent selection with data-driven decisions.
## Steps
1. **Get an agent recommendation** — `mcp__plugin_ruflo-core_ruflo__hooks_route` with the task description. Returns `{ recommended, confidence, reasoning }`.
2. **Get a model tier recommendation** — `mcp__plugin_ruflo-core_ruflo__hooks_model-route` for Haiku/Sonnet/Opus selection.
3. **Search for similar past patterns** — `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_pattern-search` to find prior successes.
4. **Predict outcome** — `mcp__plugin_ruflo-core_ruflo__neural_predict` with the task description for a confidence-scored prediction.
5. **Spawn the recommended agent** at the recommended model tier.
6. **(If `--why` was passed)** — call `mcp__plugin_ruflo-core_ruflo__hooks_explain` to surface the routing rationale to the user.
7. **After task completes** — call `mcp__plugin_ruflo-core_ruflo__hooks_model-outcome` with `{ task, model, outcome: "success"|"failure"|"escalated" }` to train the router.
## 3-Tier Model Routing
| Tier | Handler | Latency | Cost | When |
|------|---------|---------|------|------|
| 1 | Deterministic codemod (TS compiler) | ~1ms | $0 | Structural transforms with no LLM: `var-to-const`, `remove-console`, `add-logging` |
| 2 | Haiku | ~500ms | ~$0.0002 | Low complexity (<30%), bug fixes, quick patches |
| 3 | Sonnet/Opus | 2–5s | $0.003–$0.015 | Complex reasoning, architecture, security, multi-file refactors |
When `hooks_route` returns `[CODEMOD_AVAILABLE]` for a deterministic intent (`var-to-const`, `remove-console`, `add-logging`), call `mcp__plugin_ruflo-core_ruflo__hooks_codemod` with the intent + file — it applies the transform via the TypeScript compiler at $0, no LLM. Note: `add-types`, `add-error-handling`, `async-await` require judgement and route to a model (Tier 2/3) per ADR-143; they are NOT $0 codemods. Agent Booster is a fast-apply merge engine for LLM-produced edits, not the Tier-1 path.
## Recording outcomes
Closing the routing loop is mandatory:
```bash
# Success (task, model and outcome are all required; model is haiku|sonnet|opus)
npx @claude-flow/cli@latest mcp exec -t hooks_model-outcome -p '{"task": "fix the flaky retry test", "model": "haiku", "outcome": "success"}'
# The model was too small and the work moved up a tier: use "escalated"; use "failure" if it did not work out
npx @claude-flow/cli@latest mcp exec -t hooks_model-outcome -p '{"task": "fix the flaky retry test", "model": "haiku", "outcome": "escalated"}'
```
The router learns from these calls. Skipping them = no learning.
## CLI alternative
```bash
npx @claude-flow/cli@latest hooks route --task "description"
npx @claude-flow/cli@latest hooks pre-task --description "description"
npx @claude-flow/cli@latest hooks explain --task "description" --verbose
```
© ruvnet · MIT · ruvnet/ruflo