Skill Router (增收降本版 v1.0.0)
智能技能选择器 - 用于增收降本的 AI 操作优化工具。
自动选择并执行最优技能,在保证质量的前提下最小化 Token 成本。
When to Use
- - User wants to accomplish something but doesn't know which skill to use
- Multiple skills could solve the same problem - need to pick the best one
- Want to minimize token cost while maximizing quality
- Need to evaluate skills from clawhub.com before installation
Workflow
1. Parse Task
Analyze user request and decompose into atomic subtasks if needed.
2. Discover Skills
Search for candidate skills:
- - List local installed skills: INLINECODE0
- Search clawhub.com: INLINECODE1
3. Evaluate Candidates
For each candidate skill, score on:
| Dimension | Weight | Evaluation Criteria |
|---|
| Quality/Utility | 35% | User ratings, downloads, functionality match |
| Token Cost |
30% | Estimated input/output tokens based on skill complexity |
| Security/Reliability | 20% | Code audit, permissions, update frequency, author trust |
| Speed | 15% | API response time, execution efficiency |
Scoring Algorithm:
CODEBLOCK0
4. Generate Recommendations
Present Top-3 ranked options:
- - Rank, skill name, final score
- Breakdown by dimension
- Estimated tokens and time
- Reasoning for recommendation
- Security assessment summary
5. User Confirmation
Wait for user to:
- - Select option (1, 2, or 3)
- Request more details about a skill
- Cancel or modify the task
6. Execute
After confirmation:
- - If skill not installed: INLINECODE2
- Execute the skill with original user request
- Record actual metrics vs estimates
Security Assessment
Before recommending any skill from clawhub:
- 1. Code Review: Check for suspicious patterns (network calls, file system access, credential harvesting)
- Permission Analysis: Verify requested permissions match functionality
- Author Verification: Prefer verified authors, established projects
- Update Frequency: Recently updated skills are preferred
- Community Trust: Ratings, issues, download count
Red flags that disqualify a skill:
- - Requests excessive permissions for its stated purpose
- Contains obfuscated code
- Makes unexpected network calls
- Has no recent updates and low community engagement
Token Estimation
Estimate token costs based on:
- - Skill description length/complexity
- Historical usage data (if available)
- Number of API calls required
- Output format verbosity
Store actual vs estimated for continuous improvement.
Scripts
- -
scripts/evaluate_skill.py - Score a skill across all dimensions - INLINECODE4 - Search and fetch skill metadata from clawhub
- INLINECODE5 - Estimate token and time costs
References
- -
references/evaluation-rubric.md - Detailed scoring criteria - INLINECODE7 - Security audit checklist
技能路由器(增收降本版 v1.0.0)
智能技能选择器——用于增收降本的AI操作优化工具。
自动选择并执行最优技能,在保证质量的前提下最小化Token成本。
使用场景
- - 用户想完成某项任务但不知道使用哪个技能
- 多个技能可解决同一问题——需要挑选最佳方案
- 希望在最大化质量的同时最小化Token成本
- 安装前需要评估来自clawhub.com的技能
工作流程
1. 解析任务
分析用户请求,必要时将其分解为原子性子任务。
2. 发现技能
搜索候选技能:
- - 列出本地已安装技能:openclaw skills list
- 搜索clawhub.com:clawhub search <关键词>
3. 评估候选技能
对每个候选技能进行评分:
| 维度 | 权重 | 评估标准 |
|---|
| 质量/实用性 | 35% | 用户评分、下载量、功能匹配度 |
| Token成本 |
30% | 基于技能复杂度的预估输入/输出Token |
| 安全性/可靠性 | 20% | 代码审计、权限、更新频率、作者可信度 |
| 速度 | 15% | API响应时间、执行效率 |
评分算法:
最终得分 = (质量 × 0.35) + (Token得分 × 0.30) + (安全性 × 0.20) + (速度 × 0.15)
4. 生成推荐
展示排名前3的选项:
- - 排名、技能名称、最终得分
- 各维度得分明细
- 预估Token和时间
- 推荐理由
- 安全评估摘要
5. 用户确认
等待用户:
- - 选择选项(1、2或3)
- 请求查看技能更多详情
- 取消或修改任务
6. 执行
确认后:
- - 若技能未安装:clawhub install <技能名称>
- 使用原始用户请求执行该技能
- 记录实际指标与预估值的对比
安全评估
在推荐来自clawhub的任何技能前:
- 1. 代码审查:检查可疑模式(网络调用、文件系统访问、凭证窃取)
- 权限分析:验证请求的权限与功能匹配
- 作者验证:优先选择已验证作者和成熟项目
- 更新频率:优先选择近期更新的技能
- 社区信任度:评分、问题反馈、下载量
导致技能不合格的红旗警示:
- - 针对其声称用途请求过多权限
- 包含混淆代码
- 进行意外的网络调用
- 无近期更新且社区参与度低
Token估算
基于以下因素估算Token成本:
- - 技能描述长度/复杂度
- 历史使用数据(如有)
- 所需API调用次数
- 输出格式的详细程度
存储实际值与预估值,用于持续改进。
脚本
- - scripts/evaluateskill.py - 对所有维度进行技能评分
- scripts/searchclawhub.py - 搜索并获取clawhub上的技能元数据
- scripts/calculate_cost.py - 估算Token和时间成本
参考资料
- - references/evaluation-rubric.md - 详细评分标准
- references/security-checklist.md - 安全审计清单