IntentRouter
Your AI's Smart Traffic Director: Precisely Matching Your OpenClaw Tasks to the Perfect LLM.
v1.7.0 — Security-focused release. COMPLEX tier, absolute paths. Tested and working with OpenClaw TUI delegation. Removed gateway auth secret exposure and gateway management for improved security.
IntentRouter analyzes your tasks and directs them to the best LLM—MiniMax 2.5 for code, Kimi k2.5 for creative, Grok Fast for research. Eliminate guesswork; route with purpose.
Security improvements in v1.7.0: Removed gateway auth token/password from router output. Gateway management removed - use gateway-guard skill separately. FACEPALM integration removed - use FACEPALM skill separately.
Requirements: OpenRouter — All model IDs use the openrouter/... prefix. Configure OpenClaw with an OpenRouter API key so one auth profile covers every tier.
Config access: This skill reads ONLY its own config.json file (located in the skill directory) for model configuration and routing rules. It does NOT read openclaw.json, does NOT access gateway tokens/passwords, and does NOT perform any gateway management operations. Router output contains only: task, model, sessionTarget, and optional label — no secrets or credentials.
Default / orchestrator model: Gemini 2.5 Flash (openrouter/google/gemini-2.5-flash) — fast, cheap, reliable at tool-calling. The router delegates tasks to tier-specific sub-agents (Kimi for creative, MiniMax 2.5 for code, etc.).
Orchestrator flow (mandatory for task requests)
When you are the main agent (Gemini 2.5 Flash) and the user gives you a task (code, research, write, create, design, poem, story, fix, build, etc.), you must delegate it. You do not perform the task yourself; a sub-agent does.
Steps (all three required):
- 1. Run IntentRouter to get spawn params:
python3 workspace/skills/friday-router/scripts/router.py spawn --json "<user message>"
Example output: INLINECODE8
- 2. Immediately call
sessions_spawn with the router's output. Use the exact model from the JSON. Example:
sessions_spawn(task="write a poem about Mai", model="openrouter/moonshotai/kimi-k2.5", sessionTarget="isolated")
Do
not change the
model value. If the router said
openrouter/moonshotai/kimi-k2.5, pass exactly that.
- 3. Forward the sub-agent's reply to the user. That reply IS the task output. Say "Using: Kimi k2.5" (the model that actually ran). Never say "Using: Claude Sonnet 4" or any model that didn't run. Output hygiene: If the sub-agent result contains internal text ("A subagent task … completed", "Findings:", "Stats:", "sessionKey", "Summarize this naturally"), strip that block and show only the final user-facing content to the user.
If sessions_spawn returns an error (e.g. device_token_mismatch): tell the user delegation failed and suggest checking gateway status or using the gateway-guard skill. Do not do the task yourself.
Hard-stop rule: If sessions_spawn fails or is skipped, return only the delegation error and next-step fix. Do not write the requested output directly.
No-classify execution rule: For real user tasks, do not execute via classify. classify is diagnostics only. Execution must use spawn --json -> sessions_spawn.
Label gate: Only print Using: <model> after successful spawn. If no successful spawn, do not print a Using: label.
Output hygiene: Never return internal orchestration metadata to the user (no session keys/IDs, transcript paths, runtime/token stats, or internal "summarize this" instructions). Forward only clean user-facing content.
Exception: Meta-questions ("what model are you?", "how does routing work?") you answer yourself.
Security note: This skill does NOT expose gateway auth secrets (tokens/passwords) in its output. Gateway management functionality has been removed. Use the separate gateway-guard skill if gateway auth management is needed.
Model Selection (Austin's Prefs)
| Use Case | Primary (OpenRouter) | Fallback |
|---|
| Default / orchestrator | Gemini 2.5 Flash | — |
| Fast/cheap |
Gemini 2.5 Flash | Gemini 1.5 Flash, Haiku |
|
Reasoning | GLM-5 | Minimax 2.5 |
|
Creative/Frontend | Kimi k2.5 | — |
|
Research | Grok Fast | — |
|
Code/Engineering | MiniMax 2.5 | Qwen2.5-Coder |
|
Quality/Complex | GLM 4.7 Flash | GLM 4.7, Sonnet 4, GPT-4o |
|
Vision/Images | GPT-4o | — |
All model IDs use openrouter/ prefix (e.g. openrouter/moonshotai/kimi-k2.5).
Usage
CLI
CODEBLOCK2
Note: Gateway auth management is not included. Use gateway-guard skill separately if needed.
sessions_spawn examples
Creative task (poem):
CODEBLOCK3
Code task (bug fix):
CODEBLOCK4
Research task:
CODEBLOCK5
Tier Detection
- - FAST: check, get, list, show, status, monitor, fetch, simple
- REASONING: prove, logic, analyze, derive, math, step by step
- CREATIVE: creative, write, story, design, UI, UX, frontend, website (website/frontend/landing projects → Kimi k2.5 only; do not use CODE tier)
- RESEARCH: research, find, search, lookup, web, information
- CODE: code, function, debug, fix, implement, refactor, test, React, JWT (code/API only; not website builds)
- QUALITY: complex, architecture, design, system, comprehensive
- VISION: image, picture, photo, screenshot, visual
What Changed from Original
| Bug | Fix |
|---|
| Simple indicators inverted (high match = complex) | Now correctly: high simple keyword match = FAST tier |
| Agentic tasks not bumping tier |
Multi-step tasks now properly bump to CODE tier |
| Vision tasks misclassified | Vision keywords now take priority over other classifications |
| Code keywords not detected | Added React, JWT, API, and other common code terms |
| Confidence always low | Now varies appropriately based on keyword match strength |
IntentRouter
你的AI智能流量调度员:精准将你的OpenClaw任务匹配到最合适的LLM。
v1.7.0 — 安全增强版。 COMPLEX层级,绝对路径。已测试并兼容OpenClaw TUI委派。移除了网关认证密钥暴露和网关管理功能,以提升安全性。
IntentRouter分析你的任务,并将其引导至最佳LLM——MiniMax 2.5处理代码,Kimi k2.5处理创意,Grok Fast处理研究。告别猜测,精准路由。
v1.7.0安全改进: 从路由器输出中移除了网关认证令牌/密码。网关管理功能已移除——请单独使用gateway-guard技能。FACEPALM集成已移除——请单独使用FACEPALM技能。
要求: OpenRouter — 所有模型ID均使用openrouter/...前缀。使用OpenRouter API密钥配置OpenClaw,以便一个认证配置文件覆盖所有层级。
配置访问: 此技能仅读取其自身的config.json文件(位于技能目录中)以获取模型配置和路由规则。它不读取openclaw.json,不访问网关令牌/密码,也不执行任何网关管理操作。路由器输出仅包含:task、model、sessionTarget和可选的label——不包含任何密钥或凭证。
默认/编排模型: Gemini 2.5 Flash(openrouter/google/gemini-2.5-flash)——快速、廉价、工具调用可靠。路由器将任务委派给特定层级的子代理(Kimi处理创意,MiniMax 2.5处理代码等)。
编排流程(任务请求必选)
当你作为主代理(Gemini 2.5 Flash)且用户给你一个任务(代码、研究、写作、创建、设计、诗歌、故事、修复、构建等)时,你必须委派它。你不自行执行任务;由子代理执行。
步骤(全部三个必需):
- 1. 运行IntentRouter以获取生成参数:
bash
python3 workspace/skills/friday-router/scripts/router.py spawn --json <用户消息>
示例输出:{task:write a poem about Mai,model:openrouter/moonshotai/kimi-k2.5,sessionTarget:isolated}
- 2. 立即调用sessions_spawn,使用路由器的输出。使用JSON中的确切model。示例:
sessions_spawn(task=write a poem about Mai, model=openrouter/moonshotai/kimi-k2.5, sessionTarget=isolated)
不要更改model值。如果路由器返回openrouter/moonshotai/kimi-k2.5,则原样传递。
- 3. 将子代理的回复转发给用户。该回复即为任务输出。说使用:Kimi k2.5(实际运行的模型)。绝不要说使用:Claude Sonnet 4或任何未运行的模型。输出净化: 如果子代理结果包含内部文本(子代理任务……已完成、发现:、统计:、sessionKey、请自然总结此内容),则删除该块,仅向用户显示最终面向用户的内容。
如果sessionsspawn返回错误(例如devicetoken_mismatch):告知用户委派失败,并建议检查网关状态或使用gateway-guard技能。不要自行执行任务。
硬停止规则: 如果sessions_spawn失败或被跳过,仅返回委派错误和下一步修复方案。不要直接编写请求的输出。
无分类执行规则: 对于真实用户任务,不要通过classify执行。classify仅用于诊断。执行必须使用spawn --json -> sessions_spawn。
标签门控: 仅在成功生成后打印使用:<模型>。如果没有成功生成,则不打印使用:标签。
输出净化: 绝不向用户返回内部编排元数据(无会话密钥/ID、转录路径、运行时/令牌统计或内部总结此内容指令)。仅转发干净的面向用户内容。
例外: 元问题(你是什么模型?、路由如何工作?)由你自己回答。
安全说明: 此技能不在其输出中暴露网关认证密钥(令牌/密码)。网关管理功能已移除。如果需要网关认证管理,请使用单独的gateway-guard技能。
模型选择(Austin的偏好)
| 用例 | 主要(OpenRouter) | 备用 |
|---|
| 默认/编排 | Gemini 2.5 Flash | — |
| 快速/廉价 |
Gemini 2.5 Flash | Gemini 1.5 Flash, Haiku |
|
推理 | GLM-5 | Minimax 2.5 |
|
创意/前端 | Kimi k2.5 | — |
|
研究 | Grok Fast | — |
|
代码/工程 | MiniMax 2.5 | Qwen2.5-Coder |
|
质量/复杂 | GLM 4.7 Flash | GLM 4.7, Sonnet 4, GPT-4o |
|
视觉/图像 | GPT-4o | — |
所有模型ID均使用openrouter/前缀(例如openrouter/moonshotai/kimi-k2.5)。
用法
CLI
bash
python scripts/router.py default # 显示默认模型
python scripts/router.py classify fix lint errors # 分类 → 层级 + 模型
python scripts/router.py spawn --json write a poem # 用于sessions_spawn的JSON(无网关密钥)
python scripts/router.py models # 列出所有模型
注意: 不包含网关认证管理。如果需要,请单独使用gateway-guard技能。
sessions_spawn示例
创意任务(诗歌):
路由器输出:{task:write a poem,model:openrouter/moonshotai/kimi-k2.5,sessionTarget:isolated}
→ sessions_spawn(task=write a poem, model=openrouter/moonshotai/kimi-k2.5, sessionTarget=isolated)
代码任务(修复bug):
路由器输出:{task:fix the login bug,model:openrouter/minimax/minimax-m2.5,sessionTarget:isolated}
→ sessions_spawn(task=fix the login bug, model=openrouter/minimax/minimax-m2.5, sessionTarget=isolated)
研究任务:
路由器输出:{task:research best LLMs,model:openrouter/x-ai/grok-4.1-fast,sessionTarget:isolated}
→ sessions_spawn(task=research best LLMs, model=openrouter/x-ai/grok-4.1-fast, sessionTarget=isolated)
层级检测
- - FAST:检查、获取、列出、显示、状态、监控、获取、简单
- REASONING:证明、逻辑、分析、推导、数学、逐步
- CREATIVE:创意、写作、故事、设计、UI、UX、前端、网站(网站/前端/落地页项目 → 仅限Kimi k2.5;不使用CODE层级)
- RESEARCH:研究、查找、搜索、查询、网络、信息
- CODE:代码、函数、调试、修复、实现、重构、测试、React、JWT(仅代码/API;非网站构建)
- QUALITY:复杂、架构、设计、系统、全面
- VISION:图像、图片、照片、截图、视觉
与原版的变更
| Bug | 修复 |
|---|
| 简单指标反转(高匹配 = 复杂) | 现在正确:高简单关键词匹配 = FAST层级 |
| 代理任务未提升层级 |
多步骤任务现在正确提升至CODE层级 |
| 视觉任务分类错误 | 视觉关键词现在优先于其他分类 |
| 代码关键词未检测到 | 添加了React、JWT、API和其他常见代码术语 |
| 置信度始终较低 | 现在根据关键词匹配强度适当变化 |