← 返回 Skills 市场
hanxiao-bot

Auto Skill Trigger

作者 hanxiao-bot · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
147
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install auto-skill-trigger
功能描述
Auto Skill Trigger - Match skills to tasks using keyword scoring
使用说明 (SKILL.md)

Auto Skill Trigger - Automatic Skill Matching

Overview

Automatically match relevant skills to the current task using keyword/pattern scoring. Pre-filters the \x3Cavailable_skills> list before the LLM decides which to load.

How It Works

  1. When a message arrives, score each skill's description against the message
  2. Only include high-scoring skills in the prompt
  3. The LLM makes the final decision from a relevant subset

Scoring Algorithm

Simple TF-IDF-like keyword overlap:

api.registerHook("before_prompt_build", async ({ event, ctx }) => {
  const msg = event.messages?.[0]?.content || "";
  const keywords = extractKeywords(msg);
  
  // Get all skills and their descriptions
  const skills = await getAllSkills();
  const scored = skills.map(skill => ({
    skill,
    score: keywordOverlap(keywords, skill.description)
  })).filter(s => s.score > 0.3); // threshold
  
  // Sort by score and take top 5
  scored.sort((a, b) => b.score - a.score);
  const topSkills = scored.slice(0, 5);
  
  // Return instruction to prioritize matched skills
  if (topSkills.length > 0) {
    return {
      prompt: `\
\
## Skill Hint\
Focus on: ${topSkills.map(s => s.skill.name).join(", ")}\
`
    };
  }
  return {};
});

Keyword Extraction

function extractKeywords(text) {
  // Extract meaningful words/n-grams
  const words = text.toLowerCase()
    .split(/\W+/)
    .filter(w => w.length > 2)
    .filter(w => !STOP_WORDS.has(w));
  return new Set(words);
}

function keywordOverlap(keywords, description) {
  const descWords = extractKeywords(description);
  let matches = 0;
  for (const kw of keywords) {
    if (descWords.has(kw)) matches++;
  }
  return matches / keywords.size;
}

Configuration

{
  "agents": {
    "defaults": {
      "autoSkillTrigger": {
        "enabled": true,
        "maxSkills": 5,
        "threshold": 0.3,
        "stopWords": ["the", "a", "an", "is", "are", "and"]
      }
    }
  }
}

Patterns That Match

Message Pattern Matched Skills
"帮我查 GitHub issue" github
"天气怎么样" weather
"写个 Python 脚本" coding
"搜一下最近的新闻" search

Limitations

  • Pattern-based matching is imperfect
  • Complex tasks may need multiple skills
  • LLM still has final say via SKILL.md scanning
  • Update threshold based on results
安全使用建议
This skill is coherent and low-risk: it simply ranks available skills by keyword overlap and inserts a short 'Focus on:' hint into the prompt. Before installing, confirm your agent runtime exposes the required hook APIs (api.registerHook, getAllSkills), and be aware that the hint intentionally biases the LLM toward the listed skills (which can hide other relevant skills). The sample code is minimal and has small robustness issues (e.g., no handling for empty keyword sets); consider testing and tuning threshold/maxSkills/stopWords. No secrets or external downloads are required.
功能分析
Type: OpenClaw Skill Name: auto-skill-trigger Version: 1.0.0 The skill implements a keyword-based scoring mechanism to pre-filter and suggest relevant skills to the LLM based on user input. The logic, contained in SKILL.md, uses a hook to inject a 'Skill Hint' into the prompt to improve agent focus. No indicators of data exfiltration, malicious execution, or harmful prompt injection were found.
能力评估
Purpose & Capability
Name/description match the implementation: the SKILL.md shows a small keyword-overlap algorithm that scores available skills and returns a short prompt hint. It doesn't request unrelated credentials or binaries. It does assume runtime APIs like api.registerHook and getAllSkills exist in the agent environment — reasonable for a hook-style skill but may fail if those APIs are absent.
Instruction Scope
Instructions are limited to scoring skills' descriptions against the incoming message and adding a 'Skill Hint' block to the prompt. They do not read files, env vars, or external endpoints. Caveats: the hint biases the LLM toward listed skills (intentional but may hide relevant skills), the sample code has minor robustness issues (e.g., dividing by keywords.size could be problematic if empty), and it assumes access to the agent's skill registry and SKILL.md content.
Install Mechanism
No install spec and no code files — instruction-only. This is lowest-risk from an installation perspective (nothing is written to disk or downloaded).
Credentials
Requires no environment variables, credentials, or config paths. The only access it needs is the agent-provided ability to list available skills and their descriptions, which is proportional to its purpose.
Persistence & Privilege
always is false and the skill does not request elevated privileges. It registers a 'before_prompt_build' hook (intended behavior) which will influence skill selection when run. Autonomous invocation is allowed by platform default; combined with other concerns that could be significant, but by itself this is a normal pattern for a skill of this type.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install auto-skill-trigger
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /auto-skill-trigger 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of auto-skill-trigger: Auto Skill Trigger - Match skills to tasks using keyword scoring. - Automatically scores and filters available skills based on message relevance using a simple TF-IDF-like keyword overlap algorithm. - Only top-matching skills (configurable, default: top 5 above a 0.3 threshold) are considered, streamlining skill selection. - Supports basic stop word filtering and custom configuration for max skills and threshold. - Displays skill hints in the prompt to guide further action.
元数据
Slug auto-skill-trigger
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Auto Skill Trigger 是什么?

Auto Skill Trigger - Match skills to tasks using keyword scoring. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 147 次。

如何安装 Auto Skill Trigger?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install auto-skill-trigger」即可一键安装,无需额外配置。

Auto Skill Trigger 是免费的吗?

是的,Auto Skill Trigger 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Auto Skill Trigger 支持哪些平台?

Auto Skill Trigger 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Auto Skill Trigger?

由 hanxiao-bot(@hanxiao-bot)开发并维护,当前版本 v1.0.0。

💬 留言讨论