all-in-one/clawdbot-integration/plugin/higress-auto-router/SKILL.md
# Higress Auto Router SKILL Configure automatic model routing based on user's natural language requests. ## Description This skill enables users to configure Higress AI Gateway's model-router plugin through natural language commands. When a user describes their routing preference (e.g., "route to claude-opus-4.5 when solving difficult problems"), this skill will: 1. Analyze user's request to understand the routing intent 2. Generate appropriate regex patterns that are distinctive and easy to
npx skillsauth add higress-group/higress-standalone all-in-one/clawdbot-integration/plugin/higress-auto-routerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Configure automatic model routing based on user's natural language requests.
This skill enables users to configure Higress AI Gateway's model-router plugin through natural language commands. When a user describes their routing preference (e.g., "route to claude-opus-4.5 when solving difficult problems"), this skill will:
/data/wasmplugins/model-router.internal.yamlUse this skill when:
higress-ai-gateway (default) or user-specifieddocker exec commandsInside Container: /data/wasmplugins/model-router.internal.yaml
Default Container Name: higress-ai-gateway
Extract from the user's request:
claude-opus-4.5, qwen-coder)Based on the scenario, generate:
Common mappings:
| Scenario | Trigger Phrases | Pattern |
|----------|-----------------|---------|
| Complex/difficult reasoning | 深入思考, deep thinking | (?i)^(深入思考|deep thinking) |
| Coding tasks | 写代码, code:, coding: | (?i)^(写代码|code:|coding:) |
| Creative writing | 创意写作, creative: | (?i)^(创意写作|creative:) |
| Translation | 翻译:, translate: | (?i)^(翻译:|translate:) |
| Math problems | 数学题, math: | (?i)^(数学题|math:) |
| Image generation | 画图:, draw:, image: | (?i)^(画图:|draw:|image:) |
| Quick answers | 快速回答, quick: | (?i)^(快速回答|quick:) |
Try to find the Higress container:
higress-ai-gatewaydocker ps --filter "name=higress" to find containersRead the current model-router.internal.yaml file from inside the container:
docker exec <container_name> cat /data/wasmplugins/model-router.internal.yaml
Example configuration structure:
apiVersion: extensions.higress.io/v1alpha1
kind: WasmPlugin
metadata:
name: model-router.internal
namespace: higress-system
spec:
defaultConfig:
modelToHeader: x-higress-llm-model
autoRouting:
enable: true
defaultModel: qwen-turbo
rules:
- pattern: (?i)^(深入思考|deep thinking)
model: claude-opus-4.5
Before adding a new rule:
Use docker exec to modify the YAML file directly inside the container:
# Option 1: Use sed to add rule
docker exec <container_name> sed -i '/rules:/a\ - pattern: (?i)^(深入思考|deep thinking)\n model: claude-opus-4.5' /data/wasmplugins/model-router.internal.yaml
# Option 2: Copy file out, modify, copy back (safer)
docker cp <container_name>:/data/wasmplugins/model-router.internal.yaml /tmp/model-router.yaml
# Edit /tmp/model-router.yaml with new rule
docker cp /tmp/model-router.yaml <container_name>:/data/wasmplugins/model-router.internal.yaml
Recommended approach: Copy out, modify, copy in for safety and proper YAML formatting.
Important:
modelToHeader configuration(?i) for case-insensitive patterns^ to anchor pattern to message start (prevents false matches)After modifying the configuration, trigger Higress to reload the plugin configuration without restarting the container:
docker exec <container_name> touch /data/wasmplugins/model-router.internal.yaml
Note: Higress watches configuration files in /data/wasmplugins/ and automatically reloads when they are modified. Touching the file ensures the timestamp is updated to trigger the reload.
After successful configuration, inform the user:
Example response:
✅ 自动路由配置完成!
已添加规则:当消息以 "深入思考" 或 "deep thinking" 开头时,自动路由到 claude-opus-4.5 模型。
配置文件已更新(容器内):/data/wasmplugins/model-router.internal.yaml
配置已自动重载,无需重启容器。
使用方式:
- 中文:深入思考 如何优化这段代码的性能?
- English: deep thinking How to optimize this code's performance?
提示:请确保您的请求中 model 参数设置为 `higress/auto` 才能触发自动路由。
User: 我希望在解决困难问题时路由到claude-opus-4.5的模型
Response:
已为您配置自动路由规则:
触发方式:以 "深入思考" 或 "deep thinking" 开头发起请求
目标模型:claude-opus-4.5
配置文件已更新(容器内):/data/wasmplugins/model-router.internal.yaml
配置已自动重载
配置已生效。现在您可以这样使用:
- 深入思考 这道算法题应该怎么解?
- deep thinking What's the best architecture for this system?
User: 写代码的时候用qwen-coder
Response:
已为您配置自动路由规则:
触发方式:以 "写代码" 或 "code:" 开头发起请求
目标模型:qwen-coder
配置文件已更新(容器内):/data/wasmplugins/model-router.internal.yaml
配置已自动重载
配置已生效。使用示例:
- 写代码 实现一个快速排序算法
- code: implement a binary search tree in Python
When implementing this skill:
docker ps to find the running Higress container/data/wasmplugins/import subprocess
import yaml
import tempfile
import os
CONTAINER_NAME = "higress-ai-gateway"
CONFIG_PATH = "/data/wasmplugins/model-router.internal.yaml"
def read_container_config():
result = subprocess.run(
["docker", "exec", CONTAINER_NAME, "cat", CONFIG_PATH],
capture_output=True,
text=True
)
return yaml.safe_load(result.stdout)
def write_container_config(config):
with tempfile.NamedTemporaryFile(mode='w', suffix='.yaml', delete=False) as f:
yaml.dump(config, f, default_flow_style=False)
temp_path = f.name
# Copy back to container
subprocess.run(["docker", "cp", temp_path, f"{CONTAINER_NAME}:{CONFIG_PATH}"])
# Clean up
os.unlink(temp_path)
# Touch file to trigger reload
subprocess.run(["docker", "exec", CONTAINER_NAME, "touch", CONFIG_PATH])
def add_routing_rule(pattern, model):
config = read_container_config()
# Ensure autoRouting exists
if 'autoRouting' not in config['spec']['defaultConfig']:
config['spec']['defaultConfig']['autoRouting'] = {
'enable': True,
'defaultModel': 'qwen-turbo',
'rules': []
}
# Add rule
config['spec']['defaultConfig']['autoRouting']['rules'].append({
'pattern': pattern,
'model': model
})
write_container_config(config)
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.