IntentRouter:Openclaw Skills 的智能大模型编排引擎
作者:互联网
2026-03-30
什么是 IntentRouter?
IntentRouter 作为管理 Openclaw Skills 内部复杂工作流的核心编排层。它充当智能调度员,分析传入的请求(无论是编码、创意写作还是深度研究),并将其与 OpenRouter 上最强大的可用模型进行匹配。通过将任务委派给特定层级的子代理,它确保用户无需手动切换模型即可获得最高质量的输出。
该技能采用安全优先的方法构建,通过将路由逻辑与凭据管理隔离,消除了网关身份验证密钥泄露的风险。它实现了一个无缝的多代理环境,其中像 Gemini 2.5 Flash 这样快速的编排器可以有效地管理用于工程的 MiniMax 或用于创意前端设计的 Kimi 等专业模型,从而最大限度地发挥 Openclaw Skills 设置的整体效用。
下载入口:https://github.com/openclaw/skills/tree/main/skills/runeweaverstudios/friday-router
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install friday-router
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 friday-router。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
IntentRouter 应用场景
- 自动将复杂的调试和重构任务委派给 MiniMax 2.5 等专业工程模型。
- 将创意写作、UI/UX 设计和前端开发请求路由到 Kimi k2.5 等高上下文模型。
- 通过将流量引导至针对速度和信息检索优化的模型(如 Grok Fast)来处理研究密集型查询。
- 实现安全的多代理架构,主代理从不直接处理敏感任务执行。
- 主编排代理接收用户消息并使用 spawn 命令执行 IntentRouter 脚本。
- 路由程序根据预定义的关键字层级分析文本,以识别任务类别(例如:代码、视觉、研究)。
- 根据分类,路由程序从 OpenRouter 中选择最佳模型 ID 并生成 JSON 有效负载。
- 编排器接收此 JSON 并立即启动 sessions_spawn 命令以调用专业的子代理。
- 子代理执行特定任务并将结果返回给编排器。
- 编排器通过删除内部元数据来清理响应,并将最终精炼的内容呈现给用户。
IntentRouter 配置指南
要将 IntentRouter 集成到您的 Openclaw Skills 中,请按照以下步骤操作:
- 确保您的环境中配置了有效的 OpenRouter API 密钥。
- 将技能目录放置在您的工作空间中,并确认
config.json包含您所需的模型映射。 - 通过 CLI 测试分类逻辑:
python3 workspace/skills/friday-router/scripts/router.py classify "实现 JWT 身份验证流程"
- 对于生产环境中的标准任务委派,请使用 spawn 标志:
python3 workspace/skills/friday-router/scripts/router.py spawn --json "您的任务描述"
IntentRouter 数据架构与分类体系
IntentRouter 通过本地配置文件和结构化 JSON 输出管理其逻辑,以确保跨 Openclaw Skills 的兼容性。
| 组件 | 描述 |
|---|---|
config.json |
存储任务层级到特定 OpenRouter 模型路径的映射。 |
router.py |
处理分类和派生参数的核心逻辑引擎。 |
| JSON 输出 | 包含 task(过滤后的字符串)、model(OpenRouter 路径)和 sessionTarget(执行模式)。 |
scripts/ |
包含用于手动列出模型和诊断分类的 CLI 工具。 |
name: friday-router
displayName: IntentRouter
description: Your AI's Smart Traffic Director—precisely matching OpenClaw tasks to the perfect LLM. Intelligent orchestration with OpenRouter. Security-focused: no gateway auth exposure.
version: 1.7.0
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):
-
Run IntentRouter to get spawn params:
python3 workspace/skills/friday-router/scripts/router.py spawn --json "" Example output:
{"task":"write a poem about Mai","model":"openrouter/moonshotai/kimi-k2.5","sessionTarget":"isolated"} -
Immediately call
sessions_spawnwith the router's output. Use the exactmodelfrom the JSON. Example:sessions_spawn(task="write a poem about Mai", model="openrouter/moonshotai/kimi-k2.5", sessionTarget="isolated")Do not change the
modelvalue. If the router saidopenrouter/moonshotai/kimi-k2.5, pass exactly that. -
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: 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
python scripts/router.py default # Show default model
python scripts/router.py classify "fix lint errors" # Classify → tier + model
python scripts/router.py spawn --json "write a poem" # JSON for sessions_spawn (no gateway secrets)
python scripts/router.py models # List all models
Note: Gateway auth management is not included. Use gateway-guard skill separately if needed.
sessions_spawn examples
Creative task (poem):
router output: {"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")
Code task (bug fix):
router output: {"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")
Research task:
router output: {"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")
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 |
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
信号管道:自动化营销情报工具 - Openclaw Skills
技能收益追踪器:监控 Openclaw 技能并实现变现
AI 合规准备就绪度:评估与治理工具 - Openclaw Skills
FOSMVVM ServerRequest 测试生成器:自动化 API 测试 - Openclaw Skills
酒店搜索器:AI 赋能的住宿与位置情报 - Openclaw Skills
Dub 链接 API:程序化链接管理 - Openclaw Skills
IntercomSwap:P2P BTC 与 USDT 跨链兑换 - Openclaw Skills
spotplay:macOS 原生 Spotify 播放控制 - Openclaw Skills
DeepSeek OCR:AI驱动的图像文本识别 - Openclaw Skills
Web Navigator:自动化网页研究与浏览 - Openclaw Skills
AI精选
