---
name: intelligence-route-74059194a0de
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__claude-flow__hooks_route mcp__claude-flow__hooks_explain mcp__claude-flow__hooks_model-route mcp__claude-flow__hooks_model-stats mcp__claude-flow__hooks_model-outcome mcp__claude-flow__hooks_intelligence_pattern-search mcp__claude-flow__hooks_intelligence_attention mcp__claude-flow__hooks_intelligence_stats mcp__claude-flow__neural_predict mcp__claude-flow__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__claude-flow__hooks_route` with the task description. Returns `{ recommended, confidence, reasoning }`.
2. **Get a model tier recommendation** — `mcp__claude-flow__hooks_model-route` for Haiku/Sonnet/Opus selection.
3. **Search for similar past patterns** — `mcp__claude-flow__hooks_intelligence_pattern-search` to find prior successes.
4. **Predict outcome** — `mcp__claude-flow__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__claude-flow__hooks_explain` to surface the routing rationale to the user.
7. **After task completes** — call `mcp__claude-flow__hooks_model-outcome` with `success: true|false` to train the router.

## 3-Tier Model Routing

| Tier | Handler | Latency | Cost | When |
|------|---------|---------|------|------|
| 1 | Agent Booster (WASM) | <1ms | $0 | Simple transforms (var→const, add types, remove console) — skip LLM entirely |
| 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 `[AGENT_BOOSTER_AVAILABLE]` for an intent type (`var-to-const`, `add-types`, `add-error-handling`, `async-await`, `add-logging`, `remove-console`), skip the LLM and use the Edit tool directly.

## Recording outcomes

Closing the routing loop is mandatory:

```bash
# Success
mcp tool call hooks_model-outcome --json -- '{"taskId": "T123", "success": true, "model": "haiku"}'

# Failure with reason
mcp tool call hooks_model-outcome --json -- '{"taskId": "T123", "success": false, "model": "haiku", "reason": "complexity-misjudged"}'
```

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 --topic "routing decision"
```


---
Source attribution: digitalcrest01
Original project: https://github.com/digitalcrest01/ruflow/blob/8f78f238e1775aedf7faa6026b5f20c9aa8cbd12/plugins/ruflo-intelligence/skills/intelligence-route/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2024-2026 ruvnet

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: digitalcrest01
Original project: https://github.com/digitalcrest01/ruflow/blob/8f78f238e1775aedf7faa6026b5f20c9aa8cbd12/plugins/ruflo-intelligence/skills/intelligence-route/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering, Product Management
Roles: Data Scientist, ML / AI Engineer, Product Manager
Specialties: API
Tools: Mcp__Claude Flow__Hooks_Explain, Mcp__Claude Flow__Hooks_Intelligence_Attention, Mcp__Claude Flow__Hooks_Intelligence_Pattern Search, Mcp__Claude Flow__Hooks_Intelligence_Stats, Mcp__Claude Flow__Hooks_Model Outcome, Mcp__Claude Flow__Hooks_Model Route, Mcp__Claude Flow__Hooks_Model Stats, Mcp__Claude Flow__Hooks_Pre Task, Mcp__Claude Flow__Hooks_Route, Mcp__Claude Flow__Neural_Predict
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 69d5e1c36dd33ad959c65a0edf9f265d340bfed4f170180b6050fcb28870e3e6
