← Back to Skills Marketplace
hanxiao-bot

Auto Skill Trigger

by hanxiao-bot · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
147
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install auto-skill-trigger
Description
Auto Skill Trigger - Match skills to tasks using keyword scoring
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install auto-skill-trigger
  3. After installation, invoke the skill by name or use /auto-skill-trigger
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug auto-skill-trigger
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Auto Skill Trigger?

Auto Skill Trigger - Match skills to tasks using keyword scoring. It is an AI Agent Skill for Claude Code / OpenClaw, with 147 downloads so far.

How do I install Auto Skill Trigger?

Run "/install auto-skill-trigger" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Auto Skill Trigger free?

Yes, Auto Skill Trigger is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Auto Skill Trigger support?

Auto Skill Trigger is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Auto Skill Trigger?

It is built and maintained by hanxiao-bot (@hanxiao-bot); the current version is v1.0.0.

💬 Comments