Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/dvcrn/openclaw-skills-marketplace --skill smart-router-skill명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your agent a soul.
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
SOC 직업 분류 기준
SKILL.md 표시 중
| name | smart-router-skill |
| description | Smart Router Skill |
智能路由器是一个先进的模型调度系统,它超越了简单的关键词匹配,使用多维度分析来为每个消息选择最合适的模型。系统包含成本优化、自动模型扫描和性能监控功能。
# 1. 复制技能文件到OpenClaw技能目录
cp -r smart-router-skill /opt/homebrew/lib/node_modules/openclaw/skills/
# 2. 更新OpenClaw配置以启用技能
openclaw config patch --json '{"skills":{"entries":{"smart-router":{"enabled":true}}}}'
# 3. 重启OpenClaw
openclaw gateway restart
export OPENROUTER_API_KEY="your-openrouter-api-key"
export DEEPSEEK_API_KEY="your-deepseek-api-key"
cd /Users/nora/.openclaw/users/main/workspace
node enhanced-intent-router.js init
./test-integration.sh
node update-openclaw-config.js update
openclaw gateway restart
// 使用智能路由器路由消息
const { SmartIntentRouter } = require('./enhanced-intent-router.js');
const router = new SmartIntentRouter();
await router.initialize();
const decision = router.analyzeMessage("帮我写一个Python函数");
console.log(decision);
// 输出: { agentId: 'code-agent', model: '4sapi-anthropic/claude-sonnet-4-5-20250929', ... }
# 初始化路由器
node enhanced-intent-router.js init
# 分析消息路由
node enhanced-intent-router.js analyze "你的消息"
# 运行测试用例
node enhanced-intent-router.js test
# 查看性能指标
node enhanced-intent-router.js stats
# 生成详细报告
node enhanced-intent-router.js report
系统自动集成到OpenClaw,无需手动调用。所有消息都会经过智能路由器处理。
{
"routingRules": {
"priority": [
{
"name": "代码相关任务",
"conditions": {
"keywords": ["代码", "编程", "Python", "Java"],
"minLength": 10,
"maxLength": 5000
},
"agent": "code-agent",
"model": "4sapi-anthropic/claude-sonnet-4-5-20250929",
"priority": 100
}
],
"fallback": {
"agent": "free-agent",
要添加新的路由规则:
smart-router-config.jsonroutingRules.priority 数组中添加新规则系统包含以下自动化定时任务:
| 任务名称 | 时间 | 描述 |
|---|---|---|
| OpenRouter扫描 | 每天 6:00 | 扫描免费模型并更新配置 |
| 每日性能报告 | 每天 0:00 | 生成路由性能报告 |
| 每周成本分析 | 每周一 9:00 | 分析成本优化效果 |
| 配置备份 | 每天 23:30 | 备份配置和日志 |
| 规则优化检查 | 每天 12:00 | 检查并优化路由规则 |
class SmartIntentRouter {
// 初始化路由器
async initialize()
// 分析消息并返回路由决策
analyzeMessage(message, context)
// 获取性能指标
getMetrics()
// 生成详细报告
generateReport()
}
{
agentId: 'code-agent', // 目标代理ID
model: 'model-id', // 选择的模型
reasoning: false, // 是否启用推理模式
ruleName: '规则名称', // 匹配的规则名称
confidence: 0.95, // 置信度 (0-1)
reason: '匹配原因', // 路由原因
features: { ... }, // 消息特征分析
costOptimized: true // 是否成本优化
}
# 检查系统状态
node smart-router-maintenance.js health
# 运行每日维护
node smart-router-maintenance.js daily
# 运行每周维护
node smart-router-maintenance.js weekly
# 创建备份
node smart-router-maintenance.js backup
# 清理旧备份(保留30天)
node smart-router-maintenance.js clean-backups
# 检查配置文件
node enhanced-intent-router.js init
# 查看详细错误
OPENCLAW_DEBUG=1 node enhanced-intent-router.js init
# 检查API密钥
echo $OPENROUTER_API_KEY
# 手动运行扫描器
node openrouter-scanner.js
系统使用智能缓存减少重复计算。默认缓存TTL为3600秒,可根据使用情况调整:
{
"performanceSettings": {
"cacheEnabled": true,
"cacheTTL": 3600,
"maxResponseTime": 30000
}
}
enhanced-intent-router.js 中添加新功能可以扩展 analyzeMessage 方法添加自定义分析逻辑:
class CustomRouter extends SmartIntentRouter {
analyzeMessage(message, context) {
// 自定义分析逻辑
const features = this.extractCustomFeatures(message);
// 调用父类方法
return super.analyzeMessage(message, { ...context, customFeatures: features });
}
}
如有问题或建议:
技能作者:OpenClaw AI
最后更新:2026-02-15
许可证:MIT
状态:生产就绪 ✅