Skill Invocation System
This is a framework-style skill for "skill selection and invocation flow". It does not implement a specific tool; instead, it provides stable decision rules for an agent to choose the best skill (or skill combination) for a user request.
Core Principles
- 1. Match the index first: consult
TOOLS.md (skills index) to quickly narrow down candidate skills. - Most specific wins: when multiple candidates match, choose the one whose triggers best align with the user's intent.
- When unsure, consult SKILL.md: if still unclear, read the candidate skill's
SKILL.md to confirm fit and constraints. - If in doubt, use it: if you cannot decide, pick the closest and usable candidate skill.
Invocation Flow
When a user request arrives, follow this order:
- 1. Match trigger keywords using the
TOOLS.md index. - If matched with high confidence → use that skill.
- If no match / unclear → read the candidate skill's
SKILL.md. - If multiple are suitable → choose the most specific one.
- If still unclear → use
"if in doubt, use it".
Requirements: Provide TOOLS.md
To make this skill reusable by anyone, your workspace needs a TOOLS.md (or an equivalent index) that maps "user intent / trigger keywords" to "candidate skill ids".
Index Contract
In TOOLS.md, skillId should follow one of these rules (pick one and keep it consistent):
- 1. Equal to the skill folder name (for example:
~/.openclaw/workspace/skills/<skillId>/SKILL.md) - Or equal to the name/slug your orchestration layer uses to call that skill
As long as skillId matches the actual callable skill identifier, this framework can be reused by anyone.
Suggested TOOLS.md format (minimum viable):
CODEBLOCK0
Matching rules (agent-side):
- 1. Split
triggers by commas / delimiters into multiple trigger phrases. - Do case-insensitive matching against the user message; if a trigger phrase "appears", count it as a hit.
- When multiple candidates match, use a "most specific first" heuristic:
- Longer trigger phrases are more specific (for example:
current weather is more specific than
weather)
- More matched trigger keywords is more specific
- Higher semantic alignment with the candidate's
summary (closer wording) is more specific
When the index matches but you are still uncertain:
- 1. Read the candidate skill's
SKILL.md. - Look for sections like
When to Use, Decision Rules, or "Notes/Constraints" to validate fit. - If you cannot find enough evidence or there is an obvious mismatch, fall back to
"if in doubt, use it".
Decision Output (recommended output contract)
To make orchestration easier, when making a decision this skill should output (order does not matter):
- 1.
SELECTED_SKILLS: the list of selected skillIds (one or many) - INLINECODE22 : a short explanation of which triggers matched and why the choice is most specific
- INLINECODE23 : the recommended calling plan for the orchestrator (for example: call the first skill, then the second)
Optional: Combination Strategy (optional)
If you want a single request to map to multiple steps, you can define an additional "combination" section in TOOLS.md (not required). When the agent detects that triggers hit multiple steps:
- 1. Execute the most core step first (often "input / retrieval / preparation").
- Execute the step closest to the desired output shape next (for example: summarizing / formatting / exporting).
(The exact definition format is up to you; the key is that TOOLS.md explains why the combination is needed.)
Judgment Checklist (when unsure)
If you cannot decide which skill to use, check in order:
- 1. Is the request covered by the candidate skill's description? → Yes → use it
- Could the request be handled better without this skill? → No → use it
- Still cannot decide → INLINECODE26
Index Maintenance (optional)
If you maintain the TOOLS.md index, keep it accurate so selection logic stays reliable:
- 1. Scan your workspace/install directories for candidate skill folders (according to your OpenClaw installation conventions).
- For each skill, read its
SKILL.md for "when to use / trigger suggestions / constraints" (if available). - Add or update each skill's
skillId + triggers + summary in TOOLS.md.
技能调用系统
这是一个框架式技能,用于技能选择与调用流程。它不实现具体工具,而是为智能体提供稳定的决策规则,以便为用户请求选择最佳技能(或技能组合)。
核心原则
- 1. 优先匹配索引:查阅TOOLS.md(技能索引)快速缩小候选技能范围。
- 最具体者优先:当多个候选技能匹配时,选择其触发条件与用户意图最契合的技能。
- 不确定时查阅SKILL.md:若仍不明确,阅读候选技能的SKILL.md以确认适用性和约束条件。
- 有疑问则使用:若无法决定,选择最接近且可用的候选技能。
调用流程
当收到用户请求时,按以下顺序操作:
- 1. 使用TOOLS.md索引匹配触发关键词。
- 若高置信度匹配 → 使用该技能。
- 若无匹配/不明确 → 阅读候选技能的SKILL.md。
- 若多个技能均适用 → 选择最具体的一个。
- 若仍不明确 → 使用有疑问则使用原则。
要求:提供TOOLS.md
为使此技能可被任何人复用,你的工作区需要包含TOOLS.md(或等效索引),将用户意图/触发关键词映射到候选技能ID。
索引约定
在TOOLS.md中,skillId应遵循以下规则之一(选择其一并保持一致):
- 1. 等于技能文件夹名称(例如:~/.openclaw/workspace/skills//SKILL.md)
- 或等于编排层调用该技能时使用的名称/标识符
只要skillId与实际可调用的技能标识符匹配,此框架即可被任何人复用。
建议的TOOLS.md格式(最小可行版本):
md
TOOLS.md
技能索引
| skillId | triggers | summary |
|---|
| weather | current weather, forecast | 获取天气与预报 |
| summarize |
summarize, tl;dr | 总结URL/文件/PDF |
| stock-info-explorer | stock, quote, ticker | 分析股票价格与基本面 |
匹配规则(智能体端):
- 1. 将triggers按逗号/分隔符拆分为多个触发短语。
- 对用户消息进行不区分大小写的匹配;若触发短语出现,则计为命中。
- 当多个候选技能匹配时,使用最具体优先启发式规则:
- 较长的触发短语更具体(例如:current weather比weather更具体)
- 匹配的触发关键词越多越具体
- 与候选技能summary的语义对齐度越高(措辞越接近)越具体
当索引匹配但仍不确定时:
- 1. 阅读候选技能的SKILL.md。
- 查找使用时机、决策规则或注意事项/约束条件等章节以验证适用性。
- 若找不到足够证据或存在明显不匹配,则回退至有疑问则使用原则。
决策输出(推荐输出约定)
为简化编排,做出决策时此技能应输出(顺序不限):
- 1. SELECTEDSKILLS:所选skillId的列表(一个或多个)
- REASON:简要说明哪些触发条件匹配以及为何选择最具体
- NEXTACTION:为编排器推荐的调用计划(例如:先调用第一个技能,再调用第二个)
可选:组合策略(可选)
若希望单个请求映射到多个步骤,可在TOOLS.md中定义额外的组合部分(非必需)。当智能体检测到触发条件命中多个步骤时:
- 1. 先执行最核心的步骤(通常是输入/检索/准备)
- 再执行最接近所需输出形态的步骤(例如:总结/格式化/导出)
(具体定义格式由你决定;关键在于TOOLS.md需解释为何需要组合。)
判断检查清单(不确定时)
若无法决定使用哪个技能,按顺序检查:
- 1. 请求是否在候选技能描述范围内? → 是 → 使用它
- 不使用此技能是否能更好地处理请求? → 否 → 使用它
- 仍无法决定 → 有疑问则使用
索引维护(可选)
若你维护TOOLS.md索引,请保持其准确性以确保选择逻辑可靠:
- 1. 扫描工作区/安装目录中的候选技能文件夹(根据你的OpenClaw安装约定)。
- 对每个技能,阅读其SKILL.md中的使用时机/触发建议/约束条件(如有)。
- 在TOOLS.md中添加或更新每个技能的skillId + triggers + summary。