OpenClaw的高可用多角色模型路由器。自动发现可用模型,将其映射至基于角色的部门,并按任务复杂度与领域进行智能路由。
Use this skill when the user wants OpenClaw to coordinate many models intelligently instead of relying on a single default model.
This skill implements a pragmatic version of a 三省六部 / multi-role court pattern:
~/.openclaw/skills, or <workspace>/skills. Workspace skills have the highest precedence.SKILL.md with YAML frontmatter.config/model_registry.yaml: model capability tags and routing preferencesconfig/agent_roles.yaml: role definitions with forbidden actions and model strategiesconfig/agent_prompts.yaml: deep system prompts for each role (identity, rules, red lines)config/routing_rules.yaml: deterministic routing hintsconfig/failure_policies.yaml: auth breaker, retry, degrade rulesconfig/benchmark_tasks.yaml: standardized test tasks per category (coding/writing/reasoning/ops/security/finance)scripts/router.py: main planner/router/selector (now with benchmark-aware scoring)scripts/health_check.py: discover models from openclaw.jsonscripts/model_validator.py: probe each model with real API calls to verify availabilityscripts/benchmark.py: run the same task against all models, score and rank by categoryscripts/emit_openclaw_status.py: print machine-readable routing statescripts/route_and_update.sh: unified CLI entry pointexamples/: sample config patches and install docs每个角色配备深度 system prompt(定义在 config/agent_prompts.yaml),包含身份认同、职责边界、行为准则、协作意识和生死线五个维度。
角色官衔朝制对应核心使命router-chief中枢总管天子/中枢院系统的生命线——分类、路由、维持心跳
角色官衔朝制对应核心使命cabinet-planner内阁首辅中书省草拟方略——将混沌拆解为有序步骤censor-review都御史门下省/都察院封驳审核——质量的最后守门人
角色官衔朝制对应核心使命ministry-coding工部尚书工部兴修工程——编码、调试、架构ministry-ops工部侍郎工部·营缮司维护驿站——部署、运维、CI/CDministry-security兵部尚书兵部戍边防务——安全审计、威胁建模ministry-writing礼部尚书礼部文教礼仪——文案、文档、翻译ministry-legal刑部尚书刑部律法刑狱——合同、合规、条款ministry-finance户部尚书户部钱粮赋税——定价、毛利、结算
角色官衔朝制对应核心使命emergency-scribe急递铺令急递铺系统永不宕机的最后保障
If a model fails with an auth error:
auth_deadNever assign the largest prompt, heaviest workspace, or the most fragile provider to the router-chief.
Fallback order should be:
If the best specialist models are unavailable:
All models failed if any model remains viablebash
# 验证 → 路由(一条命令搞定)
bash scripts/route_and_update.sh full "Fix WireGuard peer sync bug"
# 单独路由
bash scripts/route_and_update.sh route "写一段产品介绍文案"
# 探活所有模型
bash scripts/route_and_update.sh validate
# 跑基准测试(全部类别)
bash scripts/route_and_update.sh benchmark
# 只测 coding 类别
bash scripts/route_and_update.sh benchmark coding
# 查看排行榜
bash scripts/route_and_update.sh leaderboard
bash
# 1. 发现模型
python3 scripts/health_check.py --openclaw-config ~/.openclaw/openclaw.json --write-state .imperial_state.json
# 2. 探活验证(真正调 API 确认模型可用)
python3 scripts/model_validator.py --openclaw-config ~/.openclaw/openclaw.json --state-file .imperial_state.json
# 3. 跑基准测试
python3 scripts/benchmark.py --openclaw-config ~/.openclaw/openclaw.json --state-file .imperial_state.json
# 4. 路由(自动读取 benchmark 分数加持)
python3 scripts/router.py --task "Design a distributed lock service" --state-file .imperial_state.json
# 5. 记录失败
python3 scripts/router.py --task "any" --record-failure modelstudio/qwen3.5-plus auth --write-state
The router returns JSON including:
mode: direct / plan_then_execute / multi_agent / degradedlead_role + lead_title (角色官衔)lead_system_prompt (深度角色提示词,可直接注入 agent)review_roles + review_system_promptsforbidden_actions (角色禁止行为列表)selected_modelfallback_chainsurvival_modelreasoning (含 benchmark 分数信息)This skill does not hard-code one provider API. Instead it prepares routing decisions and failure state so you can:
Copy this folder to:
text
<your-workspace>/skills/imperial-orchestrator
Copy this folder to:
text
~/.openclaw/skills/imperial-orchestrator